Gas Mileage Tracker

Gas mileage calculator

Two odometer readings and the fuel you put in. That gives you the number your car actually gets, not the one it estimates for you.

Gas mileage calculator

Fill the tank, drive, fill it again. Put those two odometer readings in and you get the real number for that tank.

mi
mi
gal
$

Updates as you type. Nothing is sent anywhere.

Result

--

miles per gallon

Also written as
--
Distance covered
--
Cost of that tank
--
Fuel cost per mile
--
Fuel per year
--

Enter the two readings and the fuel to see the number.

Updated September 2026

How to use it

Gas mileage is measured between two full tanks. There is no way around that, because a fuel tank is the only measuring cup you have.

  1. Fill the tank all the way. Write down the odometer.
  2. Drive normally. A few hundred miles is ideal, a full tank is fine.
  3. Fill up all the way again, at the same pump if you can, and note the odometer and the gallons.
  4. Put both readings and the gallons into the calculator above.

The same pump matters more than people expect. Pumps cut off at slightly different points, and on a fifteen gallon fill a half-gallon difference in where the nozzle clicks is a three percent swing in your answer.

The formula

In plain arithmetic, with no units to trip over:

MPG = (odometer2 − odometer1) ÷ gallons

Gallons is what went in at the second fill-up.

A worked example. You fill up at 42,150 miles. You drive for a week and fill up again at 42,462 miles, and it takes 11.6 gallons.

  • Distance: 42,462 − 42,150 = 312 miles
  • Fuel: 11.6 gallons
  • 312 ÷ 11.6 = 26.9 MPG

At $3.29 a gallon that tank cost $38.16, which is 12.2 cents a mile. Drive 12,000 miles a year at that rate and fuel alone is about $1,470.

Units, and why yours might not be MPG

Three units are in common use, and they do not all point the same direction, which is where the confusion starts.

UnitUsed inHigher isMeaning
MPG (US)United StatesbetterMiles covered on one US gallon
MPG (imperial)UKbetterMiles on one imperial gallon, which is 20% larger
L/100 kmEurope, Canada, AustraliaworseLitres burned covering 100 km
km/LJapan, Latin America, IndiabetterKilometres covered on one litre

The imperial gallon trap catches people every week. A UK car advertised at 45 MPG is 37.5 MPG in American terms, because an imperial gallon is 4.55 litres against the US gallon's 3.79. That is not the car being better. It is the bucket being bigger. The calculator above handles all four, so pick your unit before you type.

Four ways people get the number wrong

Using the wrong fill-up's gallons

The gallons that go with a distance are the ones you put in at the end of it. Using the first fill-up's gallons measures a tank you burned before you started counting.

Topping off, or not topping off

Be consistent. Click off and stop, every time, or top off to the brim every time. Mixing the two is what produces a run of results that bounce between 24 and 33 for no visible reason.

Counting a partial fill

Twenty dollars' worth on a Tuesday is not a measurement. It is fine to record it for spending, but it cannot produce an MPG figure, and averaging it in drags the whole history sideways.

Judging the car on one tank

A single winter tank of short cold trips can read 20 percent below the same car's summer highway average. Both numbers are real. Neither is the car. Take the average across five or more tanks before you conclude anything.

MPG conversion table

The common figures, rounded, so you do not have to reach for the calculator for a rough answer.

MPG (US)MPG (imperial)L/100 kmkm/L
1518.015.76.4
2024.011.88.5
2530.09.410.6
3036.07.812.8
3542.06.714.9
4048.05.917.0
4554.05.219.1
5060.04.721.3

Questions people actually ask

What is the formula for gas mileage? +
Miles driven divided by gallons used. Drive from one full tank to the next, subtract the first odometer reading from the second, and divide by the gallons it took to fill up the second time.
Do I use the gallons from the first fill-up or the second? +
The second. The fuel you put in at the second stop is exactly the fuel you burned covering the distance between the two readings. Using the first fill-up is the single most common mistake.
How is this different from what my car's display says? +
Your trip computer estimates consumption from injector timing. It never sees the tank. Most run optimistic by roughly 3 to 8 percent, and some are worse. The calculator here uses fuel you were charged for, so it cannot flatter you.
How do I convert MPG to L/100 km? +
Divide 235.215 by the MPG figure. 30 MPG is 7.8 L/100 km. It works in both directions, because the two units are reciprocals of each other with a conversion factor bolted on.
Why is my MPG different every tank? +
Because driving is different every tank. Cold weather, short trips, a roof box, traffic, tyre pressure and how hard you accelerate each move it by a few percent, and they stack. One tank is noise. Five tanks is a number.
Can I calculate MPG from a partial fill-up? +
Not accurately. The method depends on the tank being at the same level at both ends. If you only put in twenty dollars' worth, you do not know where the level started or ended, so the arithmetic has nothing to stand on.

Keep going

The calculator is the one-off. The app is the habit.

A calculator tells you what one tank did. Log every fill-up and you get the trend: the month your MPG dropped, the station that is quietly more expensive, and what the car really costs you per mile.

  • Odometer, gallons, price. That is the whole form.
  • MPG per tank and a running average, calculated the tank-to-tank way
  • Charts for MPG, monthly spend and the price you have been paying per gallon
  • Several vehicles, and a CSV export when the accountant asks
Download Gas Mileage Tracker

Free on the App Store. Android version in the works.

Last tank

28.4 MPG

Average

26.9

Cost per mile

$0.13

This month

$187

Fill-ups

42