Gas Mileage Calculator

About this calculator

This gas mileage calculator works out your real-world fuel economy from your last two fill-ups. Enter the current and previous odometer readings, the fuel you just added and, optionally, the price you paid.

You get mileage in miles per gallon, liters per 100 km and kilometers per liter, plus the distance driven, the fill-up cost and the cost per mile or kilometer.

miles
miles
gallons
$ per gallon
km
km
liters
$ per liter
Embed this calculator

Paste this code into a Custom HTML block on your site. The calculator fits the width of the block. Adjust the height in the code if you want more room for results.

Find this widget in the publisher directory

How to calculate gas mileage

Gas mileage, also called fuel economy, is the distance a vehicle covers per unit of fuel. The most reliable way to measure it is the full-tank method: fill the tank, note the odometer, drive normally, then fill the tank again. The fuel needed to refill the tank is the amount you burned over that distance.

Distance = current odometer − previous odometer
Gas mileage = distance ÷ fuel added

Worked example

Your odometer read 12,300 miles at the last fill-up and reads 12,600 now. You add 10 gallons. You drove 300 miles, so your mileage is 300 ÷ 10 = 30 mpg. At $3.50 a gallon that fill-up cost $35.00, or about $0.117 per mile.

Unit conversions

FromToFormula
mpg (US)L/100 km235.215 ÷ mpg
mpg (US)km/Lmpg × 0.425144
L/100 kmkm/L100 ÷ L/100 km

For example, 600 kilometers on 50 liters is 12 km/L, which equals 8.33 L/100 km or about 28.2 mpg.

Tips for accurate readings

  • Fill up at the same pump and stop at the first automatic click-off each time.
  • Use the same driving mix for the whole interval, or track highway and city separately.
  • Measure over several tanks and average. A single tank can vary with weather and traffic.
  • Do not use the figure on the pump display of a partial fill. The calculation assumes the tank is full both times.

How to improve gas mileage

Keep tires inflated to the placard pressure, remove unneeded weight and roof racks, accelerate gently, anticipate stops so you can coast, and keep highway speeds moderate. Fix check-engine lights promptly, since a faulty oxygen sensor can quietly cost several miles per gallon. Combine short trips so the engine stays warm, and use the oil grade your manufacturer specifies.

Cost per distance

If you enter the fuel price, the calculator divides the fill-up expense by the distance driven. That cost per mile (or kilometer) is useful for comparing vehicles, budgeting commutes or splitting fuel with passengers. Multiply it by your annual mileage to see your yearly fuel budget: at $0.117 per mile and 12,000 miles that is about $1,400.

Limits

Odometers can be a few percent off, especially with non-stock tires, and pumps have small measurement tolerances. For a precise figure, average at least three consecutive tanks.

Tracking mileage over time

Record each fill-up in a notebook or spreadsheet with date, odometer, gallons and price. After five or six entries you will see a stable average and any sudden drop. A fall of more than 10% that lasts for several tanks is worth investigating: common causes are low tire pressure, a dragging brake, a dirty air filter, worn spark plugs or a failing sensor.

Highway versus city

Most gasoline cars do better on the highway, where the engine runs at a steady load, while hybrids often do better in town because they recover braking energy. If you drive both, measure a tank of mostly each to see your own split rather than relying on the label numbers.

Example with metric units

You drive 600 km between fill-ups and add 50 liters at $1.00 per liter. Mileage is 600 ÷ 50 = 12 km/L, which equals 100 ÷ 12 = 8.33 L/100 km or 28.23 mpg. The fill-up costs $50, so each kilometer costs $0.0833, or 12 kilometers for every dollar spent.

Why partial fills mislead

The formula only works when both fill-ups bring the tank to the same level. If you top off sloppily one time and stop at the first click the next, the fuel measured will be off by a gallon or more, which on a short interval can shift the result by several mpg. Use the same station and pump, level ground and the same stopping rule each time, and prefer longer intervals of at least 200 miles.

Another cross-check is the trip computer in your car. Compare it with the calculated figure over three tanks; if it reads consistently higher by a few percent, you can apply that correction in the future.

Frequently asked questions

How do I calculate miles per gallon?

Subtract the previous odometer reading from the current one and divide by the gallons added at the latest fill-up. 300 miles on 10 gallons is 30 mpg.

What is a good gas mileage?

For gasoline cars, 25 to 35 mpg is typical; hybrids often reach 45 to 55 mpg. Large trucks and SUVs commonly return 15 to 22 mpg.

How do I convert mpg to L/100 km?

Divide 235.215 by the mpg figure. 30 mpg is 7.84 L/100 km.

Why is my mileage lower in winter?

Cold engines run richer, tires lose pressure, winter-blend fuel has slightly less energy, and heaters and defrosters add load.

Formulas and sample results on this page were checked against independent references. Page last reviewed or updated . How we verify calculators. Project led by Shaun Connell.