Boneyard Tools

Gas Mileage Calculator

Measure real fuel economy from a single tank or trip. Enter how far you drove and how much fuel you used, and the tool reports miles per gallon, litres per 100 km and kilometres per litre at once. Add a fuel price and it also works out the total cost of the fuel and the cost per mile, so you can see exactly what that stretch of driving cost you.

How to calculate gas mileage

  1. Choose 'US (mi / gal)' or 'Metric (km / L)' with the toggle at the top.
  2. Enter the trip distance in the 'Distance' field, in miles or kilometres.
  3. Enter the 'Fuel used', in gallons or litres to match your unit choice.
  4. Optionally enter a 'Fuel price' per gallon or per litre to get trip cost.
  5. Read MPG, L/100km, km/L, total fuel cost and cost per mile, then click Copy.

Examples

US fuel economy

300 miles on 12 gallons
25.00 MPG, 9.41 L/100km, 10.63 km/L

Trip fuel cost

300 miles, 12 gallons at $3.50/gal
$42.00 total, $0.140 per mile

Metric entry

500 km on 40 litres
8.00 L/100km, 29.40 MPG, 12.50 km/L

Frequently asked questions

How is MPG calculated?

Divide the miles driven by the gallons of fuel used. Driving 300 miles on 12 gallons gives 300 / 12 = 25 miles per gallon. In metric mode the tool converts your kilometres and litres to miles and gallons first, then does the same division.

How do I convert MPG to L/100km?

They are inverse measures, so a higher MPG means a lower L/100km. This tool converts your figures to litres and kilometres, divides litres by kilometres and multiplies by 100. At 300 miles on 12 gallons that works out to 9.41 L/100km.

Can I use metric units?

Yes. Flip the toggle to Metric and enter kilometres and litres instead of miles and gallons. The tool still reports MPG, L/100km and km/L, using 1 mile = 1.609344 km and 1 US gallon = 3.785411784 litres.

Is the gallon a US or an imperial gallon?

US gallons. The conversion uses 1 US gallon = 3.785411784 litres. An imperial gallon is larger at about 4.546 litres, so if you filled up with imperial gallons your MPG figure here will read low.

How is fuel cost per mile worked out?

Total fuel cost equals the fuel used times the price you enter. Cost per mile is that total divided by the miles driven, so a $42 fill over 300 miles is $0.140 per mile. In metric mode the price is treated as a per-litre price.

Is the fuel price required?

No. Distance and fuel are the only required fields. Leave the price blank and you still get MPG, L/100km and km/L; the total cost and cost per mile stay empty until you add a valid price.

How are the results rounded?

MPG, L/100km, km/L and total cost are shown to two decimal places, while cost per mile is shown to three so small trips read clearly. The engine itself keeps full precision, so rounding only affects the display.

Why is my real-world MPG lower than the sticker?

City driving, cold starts, idling, cargo, terrain and speed all lower economy. Measuring your own fill-ups, as this tool does, gives a truer figure than the rated number, especially if you track several tanks.

Is my data private?

Yes. The calculation runs in your browser and nothing is sent to a server, so your distances, fuel and prices never leave your device.

Learn more

Related tools