Gas Mileage Calculator
With miles driven 342 mi, gallons to refill 12.4 gal, price per gallon 3.45 usd, gas mileage comes to 27.6 mpg — miles per gallon. It is reached in 4 steps, the last of which is miles / gallons, and each one is printed on the page with its numbers filled in. The formula is the one published by US Department of Energy, not an approximation fitted to it.
Miles per gallon from a tank of fuel and the miles it covered, with the litres-per-100-km figure and the cost per mile it works out to.
By Alex Seote, Built and maintains Rule Calculator · Formula and sources checked · How we check
Miles driven 342 mi, Gallons to refill 12.4 gal, Price per gallon 3.45
27.6 mpg
Miles per gallon for the example below. Editing a field recomputes the calculator below; this figure holds the answer the page was loaded with.
It is written into the HTML rather than drawn by a script, so a search engine reading this page without running JavaScript still finds an answer.
- Miles per gallon
miles / gallons27.581 mpg- Litres per 100 km
235.214583 / mpg8.528- Cost per mile
price / mpg0.125- Cost per 100 miles
cost_per_mile * 10012.509
Worked example
342 miles on 12.4 gallons is 27.6 mpg, or 8.5 litres per 100 km, and 12.5 cents a mile at $3.45. One tank is a noisy sample: a headwind, a roof box or a week of short trips moves it by several mpg, so average three fills before believing a change.
How to work it out yourself
- 1.Fill the tank and reset the trip meter, or write down the odometer.
- 2.Drive normally until the next fill, then fill to the same point — the pump clicking off is repeatable, topping up by hand is not.
- 3.Divide the miles by the gallons it took. Litres per 100 km is 235.215 divided by the mpg figure, and it runs the other way: a lower number is better.
The formula
- Miles per gallon
miles / gallons - Litres per 100 km
235.214583 / mpg - Cost per mile
price / mpg - Cost per 100 miles
cost_per_mile * 100
Questions people actually ask
- Why does the trip computer disagree with this?
- Trip computers estimate fuel use from injector timing rather than measuring it, and most read optimistic by a few per cent. The brim-to-brim method measures the fuel that actually went in, which is why it is the one worth trusting when the two differ.
- Why is mpg not the reciprocal of litres per 100 km?
- Because they are inverses of each other rather than scalings: mpg is distance over fuel, l/100 km is fuel over distance. The conversion is 235.215 divided by the figure, in either direction. It also means equal mpg gains are not equal fuel savings — going from 15 to 20 mpg saves far more fuel than going from 40 to 45.
- How many tanks before the number means anything?
- Three or more. A single tank carries the weather, the traffic and how full the last fill really was; the spread between consecutive tanks on the same car is routinely 10%.
Related
- Fuel Cost CalculatorWhat a trip costs in fuel, from its distance, the mileage the vehicle really gets and the pump price — with the cost per mile to compare on.
- Speed & Pace CalculatorAverage speed and running pace from a distance and a time, in both imperial and metric.
- Hourly to Salary CalculatorAnnual, monthly and per-paycheck pay from an hourly rate — and the reverse, an hourly equivalent from a salary.
- Tip CalculatorTip and total from a bill, and what each person owes once it is split — including the rounding that makes the split come out even.
- Unit Price CalculatorPrice per unit for two package sizes at once, so the bigger box can be checked rather than assumed — it is the cheaper one about four times in five, not five.
- Sales Tax CalculatorTax and total from a pre-tax price, plus the reverse — the pre-tax price hidden inside a total you already paid.
Put this calculator on your site
Free, no attribution required beyond the link.
<iframe src="https://rulecalculators.com/embed/gas-mileage" width="100%" height="420" style="border:1px solid #e7e4de;border-radius:12px" title="Gas Mileage Calculator"></iframe>