Skip to content

How-to guide

How to Calculate Miles Per Gallon: Formula, Steps & Examples

Learn how to calculate Miles Per Gallon — the formula explained step by step, with worked examples and a free calculator to check your answer.

By Arjun Desai, B.Tech (Engineering) · Updated Jun 2026 · 2 min read

Calculating your miles per gallon is straightforward once you know the Miles Per Gallon formula and what each input means. This guide explains the method in plain language, walks through a manual calculation, and gives worked examples you can follow — then you can do it instantly with the Miles Per Gallon Calculator.

What is Miles Per Gallon?

The Miles Per Gallon calculation tells you your miles per gallon from a few simple inputs. The figure you are solving for here is the miles per gallon.

The Miles Per Gallon formula

The core formula is:

Miles per gallon = Distance driven ÷ Fuel used

Here is what each input means:

  • Distance driven — a value measured in miles. Example: 300 miles.
  • Fuel used — a value measured in gallons. Example: 12 gallons.

How to calculate it step by step

  • Write down the distance driven (for example, 300 miles).
  • Write down the fuel used (for example, 12 gallons).
  • Apply the formula above to get your miles per gallon.
  • Double-check the result with the Miles Per Gallon Calculator.

Worked examples

Example 1

Input / OutputValue
Distance driven300 miles
Fuel used12 gallons
Miles per gallon25.00

With distance driven of 300 miles and fuel used of 12 gallons, the miles per gallon works out to 25.00.

Example 2

With distance driven of 600 miles and fuel used of 12 gallons, the miles per gallon works out to 50.00.

ResultValue
Miles per gallon50.00

Example 3

With distance driven of 150 miles and fuel used of 12 gallons, the miles per gallon works out to 12.50.

ResultValue
Miles per gallon12.50

Tips for an accurate result

  • Keep your units consistent — mixing, say, months with years or grams with kilograms is the most common source of error.
  • Round only at the very end. Rounding inputs early can shift the final answer noticeably.
  • Re-run the numbers whenever an input changes, rather than estimating from an old result.

Prefer not to do the maths by hand? — the Miles Per Gallon Calculator does it instantly, for free, with the formula and a worked example built in.

Continue exploring automotive calculators with these tools: Engine Displacement Calculator, Compression Ratio Calculator, Horsepower to Torque Calculator, Gear Ratio Calculator, Tire Size Calculator.

Calculators in this guide

Frequently asked questions

The formula is: Miles per gallon = Distance driven ÷ Fuel used. With distance driven of 300 miles and fuel used of 12 gallons, the miles per gallon works out to 25.00.

Gather each input, apply the formula step by step keeping your units consistent, and round only at the end. You can verify your answer instantly with the Miles Per Gallon Calculator.

It uses the standard formula with exact arithmetic, so the result is correct for the inputs you enter. Bear in mind that real-world outcomes can still differ when underlying assumptions change.

Arjun Desai · B.Tech (Engineering)

Arjun Desai is an engineer who writes about the practical physics, electronics and energy calculations behind everyday technology.