How to Calculate Gas Mileage
By the Calculator.hair team · Updated · 6 min read
Short answer
To calculate gas mileage, divide the miles driven between two full fill-ups by the gallons needed to refill the tank: MPG = miles ÷ gallons. Driving 322 miles on 11.5 gallons gives 28 MPG. Fuel cost per mile is the price per gallon divided by MPG, so at an assumed $3.50 a gallon, 28 MPG costs $0.125 per mile.
Key takeaways
- MPG = miles driven ÷ gallons added, measured between two fill-ups to a full tank.
- L/100 km = 235.215 ÷ MPG, and the same formula converts in the other direction.
- Fuel cost per mile = price per gallon ÷ MPG, and it does not include maintenance, tires or depreciation.
- Trip cost = (distance ÷ MPG) × price per gallon.
- An average over several tanks is more reliable than a single fill-up.
What is the formula for gas mileage?
The formula is MPG = miles driven ÷ gallons of fuel used. MPG stands for miles per gallon, the number of miles a vehicle travels on one US gallon of fuel. A higher number means better fuel economy.
You can't read the fuel you used directly from a gauge with any accuracy, so the standard method uses the pump. If you fill the tank completely, drive, and fill it completely again, the second fill-up equals the fuel you burned in between. The gas mileage calculator takes the two odometer readings and the gallons added, then returns MPG, L/100 km and fuel cost per mile.
How do you calculate MPG from a fill-up?
Fill the tank, record the odometer, drive until you need fuel, fill the tank again, and divide the miles driven by the gallons on the pump receipt.
- Fill the tank until the pump clicks off, then write down the odometer reading. Say it reads 45,000. You can also reset the trip meter to zero.
- Drive normally until you are ready to refuel.
- Fill the tank again, stopping at the first click if you can, so both fill-ups end at the same level. Note the gallons added, say 11.5.
- Record the new odometer reading, say 45,322, and subtract: 45,322 − 45,000 = 322 miles.
- Divide: 322 ÷ 11.5 = 28 MPG.
How do you get a more accurate MPG figure?
Average over several tanks by adding all the miles and all the gallons, then dividing the totals. A single tank can mislead, because pumps shut off at slightly different levels and one tank may include more highway or city driving than usual.
Don't average the MPG figures themselves. A tank of 300 miles on 10 gallons (30 MPG) and a tank of 100 miles on 5 gallons (20 MPG) total 400 miles on 15 gallons, or 26.7 MPG, not 25. This is the same trap explained in the speed, distance and time guide: an average of rates has to be weighted.
If you skip recording a fill-up, restart the count. Otherwise the miles from the missed tank get counted against the gallons of the next one, and your MPG looks better than it really is. The My MPG tool on fueleconomy.gov works on the same principle: it needs consecutive full fill-ups to calculate a figure.
To compare your result with the official rating, look up your vehicle on fueleconomy.gov. Label ratings are estimates from standardized tests, so your own number can land above or below them depending on how, where and in what weather you drive. That site publishes the current figures, so confirm any EPA number there rather than relying on a copy elsewhere.
How do you convert MPG to L/100 km?
Divide 235.215 by the MPG figure. So 28 MPG is 235.215 ÷ 28 = 8.4 L/100 km. The formula works in both directions, so 7.5 L/100 km is 235.215 ÷ 7.5 = 31.36 MPG.
The constant comes from unit definitions. A US gallon is 3.785412 liters and a mile is 1.609344 kilometers, and 100 × 3.785412 ÷ 1.609344 = 235.215. L/100 km means liters of fuel per 100 kilometers, so unlike MPG, a lower number is better.
Other conversions use similar factors. Kilometers per liter equals MPG × 0.425144, so 28 MPG is 11.9 km/L. UK gallons are larger than US gallons, so the same car shows about 20% more MPG in UK units: 28 US MPG is 33.63 UK MPG.
The calculator also handles metric fill-ups. Driving 600 km on 50 liters gives 50 ÷ 600 × 100 = 8.33 L/100 km, which is 12 km/L or 28.23 US MPG.
What is the fuel cost per mile formula?
Fuel cost per mile = price per gallon ÷ MPG. At 28 MPG and an assumed price of $3.50 per gallon, each mile costs 3.50 ÷ 28 = $0.125, or 12.5 cents.
All the figures in the table below assume $3.50 per gallon. That price is an assumption for the examples, not a current average, so use what you actually pay. The US Energy Information Administration publishes weekly retail prices if you want a reference point.
Note how the savings shrink as MPG rises. Going from 15 to 20 MPG saves $5.83 per 100 miles, while going from 40 to 50 MPG saves only $1.75. Fuel use is proportional to L/100 km, not to MPG, which is why the same MPG gain matters more on a less efficient vehicle.
| MPG | L/100 km | Gallons per 100 miles | Cost per mile | Cost per 100 miles |
|---|---|---|---|---|
| 15 | 15.68 | 6.67 | $0.233 | $23.33 |
| 20 | 11.76 | 5 | $0.175 | $17.50 |
| 25 | 9.41 | 4 | $0.140 | $14.00 |
| 28 | 8.4 | 3.57 | $0.125 | $12.50 |
| 30 | 7.84 | 3.33 | $0.117 | $11.67 |
| 40 | 5.88 | 2.5 | $0.088 | $8.75 |
| 50 | 4.7 | 2 | $0.070 | $7.00 |
How do you calculate the fuel cost of a trip?
Trip fuel cost = (distance ÷ MPG) × price per gallon. Dividing distance by MPG gives the gallons you need, and multiplying by the price gives the cost. The fuel cost calculator does this in miles or kilometers and accepts MPG, L/100 km or km/L.
Worked example: a 350-mile trip in a car that gets 28 MPG, with fuel assumed at $3.50 per gallon. The trip needs 350 ÷ 28 = 12.5 gallons, and 12.5 × $3.50 = $43.75.
If you don't know the distance, the mileage calculator estimates it between two cities. For Chicago to St. Louis, it gives 262.3 miles in a straight line and a rough driving distance of 315 miles, which is the straight-line figure multiplied by 1.2. At 28 MPG and $3.50 per gallon, 315 miles takes 11.25 gallons and costs $39.38. The 1.2 factor is only an approximation, so use the mileage from a mapping app when you have a specific route.
| Trip | MPG | Gallons needed | Price assumed | Fuel cost |
|---|---|---|---|---|
| 315 miles | 24 | 13.13 | $3.50/gal | $45.94 |
| 315 miles | 28 | 11.25 | $3.50/gal | $39.38 |
| 350 miles | 28 | 12.5 | $3.50/gal | $43.75 |
| 1,200 miles | 30 | 40 | $3.50/gal | $140.00 |
How do you calculate trip cost in liters and kilometers?
Fuel needed in liters = distance in km × (L/100 km) ÷ 100, and cost is liters × price per liter. For a 500 km trip at 7.5 L/100 km, you need 500 × 7.5 ÷ 100 = 37.5 liters. At an assumed price of 1.60 per liter, the fuel costs 60.00 in your local currency, or 0.12 per kilometer.
Check that your price and your efficiency use the same fuel unit. Mixing a per-liter price with an MPG figure is the usual source of an answer that is off by nearly a factor of four, since a US gallon holds about 3.79 liters.
Calculators in this guide
Frequently asked questions
What is the formula for mileage calculation?
Mileage = distance traveled ÷ fuel used. In US units that is miles ÷ gallons, so 360 miles on 15 gallons is 24 MPG.
How do you calculate fuel cost per mile?
Divide the price per gallon by your MPG. At an assumed $3.50 per gallon and 25 MPG, that is $0.14 per mile.
Does fuel cost per mile cover the full cost of driving?
No. It covers fuel only, and leaves out maintenance, tires, insurance and depreciation, so the total cost of running a car per mile is higher.
How do I calculate gas mileage without filling the tank?
You can only estimate it, using the trip computer or fuel gauge, and those figures are less reliable. The fill-up method is more accurate because the pump measures the fuel directly.
What is a good MPG?
It depends on the vehicle class and year, so compare your result with the rating for your vehicle and similar models on fueleconomy.gov.
What is the difference between the gas mileage and mileage calculators?
The gas mileage calculator works out MPG from odometer readings and fuel added. The mileage calculator estimates the distance between two cities, which you can then use to work out a trip's fuel cost.