Fuel

Gas Mileage Calculator

This gas mileage calculator turns miles and gallons, or two odometer readings, into miles per gallon, L/100 km and kilometers per liter. A third tab works out the fuel a trip will take and, at the price you type in, what that fuel will cost.

Units
mi

Miles on the trip odometer since the tank was last filled.

gal

Gallons the pump put in to fill the tank back up.

Result

Updates as you type
Gas mileage 25.0 mpg
In the other unit 9.4 L/100 km
Kilometers per liter 10.6 km/L
Gallons per hundred miles 4.00 gal
Fuel economy on an mpg scale with the matching L/100 km scale beneath25.0 mpg equals 9.4 L/100 km. Equal steps in mpg save less and less fuel as mpg rises: the L/100 km marks crowd together at the high end.Miles per gallon (US)Liters per 100 km051015202530354045506030201512109876525.0 mpg9.4 L/100 km

How the gas mileage calculator works

The fill-up to fill-up method Fill the tank to the top and write down the odometer reading. Drive. Fill the tank to the top again and write down the gallons it took and the new odometer reading. Miles driven divided by those gallons is the mpg of that tank. 1. Fill to the topnote odometer A 2. Drive as usualmiles = B − A 3. Fill to the top againnote gallons and odometer B mpg = (odometer B − odometer A) ÷ gallons at the second fill-up

Gas mileage is distance divided by fuel: how many miles the car covers on each gallon. The only reliable way to know it is to measure both, and that is what the first two tabs do. The MPG tab is a plain mpg calculator for when you already know the miles and the gallons, for example from the trip odometer and the pump display. The Fill-up to fill-up tab takes two odometer readings instead, the way fueleconomy.gov recommends measuring it.

Each result comes in every common unit at once: miles per gallon, L/100 km, kilometers per liter and the gallons the car burns every hundred miles. That makes it a fuel economy calculator for comparing your figure with a European spec sheet or a forum post in metric units without hunting for a converter.

The Trip fuel cost tab works forward: distance and fuel economy give the fuel a trip will take, and the fuel price you type in turns that into a cost. The calculator has no prices of its own and assumes no currency.

What to enter and where to find it

  • Distance driven. From the trip odometer, reset when the tank was last filled to the top, or the difference between two odometer readings.
  • Fuel used. The gallons the pump shows when you fill the tank back up, not the size of the tank. Pumps show it to three decimals; two are plenty.
  • Odometer readings. The main odometer at the last full fill-up and now. Mixing up the main and trip odometers is the most common slip, especially in an unfamiliar car.
  • Your fuel economy and the fuel price. For a trip, use mpg you measured, typed in L/100 km if you switch to metric units. The price is per gallon, or per liter in metric, and stays optional.

The fill-up to fill-up method

The method fueleconomy.gov describes needs nothing but a pen. Fill the tank until the pump clicks off and write down the odometer. Drive as you normally would. At the next fill-up, fill it to the top again and write down the gallons it took and the new odometer reading. The miles between the two readings divided by the gallons of the second fill-up is the mpg of that tank. Resetting the trip odometer at every fill-up does the subtraction for you.

It only works if both fill-ups are complete. A partial fill on either end means the gallons no longer match the miles, and the result can be off in either direction. Filling at the same pump, letting it click off once and not topping up keeps the two fills comparable.

One tank is a snapshot. Weather, traffic, a long idle or a dragstrip day all move it, so log several tanks and work out the average from the totals: add up all the miles and all the gallons, then divide.

MPG, L/100 km and km/L

Miles per gallon and kilometers per liter measure economy: distance per unit of fuel, where higher is better. L/100 km and gallons per hundred miles measure consumption: fuel per unit of distance, where lower is better. Each pair is the other turned upside down, which is why an mpg figure does not scale linearly into L/100 km.

The difference matters when you compare cars or upgrades. The EPA’s own example: over 1,000 miles, going from 10 to 15 mpg saves about 33 gallons, while going from 30 to 35 mpg, the same gain on paper, saves only about 5. This is why the EPA fuel economy label also shows consumption, and why the drawing in the result shows the L/100 km marks bunching up at the high end of the mpg scale.

Trip fuel cost at your price

For a trip fuel cost, the calculator divides the distance by your fuel economy to get the fuel, then multiplies by the price you enter. The price can be in any currency: the result comes out in the same one, and a price per liter works the same way once the unit switch is set to metric. Leave the price empty and you still get the fuel.

