Skip to content

Free tool

Miles Per Gallon (MPG) Calculator

Work out your car's miles per gallon, cost per mile, and the fuel cost of any trip. Enter miles driven, gallons used, and the price of gas.

How to use the MPG Calculator

  1. Fill your tank and reset the trip meter.
  2. At the next fill-up, enter the miles driven and the gallons it took to refill.
  3. Add the gas price and a trip distance to see cost per mile and trip cost.

The formulas this calculator uses

What you want Formula
Miles per gallon (MPG) miles driven ÷ gallons used
Cost per mile price per gallon ÷ MPG
Gallons for a trip trip miles ÷ MPG
Trip fuel cost gallons for the trip × price per gallon
Liters per 100 km 235.215 ÷ MPG

MPG examples

Miles driven Gallons used MPG
250 10 25.0
300 15 20.0
320 11.5 27.8
400 12.5 32.0
450 13.2 34.1

Cost per mile at different MPG and gas prices

MPG Gas at $3.00 Gas at $3.50 Gas at $4.00
20 $0.150 $0.175 $0.200
25 $0.120 $0.140 $0.160
30 $0.100 $0.117 $0.133
35 $0.086 $0.100 $0.114
40 $0.075 $0.087 $0.100

A trip of 500 miles in a 25 MPG car needs 20 gallons. At $3.50 a gallon that is $70 in fuel.

How to measure MPG accurately

  1. Fill the tank until the pump clicks off, once only, and reset the trip meter.
  2. Drive normally until the tank is at least half empty.
  3. Fill up again at the same pump if you can, stopping at the first click.
  4. Enter the miles and the gallons you added.
  5. Repeat for two or three tanks and average the results. One tank can be skewed by a long highway trip or a cold week.

The fuel economy number on your dashboard is an estimate and can differ from what you calculate at the pump, so this method is more reliable. To compare your result with the official rating for your car, check the EPA label or the fueleconomy.gov page for your model.

How to get better gas mileage

  • Keep tires filled to the pressure on the sticker inside the driver's door.
  • Drive smoothly. Hard starts and stops waste gas.
  • Slow down on the highway.
  • Remove roof racks and heavy items you do not need.
  • Keep up with oil changes and air filters.

Walmart+ members can save up to 10 cents a gallon at some stations. See if it pays off with our Walmart+ savings calculator.

Frequently asked questions

How do I calculate miles per gallon?

Divide the miles you drove by the gallons you used. For example, 320 miles ÷ 11.5 gallons = about 27.8 MPG.

Why is my real MPG lower than the sticker?

City driving, cold weather, short trips, heavy loads, low tire pressure, and fast highway speeds can all lower real-world MPG.

How do I calculate cost per mile?

Divide the price of gas by your MPG. At $3.50 a gallon and 25 MPG, the fuel cost is $0.14 per mile. This calculator also shows the cost of a whole trip.

How do I convert MPG to liters per 100 km?

Divide 235.215 by your MPG. A car that gets 30 MPG uses about 7.8 liters per 100 km.

Is the MPG on my dashboard accurate?

It is an estimate. Measuring at the pump, by dividing miles by gallons added over a few tanks, usually gives a more dependable number.

What is a good MPG?

It depends on the type of vehicle. Compare your result with the official EPA rating for your exact model at fueleconomy.gov. A big gap can point to tire pressure, driving style or a maintenance issue.