Gas Mileage (MPG) & Trip Fuel Cost Calculator
Work out your real fuel economy from a fill-up, or plan the fuel cost of a trip. See gallons and litres used, cost per mile, the split between passengers, the CO₂ produced, and what the same trip would cost in an electric vehicle.
Written by Suhaib Hassan. Emission factors come from the US EPA. Our methodology.
It divides distance by fuel economy for gallons, multiplies by price, then converts to litres, CO₂ and an EV equivalent.
Your real MPG differs from the sticker. This measures it from your own fill-ups and prices trips from it.
Fuel economy by vehicle class
Typical fuel economy for each class, priced at your fuel price above. These are class averages for illustration, not specific model ratings. Check fueleconomy.gov for your vehicle.
| Vehicle class | City MPG | Highway MPG | Combined MPG | Cost / 1,000 mi | Cost / 15,000 mi |
|---|
MPG, L/100 km and km/L
US MPG converts to metric fuel economy with L/100 km = 235.215 ÷ MPG. Lower L/100 km is better, while higher MPG and km/L are better.
| MPG (US) | L/100 km | km/L | Gallons per 100 miles |
|---|
How the numbers are calculated
Fuel used and cost
gallons = miles ÷ MPG
cost = gallons × priceMeasured MPG
MPG = (odometer₂ − odometer₁) ÷ gallonsEmissions and EV
CO₂ = gallons × 8.887 kg
EV cost = miles ÷ (mi/kWh) × priceOne US gallon is 3.785412 litres and one mile is 1.609344 km. Burning a gallon of gasoline emits about 8.887 kg of CO₂ (US EPA).
Why yours may differ
Speed, acceleration, tire pressure, cold weather, cargo, air conditioning and short trips all lower fuel economy. Highway cruising at moderate speed is usually the most efficient.
Tracking several fill-ups gives a better average than a single one.
Worked examples
Illustrative trips, each checked by hand. The first is the default setup.
340-mile trip
28.5 MPG, gas at $3.55 a gallon.
11.93 × 3.55 = $42.35
CO₂ = 11.93 × 8.887 = 106.0 kg
EV: 340 ÷ 3.5 = 97.1 kWh × 0.16 = $15.54
MPG from a fill-up
Odometer 48,250 to 48,590, and 11.93 gallons added.
235.215 ÷ 28.5 = 8.25 L/100 km
cost per mile = 3.55 ÷ 28.5 = $0.125
Splitting a road trip
340 miles each way, four people.
680 ÷ 28.5 × 3.55 = $84.70
÷ 4 = $21.18 each
How to calculate gas mileage
- Fill the tank and note the odometer, or reset the trip meter.
- Drive as normal, then fill up again and record the gallons added.
- Divide the miles driven by the gallons added to get miles per gallon.
- Repeat a few times and average the results for a reliable figure.
To budget a trip, divide its distance by your MPG for gallons, then multiply by the price of gas along the route.
By Suhaib Hassan · Reviewed 29 September 2026 · How CalculatePilot verifies formulas →
Sources
- U.S. EPA, Greenhouse Gas Emissions from a Typical Passenger Vehicle (8,887 grams of CO₂ per gallon of gasoline).
- U.S. Department of Energy and EPA, fueleconomy.gov.
- NIST Special Publication 811, for gallon, litre, mile and kilometre conversion factors.
Frequently asked questions
How do I calculate miles per gallon?
Divide the miles you drove by the gallons of fuel you used. If you drove 340 miles and added 11.93 gallons at the next full fill-up, your fuel economy is 340 ÷ 11.93 = 28.5 MPG.
How do I convert MPG to L/100 km?
Divide 235.215 by the US MPG figure. For example, 28.5 MPG is 8.25 L/100 km. The same formula converts back: MPG = 235.215 ÷ L/100 km. UK gallons are larger, so UK MPG uses 282.481.
How is the carbon emission worked out?
The EPA gives 8,887 grams (8.887 kg) of CO₂ for each gallon of gasoline burned. Multiply gallons used by that factor for the tailpipe CO₂ of the trip. It does not include emissions from producing the fuel.
How does the EV comparison work?
Enter miles per kWh (many EVs manage 3 to 4) and your electricity price. Trip miles divided by miles per kWh gives kWh used, and multiplying by the price gives the charging cost. Public fast chargers cost more than home charging.
Why is my MPG lower in winter?
Cold engines run richer, cold air is denser, tires lose pressure, and winter fuel blends and heating use energy. Short trips make it worse because the engine spends more time warming up.
Related calculators
More everyday tools.