Use mpg you have measured on similar driving. A highway trip usually returns better mileage than a week of short hops, and a car loaded for a track weekend usually returns less, so a fill-up figure from comparable driving beats any label.

The gas mileage formula

None of the formulas is an estimate: they are definitions and exact unit conversions, so the result is as good as the miles and gallons you enter. For a trip, the answer is only as good as the mpg you assume.

  1. mpg = miles driven ÷ gallons used
  2. Miles driven = odometer now − odometer at the last fill-up
  3. L/100 km = 235.215 ÷ mpg
  4. km/L = mpg × 1.609344 ÷ 3.785411784
  5. Trip fuel = trip miles ÷ mpg; trip cost = trip fuel × your price per gallon

The 235.215 is not a rounded rule of thumb. It is a hundred times the liters in a US gallon, 3.785411784, divided by the kilometers in a mile, 1.609344, and because L/100 km is consumption it divides into mpg instead of multiplying it. Gallons per hundred miles is simply the trip fuel formula for a hundred-mile trip.

Worked example

Two everyday questions, worked out with the same functions that run the calculator.

One tank, fill-up to fill-up

A driver fills a turbocharged four-cylinder hatchback to the top with the odometer at 21,450.0 miles. A week later the odometer reads 21,782.5 and the tank takes 12.5 gallons to fill again:

  1. Miles on this tank 21,782.5 − 21,450.0 = 332.5 mi
  2. Miles per gallon 332.5 mi ÷ 12.50 gal = 26.60 mpg
  3. Liters per 100 km 100 × 3.785412 L/gal ÷ 1.609344 km/mi = 235.215; 235.215 ÷ 26.60 = 8.84 L/100 km
  4. Kilometers per liter 26.60 × 1.609344 ÷ 3.785412 = 11.31 km/L
  5. Gallons per hundred miles 100 ÷ 26.60 = 3.76 gal

That tank returned 26.6 mpg, which is 8.8 L/100 km or 11.3 km/L, and the hatchback burned 3.76 gallons for every hundred miles.

Fuel for a trip

The same driver plans a 420-mile round trip to a dragstrip and uses the 26.6 mpg from that tank rather than the window sticker:

  1. Fuel needed 420 mi ÷ 26.6 mpg = 15.79 gal
  2. Fuel cost 15.79 gal × the price you pay per gallon
  3. Same trip in L/100 km 235.215 ÷ 26.6 = 8.84 L/100 km

The trip takes about 15.8 gallons. Multiply that by what you pay per gallon for the cost; type the price into the calculator and it does the multiplication, in whatever currency you pay in.

MPG to L/100 km conversion table

The table converts common mpg figures into the other units and shows the fuel each takes over 1,000 miles. Read down the last column to see the effect described above: each five-mpg step saves a lot of fuel near the top of the table, where mpg is low, and very little near the bottom.

MPG converted to L/100 km, km/L and fuel per distance (computed with the exact conversion factors)
mpg (US)L/100 kmkm/LGallons per hundred milesGallons for 1,000 miles
1023.54.310.00100.0
1515.76.46.6766.7
2011.88.55.0050.0
259.410.64.0040.0
307.812.83.3333.3
356.714.92.8628.6
405.917.02.5025.0
504.721.32.0020.0

Common mistakes

  • Not filling up completely both times. A partial fill at either end breaks the fill-up to fill-up method, as fueleconomy.gov points out. If one fill-up was partial, keep counting: add its gallons to those of the next full fill-up and divide the miles since the last full tank by the total.
  • Averaging mpg figures. The average of two tanks’ mpg is not the mpg of both. Add the miles, add the gallons and divide the totals.
  • Comparing with the window sticker. EPA label figures come from standardized laboratory tests. Your mileage differs with driving habits, maintenance, weather and road conditions.
  • Mixing US and UK gallons. A UK mpg figure uses the imperial gallon of 4.546 liters, about 20% larger than the US gallon, so it reads higher for the same car. Convert it before comparing.
  • Forgetting a tire size change. The odometer counts tire turns, so a different overall diameter skews the miles, and the mpg with them. The tire size calculator shows the difference between two sizes.

Last updated October 29, 2026 by Fernando Margareto, Founder & Editor.

My Garage

Build Sheet

Paper size