Skip to content
CalculatorAtlas

MPG Calculator

Tested

Miles per gallon.

Tested, not yet published. The formula for this calculator is implemented and passes its automated checks. This page stays non-indexable until it is reviewed and published.

Results

Enter your values and press Calculate. Results appear here.

  • • Result

Quick answer

Fuel economy (mpg) = miles driven ÷ gallons used. 350 miles on 12.5 gallons is 28 mpg, or 8.4 litres per 100 km.

Enter miles driven and gallons used. The calculator returns mpg and litres per 100 km.

Related tools: Fuel Cost Calculator: Trip fuel cost from distance, fuel economy and price. Fuel Savings Calculator: Yearly fuel savings from a more efficient vehicle. Distance per Tank Calculator: Range on a full tank from tank size and fuel economy.

How to use the MPG Calculator

  1. Enter miles driven (above 0).
  2. Enter gallons used (above 0).
  3. Press Calculate to see the result, and use Reset to start again.
Inputs of the MPG Calculator
InputWhat to enterAllowed values
Miles drivenA number> 0
Gallons usedA number> 0

Formula and method

Formula

mpg = miles ÷ gallons

IEEE-754 double precision; shown to at most 6 decimal places.

US gallons.

Worked examples

These examples are verified: each one is an automated test case that the live calculator must reproduce exactly.

Example 1

Inputs: Miles driven = 350; Gallons used = 12.5.

Results of example 1
ResultValue
Fuel economy28 mpg
L/100 km8.4005

Example 2

Inputs: Miles driven = 100; Gallons used = 4.

Results of example 2
ResultValue
Fuel economy25 mpg
L/100 km9.4086

The first line is the headline result (fuel economy). Below it the mPG Calculator lists l/100 km, which describe the same case from other angles. IEEE-754 double precision; shown to at most 6 decimal places.

Measuring accurately

Fill the tank, note the odometer, drive, then refill the same way and record the gallons added. Using the pump's gallons rather than the dashboard figure avoids onboard-computer error. Averaging several tanks smooths out variation from stop-and-go driving.

Converting between systems

Litres per 100 km = 235.215 ÷ mpg (US), so 28 mpg is 8.40 L/100 km. A lower L/100 km is better, while a higher mpg is better.

How the result changes with miles driven

Holding every other input at the first worked example, this table changes only miles driven. It shows how sensitive the answer is to that one value; each row was produced by running this calculator.

How the result changes with miles driven
Miles drivenFuel economyL/100 km
17514 mpg16.801
35028 mpg8.4005
70056 mpg4.2003
1400112 mpg2.1001

What happens with invalid input

These messages are produced by the calculator itself, so you know what to fix.

  • Gallons used: entering "0" shows "Gallons used must be greater than 0." beside that field and no result.

Choosing between the MPG Calculator and similar calculators

Each row shows what a related calculator on this site asks for and what it returns, so you can pick the one that matches your question.

Choosing between the MPG Calculator and similar calculators
CalculatorYou enterIt returns
[Fuel Cost Calculator](/automotive/fuel-cost-calculator/)distance, fuel economy and fuel priceTrip cost
[Fuel Savings Calculator](/automotive/fuel-savings-calculator/)miles driven per year, current fuel economy and new fuel economyAnnual savings
[Distance per Tank Calculator](/automotive/distance-per-tank-calculator/)tank size and fuel economyRange
[Tire Size Calculator](/automotive/tire-size-calculator/)section width, aspect ratio and rim diameterOverall diameter
[Engine Displacement Calculator](/automotive/engine-displacement-calculator/)bore, stroke and cylindersDisplacement

Background: vehicle sizing and speed

A taller tyre travels farther per revolution, so the speedometer reads low and the effective gear ratio becomes numerically lower; a shorter tyre does the opposite. True speed is roughly the speedometer reading times the new tyre diameter divided by the old one. Verify with GPS over a known distance before changing parts.

Assumptions and limitations

  • Fill-to-fill measurement is most accurate

If a required value is empty, not a number, or outside its allowed range, the form marks that field with a message and shows no result instead of a misleading number. The automated checks deliberately try invalid entries for gallons used to confirm this.

Frequently asked questions

What is a good mpg?

Around 25 to 30 mpg is common for modern petrol cars; hybrids exceed 40.

Why is my mpg different from the sticker?

Driving style, speed, load and weather all matter.

Is UK mpg the same?

No, an imperial gallon is larger, so UK mpg figures are about 20% higher.

What does the MPG Calculator calculate?

Miles per gallon from distance and fuel used. It returns Fuel economy and L/100 km.

What formula does the MPG Calculator use?

mpg = miles ÷ gallons. US gallons.

What do I need to enter in the mPG Calculator?

You enter Miles driven and Gallons used.

How is the result rounded or limited?

IEEE-754 double precision; shown to at most 6 decimal places. Fill-to-fill measurement is most accurate.

What is an example of a mPG result?

With miles driven 350 and gallons used 12.5, the fuel economy is 28 mpg.

Sources

  • OpenStax, University Physics Volume 1 (Rice University): mechanics

Content last reviewed 2026-11-04. Formulas and worked examples are checked by automated tests against independently computed values.