Energy & Utilities · Formula v1.0

MPG Calculator

Calculate miles per gallon, fuel cost per mile and liters per 100 km from a fill-up.

LAST REVIEWEDSeptember 24, 2026Inputs stay in your browser
Live calculation

Enter your numbers

Calculated result
Miles per gallon28
Fuel cost per mile$0.13
Liters per 100 km8.4
Sensitivity check

What if fuel price per gallon changes?

-10% input28
0% input28
+10% input28

Answer first

What this calculator tells you

Calculate miles per gallon, fuel cost per mile and liters per 100 km from a fill-up. Track real mileage against the sticker figure by measuring one full tank to the next. Formula: MPG = miles driven ÷ gallons used; cost per mile = gallons × price ÷ miles; L/100 km = 235.215 ÷ MPG. At the worked-example inputs, the miles per gallon is 28. Holding every other input steady, moving miles driven from 280 to 420 moves the result from 22.4 to 33.6.

FreeNo sign-upInputs stay in-browserCSV exportReviewed September 24, 2026

Transparent method

The formula

MPG = miles driven ÷ gallons used; cost per mile = gallons × price ÷ miles; L/100 km = 235.215 ÷ MPGEnter fuel price per gallon in dollars.

Track real mileage against the sticker figure by measuring one full tank to the next.

Worked example

Miles per gallon28
Fuel cost per mile$0.13
Liters per 100 km8.4

Example inputs

Miles driven350
Gallons of fuel used12.5
Fuel price per gallon$3.50

How to interpret the result

Real mileage comes from one full tank to the next, not from a single reading on the dash. Divide the miles driven by the gallons it took to refill, and 350 miles on 12.5 gallons is exactly 28 miles per gallon. Cost per mile converts that into money, and the liters per 100 kilometers figure lets you compare with the metric numbers on foreign specs.

At the worked-example inputs the miles per gallon is 28. It rises with miles driven and falls as gallons of fuel used increases; fuel price per gallon does not move it.

Interpretation boundary

Real energy use depends on how the appliance or vehicle is actually run: duty cycle, weather, driving style, battery age and your utility's rate structure, including tiers and time-of-use pricing. Treat the result as a planning estimate and check it against your own bill or trip log.

Before you rely on it

What to check

Fill to the same click of the pump each time. Uneven fill-ups swing a single tank's result by several miles per gallon.

The common error

Where people go wrong with MPG calculator

Trusting one tank. Weather, traffic and a trip mix all move mileage, so average three or four fill-ups before comparing with the sticker.

Sensitivity evidence

How miles driven changes the miles per gallon

Holding every other input at the worked-example value, moving miles driven from 280 to 420 moves the miles per gallon from 22.4 to 33.6: a spread of 11.2, or 40% of the worked-example result.

MPG Calculator: miles per gallon and fuel cost per mile and liters per 100 km across a range of miles driven, every other input held at the worked-example value.
Miles drivenMiles per gallonFuel cost per mileLiters per 100 km
28022.4$0.1610.5
31525.2$0.149.3
350worked example28$0.138.4
38530.8$0.117.6
42033.6$0.107

Every input, tested

Which input moves the miles per gallon most

Of the 3 inputs, gallons of fuel used moves the miles per gallon most (6.8 across the range tested) and miles driven moves it least (5.6). Fuel price per gallon does not change it at all.

MPG Calculator: miles per gallon with each input moved on its own, every other input held at the worked-example value.
InputTested fromToMiles per gallon at each endSwing
Gallons of fuel used111431.8 to 256.8 (24%)
Miles driven31538525.2 to 30.85.6 (20%)
Fuel price per gallon$3.15$3.8528 to 28none

Two variables at once

Miles per gallon by miles driven and gallons of fuel used

Across the grid the miles per gallon runs from 18.7 to 42. Moving miles driven from 280 to 420 shifts it by 10.8 at the middle column, and moving gallons of fuel used from 10 to 15 shifts it by 11.7 at the middle row, so gallons of fuel used is the bigger lever here.

MPG Calculator: miles per gallon at each combination of miles driven (rows) and gallons of fuel used (columns).
Miles driven \ Gallons of fuel used101315
2802821.518.7
31531.524.221
3503526.923.3
38538.529.625.7
4204232.328

The highlighted cell is the worked example.

Step by step

The worked example, input by input

