Search tools

Find a tool by name or what it does.

Gas Mileage Calculator

Enter the distance you drove and the fuel you used, or two odometer readings, and get your fuel economy as MPG, L/100km, and km/L, plus the cost per mile or kilometre when you add a fuel price.

Units

Distance from

Odometer mode subtracts the start reading from the end reading to get the distance.

Currency

Everything is calculated in your browser. Nothing is uploaded.

Fuel economy
30.5MPGmiles per US gallon over 320 mi on 10.5 gal
Every unit
30.5
MPG (US)
36.6
MPG (imperial)
7.72
L/100km
12.96
km/L
Fuel cost
$36.75
Total fuel cost
$0.11
Cost per mile
$0.07
Cost per km

How to calculate gas mileage online

  1. Pick your units

    Choose US or metric units, then decide whether you are entering a total distance or two odometer readings.

  2. Enter distance and fuel

    Type the distance you drove, or the start and end odometer readings, then the fuel you used and, if you like, the price you paid.

  3. Read your fuel economy

    See MPG, L/100km, km/L, and the cost per mile or kilometre update as you type, then copy the summary for your log.

Why use this tool

MPG, L/100km, and km/L at once

One set of numbers gives you all three common measures of fuel economy side by side, so you never have to convert between them by hand.

Distance or odometer readings

Enter the miles or kilometres you drove directly, or switch to odometer mode and let it subtract the start reading from the end reading for you.

US and imperial gallons

Miles per gallon is shown in both US and imperial form, because a US gallon and an imperial gallon are different sizes and give a different figure.

Cost per mile and kilometre

Add the price you paid per gallon or litre and it works out the total fuel cost for the drive plus the cost per mile and per kilometre.

Runs entirely in your browser

Everything is calculated on your device as you type. The readings and prices you enter are never uploaded, stored, or logged.

About this tool

A gas mileage calculator turns a drive into a clear number: how far your car goes on each unit of fuel. Enter the distance you covered and the amount of fuel you used, and it works out your fuel economy as miles per gallon, litres per 100 km, and kilometres per litre at the same time. If you track trips by the dashboard, switch to odometer mode and type the reading at the start and the reading at the end, and the distance is filled in for you. Every figure updates the moment the numbers are valid, with no button to press.

Because the same drive can be described in more than one unit, the result always shows all of them. Miles per gallon appears in both US and imperial form, since a US gallon and an imperial gallon are different sizes, and the drive is also given as litres per 100 km and kilometres per litre so nothing is lost in translation. Add the price you paid per gallon or litre and it works out the total fuel cost for the drive along with the cost per mile and per kilometre, which is the honest way to compare a short commute against a long road trip.

It is useful for logging real-world economy against the sticker figure, checking whether a service or a new set of tyres changed your consumption, or splitting fuel on a shared journey. To estimate the fuel bill for a trip you have not taken yet, the fuel cost calculator starts from your economy and a distance, and to convert a raw distance or volume on its own the unit converter handles miles, kilometres, gallons, and litres directly. Every calculation runs in your browser, so the readings and prices you enter stay on your device.

Frequently asked questions

How do you calculate gas mileage?
Fuel economy is distance divided by fuel used. Miles per gallon is the miles driven divided by the gallons burned. Litres per 100 km is the litres used divided by the kilometres driven, multiplied by 100. Kilometres per litre is the kilometres driven divided by the litres used. This tool works out all of them from the same two numbers.
Can I use odometer readings instead of a distance?
Yes. Switch to odometer mode and enter the reading at the start of the tank and the reading when you refilled. The distance is the end reading minus the start reading. The ending reading has to be higher than the starting one, and if it is not the calculator says so instead of showing a wrong figure.
What is the difference between MPG and L/100km?
Miles per gallon measures distance per unit of fuel, so a higher number means a more efficient car. Litres per 100 km measures fuel per fixed distance, so a lower number means a more efficient car. They point in opposite directions, which is why the result shows both along with kilometres per litre.
Why does it show US and imperial MPG?
A US gallon is about 3.79 litres and an imperial gallon is about 4.55 litres, so the same drive gives a different miles-per-gallon figure depending on which gallon you mean. An imperial gallon is roughly 20% larger, so its MPG is about 20% higher for the same real economy. Showing both avoids confusion when a figure is quoted without saying which gallon it uses.
What if I enter zero fuel or a lower ending reading?
Fuel economy needs the fuel used to be greater than zero, so a blank or zero fuel entry shows a short message instead of an impossible result. In odometer mode, an ending reading that is the same as or lower than the start also shows a message, so you never get a divide-by-zero or a negative distance in the output.
Is my data uploaded anywhere?
No. Everything runs in your browser; nothing is sent to a server. The distances, odometer readings, fuel amounts, and prices you type are never uploaded, stored, or logged.

Related tools