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
- Enter miles driven (above 0).
- Enter gallons used (above 0).
- Press Calculate to see the result, and use Reset to start again.
| Input | What to enter | Allowed values |
|---|---|---|
| Miles driven | A number | > 0 |
| Gallons used | A 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.
| Result | Value |
|---|---|
| Fuel economy | 28 mpg |
| L/100 km | 8.4005 |
Example 2
Inputs: Miles driven = 100; Gallons used = 4.
| Result | Value |
|---|---|
| Fuel economy | 25 mpg |
| L/100 km | 9.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.
| Miles driven | Fuel economy | L/100 km |
|---|---|---|
| 175 | 14 mpg | 16.801 |
| 350 | 28 mpg | 8.4005 |
| 700 | 56 mpg | 4.2003 |
| 1400 | 112 mpg | 2.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.
| Calculator | You enter | It returns |
|---|---|---|
| [Fuel Cost Calculator](/automotive/fuel-cost-calculator/) | distance, fuel economy and fuel price | Trip cost |
| [Fuel Savings Calculator](/automotive/fuel-savings-calculator/) | miles driven per year, current fuel economy and new fuel economy | Annual savings |
| [Distance per Tank Calculator](/automotive/distance-per-tank-calculator/) | tank size and fuel economy | Range |
| [Tire Size Calculator](/automotive/tire-size-calculator/) | section width, aspect ratio and rim diameter | Overall diameter |
| [Engine Displacement Calculator](/automotive/engine-displacement-calculator/) | bore, stroke and cylinders | Displacement |
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.
Related calculators
- 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.
- Tire Size Calculator — Overall diameter, sidewall height and revolutions per mile from a tire size such as 225/45R17.
- Engine Displacement Calculator — Displacement from bore, stroke and number of cylinders.
- Car Depreciation Calculator — Estimated value after years of declining-balance depreciation at a rate you enter.
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.