Gas Mileage Calculator

The Gas Mileage Calculator computes gas mileage from the relation mpg = miles driven / gallons used. It takes 2 inputs (miles driven in miles, gallons of fuel used in gallons) and returns the gas mileage. Because this is a pure mathematical or physical formula rather than a jurisdiction-specific rule, the result never changes over time: the same inputs always produce the same answer, so you can rely on it whether you are checking homework, sizing a design, or sanity-checking another tool. Enter your values in the fields below and the result updates instantly; you can also share a permalink that pre-fills the exact calculation, which is useful for teaching, reports, or collaboration. For example, with miles driven = 450 miles, gallons of fuel used = 15 gallons, the gas mileage works out to 30, and the worked example further down the page shows every step so you can follow the arithmetic and reproduce it by hand. The method is the standard form documented by US DOE fueleconomy.gov, and the figure above each result carries the date it was last verified. This tool is general information and is not a substitute for professional engineering, medical, financial, or scientific advice; always check critical results against the primary source and your own judgement.

With Miles driven = 450 miles, Gallons of fuel used = 15 gallons, the result is 30.

Formula: mpg = miles driven / gallons used. Source: US DOE fueleconomy.gov, as at 2026-06-23.

Gas Mileage30

Applies to: any numeric inputs. Method source: US DOE fueleconomy.gov, checked 2026-06-23.

The formula

mpg = miles driven / gallons used

Worked example

With Miles driven = 450 miles, Gallons of fuel used = 15 gallons:

  1. mpg = miles / gallons
  2. mpg = 450 / 15 = 30.00
  3. Gas Mileage = 30

This worked example is one of the automated golden-value tests this calculator must pass before it can publish.

What this assumes

  • Inputs are real numbers in the units shown.
  • The result is the exact value of mpg = miles driven / gallons used; general information, not professional advice.

Frequently asked questions

What formula does this use?

mpg = miles driven / gallons used, the standard form documented by US DOE fueleconomy.gov.

Does the result ever change over time?

No. This is a pure formula with no external rate, so the same inputs always give the same result.

Official sources and verification

Reviewed by the CalculatorHub team, edited by James Graham, 2026-06-23. See our methodology. General information, not professional advice.