Worked-example inputs and the results they produce for the MPG calculator.
InputValue usedWhat it means
Miles driven350Enter the miles driven used in this calculation.
Gallons of fuel used12.5Gallons added at the fill-up that follows the miles driven.
Fuel price per gallon$3.50Enter the fuel price per gallon used in this calculation.
Miles per gallon28
Fuel cost per mile$0.13
Liters per 100 km8.4

Inputs, definitions and assumptions

Miles driven

Enter the miles driven used in this calculation. The prefilled worked-example value is 350.

Gallons of fuel used

Gallons added at the fill-up that follows the miles driven. The prefilled worked-example value is 12.5.

Fuel price per gallon

Enter the fuel price per gallon used in this calculation. The prefilled worked-example value is $3.50.

How to use this calculator

  1. 1Verify the inputs. Gather miles driven, gallons of fuel used and fuel price per gallon from your own documents; the prefilled values are examples.
  2. 2Save a baseline. The worked example puts the miles per gallon at 28. Store your own version of it as Scenario A.
  3. 3Test one change. Start with gallons of fuel used, the input with the biggest effect here: moving gallons of fuel used from 11 to 14 takes the miles per gallon from 31.8 to 25, a swing of 24% of the worked-example figure.
  4. 4Check the extremes. At half the example gallons of fuel used (6.3) the miles per gallon is 56; at double (25) it is 14.

People also ask

Frequently asked questions

How do you calculate MPG?

MPG = miles driven ÷ gallons used; cost per mile = gallons × price ÷ miles; L/100 km = 235.215 ÷ MPG. Enter fuel price per gallon in dollars. At the worked-example inputs the miles per gallon is 28.

What does the MPG result mean?

Track real mileage against the sticker figure by measuring one full tank to the next. At the worked-example inputs the miles per gallon is 28. It rises with miles driven and falls as gallons of fuel used increases; fuel price per gallon does not move it.

How much does miles driven change the miles per gallon?

Holding every other input at the worked-example value, moving miles driven from 280 to 420 moves the miles per gallon from 22.4 to 33.6, a spread of 11.2.

What are the limits of this MPG calculator?

Real energy use depends on how the appliance or vehicle is actually run: duty cycle, weather, driving style, battery age and your utility's rate structure, including tiers and time-of-use pricing. Treat the result as a planning estimate and check it against your own bill or trip log. The tables on this page test miles driven only from 280 to 420; a value outside that range is not tabulated here.

Which input moves the miles per gallon most in the MPG calculator?

Ranked by how far each moves the miles per gallon across the range tested: gallons of fuel used (6.8, 24%) and miles driven (5.6, 20%). Fuel price per gallon does not change it.

If I double gallons of fuel used in the MPG calculator, does the miles per gallon double?

Doubling it from 12.5 to 25 takes the miles per gallon from 28 to 14, which is 0.50 times the worked-example figure. So it falls instead of rising. Halving it to 6.3 gives 56.

How much does gallons of fuel used matter in the MPG calculator?

The worked example uses 12.5. With the other inputs left at the worked example, moving gallons of fuel used from 11 to 14 takes the miles per gallon from 31.8 to 25, a swing of 24% of the worked-example figure.

How much does fuel price per gallon matter in the MPG calculator?

The worked example uses $3.50. The miles per gallon does not depend on fuel price per gallon; it moves the fuel cost per mile from $0.11 to $0.14 instead when fuel price per gallon goes from $3.15 to $3.85.

Which inputs change the fuel cost per mile in the MPG calculator?

At the worked-example inputs it is $0.13. Miles driven takes it from $0.14 to $0.11, gallons of fuel used takes it from $0.11 to $0.14 and fuel price per gallon takes it from $0.11 to $0.14.

Which inputs change the liters per 100 km in the MPG calculator?

At the worked-example inputs it is 8.4. Miles driven takes it from 9.3 to 7.6 and gallons of fuel used takes it from 7.4 to 9.4.

Is my electric rate the same for every kilowatt-hour?

Not always. Many utilities charge tiered or time-of-use rates and add delivery fees and taxes. For an all-in rate, divide your whole bill by the kilowatt-hours you used.

How long will a battery really last?

Runtime falls as the load rises and as the battery ages, cools or drains deeply. The calculator shows the best case at your chosen usable depth, so plan on somewhat less.

What is a peak sun hour?

One hour of sunlight at 1,000 watts per square meter, the standard test strength. A day with five peak sun hours delivers the same energy as five hours at that strength, even if daylight lasts much longer.

All energy & utilities questions answered

Sources and evidence

Free Calculators Online is independent and is not affiliated with or endorsed by the source organizations. Educational estimates only.