Calcist

Style

Buttons

Spacing

How much to show

Decimal places

Text size

Gas mileage calculator

Work out your real miles per gallon from a fill-up, convert it to L/100 km and km/L, and see what each mile costs.

Private: calculated on your device. Nothing you type is sent anywhere.

Next: Know your MPG? Price a trip with the fuel cost calculator.

How to measure your MPG

  1. Fill the tank all the way and note the odometer (or reset the trip meter).
  2. Drive normally until you need gas again.
  3. Fill up all the way again and note the gallons on the pump and the new odometer reading.
MPG = miles driven ÷ gallons used
L/100 km = 235.215 ÷ MPG · km/L = MPG × 0.425144
Cost per mile = price per gallon ÷ MPG

The conversion numbers come from the exact definitions: 1 US gallon = 3.785411784 liters and 1 mile = 1.609344 km. So 100 × 3.785411784 ÷ 1.609344 = 235.215.

Worked example

You drove 350 miles and it took 12.5 gallons to refill: 350 ÷ 12.5 = 28 MPG. That's 235.215 ÷ 28 = 8.40 L/100 km, or 11.90 km/L. With odometer readings of 12,000 and 12,345 and 11.5 gallons, you drove 345 miles at 345 ÷ 11.5 = 30 MPG, which costs $3.60 ÷ 30 = $0.12 a mile.

Limitations

  • One tank is a snapshot. Pumps shut off at slightly different levels, so average several fill-ups for a steadier number.
  • UK miles per gallon use the larger imperial gallon (4.54609 L), so the same car shows about 20% higher MPG in the UK. It's shown separately.
  • Hybrids and plug-in hybrids that also use electricity need energy counted too. This only counts the fuel you pumped.

Sources

How we checked this

Before every update, this calculator is run in a real browser with these known answers, and it must match all of them:

  • 350 miles on 12.5 gallons = 28 MPG ✓
  • 28 MPG = 8.40 L/100 km = 11.90 km/L ✓
  • Odometer 12,000 to 12,345 on 11.5 gallons at $3.60: 30 MPG, $0.12 a mile ✓
  • 500 km on 40 liters = 8.00 L/100 km ✓
  • Edge: an ending odometer below the start is rejected ✓

Last checked October 26, 2026. Spotted something wrong? The math is done in your browser with the formula shown on this page, so you can check any result by hand.

Add this calculator to your website (free)

Paste this code into any web page. The calculator works on your page, resizes itself, has no ads and no tracking, and nothing your visitors type is sent anywhere. More about embedding.

Questions people ask

How do I calculate gas mileage?

Divide the miles you drove by the gallons it took to refill the tank. 300 miles on 10 gallons is 30 MPG.

How do I convert MPG to L/100 km?

Divide 235.215 by the MPG. 30 MPG is 7.84 L/100 km. The same formula turns L/100 km back into MPG.

What is good gas mileage?

It depends on the vehicle type. Compare your result with the EPA rating for your model on fueleconomy.gov. Real-world mileage is often a little lower than the rating.

Why is my MPG lower than the sticker?

Short trips, idling, cold weather, aggressive driving, high speeds, low tire pressure and extra weight all reduce real-world mileage.

Related calculators