How to calculate MPG (gas mileage)

To calculate MPG, divide the miles you drove by the gallons it took to fill the tank back up. Fill the tank, note the odometer, drive, fill up again: 312 miles ÷ 10.4 gallons = 30.0 miles per gallon.

Published November 13, 2026 · Sources · Share

On this page (10 sections)

The formula

MPG = miles driven ÷ gallons used

The math is simple; the work is in getting the two numbers right. Miles come from the odometer. Gallons come from the pump, but they show what the car used only if the tank was full at the start and full again at the end. This is the “fill-up method” that fueleconomy.gov, the U.S. government’s fuel economy site, tells drivers to use.

If you would rather skip the math, the MPG calculator does it, including averages over several tanks.

Step by step: the fill-up method

  1. Fill the tank all the way. Let the pump click off on its own. Don’t top off to reach a round dollar amount; the extra gas makes the next reading less accurate.
  2. Write down the odometer reading. Example: 45,210 miles.
  3. Drive normally. Use most of the tank, at least half, so small errors at the pump matter less.
  4. Fill the tank all the way again. Write down the gallons the pump shows (10.4) and the new odometer reading (45,522).
  5. Subtract to get miles driven. 45,522 − 45,210 = 312 miles.
  6. Divide miles by gallons. 312 ÷ 10.4 = 30.0 MPG.

The gas you pumped at the second fill-up is the gas the car burned since the first one. That is why both fill-ups must be full.

Using the trip odometer

The trip odometer saves the subtraction. fueleconomy.gov describes it this way:

  1. Fill the tank and reset the trip odometer to zero.
  2. At the next fill-up, fill the tank, write down the gallons and the trip miles, and reset the trip odometer again.
  3. Divide the trip miles by the gallons.

Many cars have two trip meters (A and B). Keep one only for fill-ups so you don’t reset it by mistake.

Worked examples

MPG from one tank
DrivingMilesGallonsMPG
Commuting in a compact car31210.430.0
Highway trip in an SUV41815.227.5
City driving in a pickup26516.815.8
Mixed driving in a hybrid54010.650.9

Example numbers to show the math, not ratings for any model.

Average MPG over several tanks

One tank can be off. A pump that clicks off early, a cold week, or a long idle in traffic all move the result. For a number you can rely on, track 3 or more tanks and divide the total miles by the total gallons.

Don’t average the MPG figures themselves. Two tanks of 300 miles on 10 gallons (30.0 MPG) and 150 miles on 6 gallons (25.0 MPG) average to 450 ÷ 16 = 28.1 MPG, not 27.5. The longer tank should count for more, and the totals method does that.

Partial fill-ups are fine in a longer record. Start and end with a full tank, add up every gallon you put in between, and divide the total miles by the total gallons. What you can’t do is figure MPG from a single partial fill.

Gallons per mile and L/100 km

Two other ways to state the same thing:

  • Gallons per mile = 1 ÷ MPG. At 30 MPG, 1 ÷ 30 = 0.033 gallons per mile, or 3.3 gallons per 100 miles. This form makes trip math easy: miles × gallons per mile = gallons needed. The gas trip calculator uses it to price a drive.
  • L/100 km = 235.215 ÷ MPG. 30 MPG is 7.8 liters per 100 kilometers. Lower is better in this unit.

Gallons per mile shows something MPG hides. Going from 15 to 20 MPG saves 1.67 gallons every 100 miles. Going from 40 to 50 MPG saves only 0.5 gallons. The biggest savings come from improving the least efficient car.

To turn MPG into money, divide the price of a gallon by your MPG. That is your fuel cost per mile.

Why your number moves from tank to tank

Your MPG is not a fixed number. fueleconomy.gov lists what changes it:

  • Driving style. Aggressive driving can lower gas mileage by roughly 15%–30% at highway speeds and 10%–40% in stop-and-go traffic.
  • Cold weather. City MPG in a gas car can be about 15% lower at 20 °F than at 77 °F, and up to 24% lower on short trips of 3–4 miles.
  • Air conditioning. The AC on max can cut MPG by roughly 5%–25%.
  • Fuel. Gas with 10% ethanol has slightly less energy: about 3%–4% lower fuel economy than gas with no ethanol.
  • Tire pressure. About 0.2% lower MPG for every 1 psi drop in average pressure.
  • Weight. An extra 100 pounds can cut MPG by about 1%.
  • A new engine. It may take 3,000–5,000 miles to reach its best fuel economy.

So a winter tank and a summer road trip tank can differ a lot, and both are correct. A sudden drop that you can’t explain is a reason to check tire pressure and look at the basics on our car maintenance checklist.

Mistakes that skew MPG

  • Not filling to full. If the first or last fill-up is partial, the gallons don’t match the miles.
  • Topping off after the click. It makes the fill level differ from one stop to the next.
  • Forgetting a fill-up. One missed entry makes the next tank’s MPG look far too high.
  • Using different pumps. Nozzles can click off at slightly different fill levels. Using the same station when you can helps.
  • Judging by one tank. Use the total of several tanks.

FAQ

What is the formula for miles per gallon?

Miles per gallon = miles driven ÷ gallons used. Take the miles from the odometer between two full tanks, and the gallons from the second fill-up.

How do you calculate MPG without filling up?

You can’t get an exact number from one partial fill, because you don’t know how much gas the car really used. Keep a record instead: start with a full tank, add up every gallon you buy, and when you next fill to full, divide all the miles by all the gallons.

How do you calculate gallons per mile?

Divide 1 by your MPG. At 25 MPG, that is 0.04 gallons per mile, or 4 gallons per 100 miles. Multiply by your trip miles to see how much gas you need.

Is the MPG on my dashboard accurate?

It is an estimate made by the car’s computer, and it can be off. To check it, work out MPG with the fill-up method for a few tanks and compare the two numbers.

Sources

  • fueleconomy.gov (U.S. DOE and EPA), How to calculate your MPG (odometer and trip odometer methods) (checked November 12, 2026): fueleconomy.gov
  • fueleconomy.gov, Factors that affect MPG: fueleconomy.gov
  • fueleconomy.gov, Fuel economy in cold weather: fueleconomy.gov
  • fueleconomy.gov, Driving more efficiently: fueleconomy.gov
  • fueleconomy.gov, Keeping your vehicle in shape: fueleconomy.gov