Fuel Economy

How to Calculate Miles Per Gallon: The Formula Guide

March 5, 2024 · By Miles Per Gallon Calculator

Understanding how to calculate miles per gallon (MPG) puts you in control of your fuel spending. Whether you want to verify your car’s official rating, track changes over time, or simply satisfy curiosity, the math is straightforward once you know the method. This guide walks through the formula, the steps, and the factors that shape your real-world fuel economy.

The Core MPG Formula

The formula for miles per gallon is simple:

Miles Driven divided by Gallons Used equals MPG

That is it. If you drive 300 miles and burn 10 gallons to do it, your MPG is 30. The challenge is not the arithmetic but gathering accurate inputs, which is where the fill-up method comes in.

You can skip the manual math entirely by using our MPG Calculator, which handles the division and lets you log multiple tanks at once.

The Fill-Up Method: 5 Steps to Accurate MPG

The fill-up method is the gold standard for measuring real-world fuel economy. It removes guesswork by using the gas pump as a precise measuring device.

  1. Fill your tank to the brim. When the pump clicks off automatically, stop. Do not top off, as adding extra fuel after the click gives you an inconsistent starting baseline.

  2. Record your odometer reading. Write down the exact mileage shown on your dashboard. You can also reset your trip odometer to zero at this point, which makes step 4 easier.

  3. Drive normally. There is no need to change your habits. The whole point is to measure your typical driving, so highway runs, city errands, and mixed trips all count.

  4. Fill up again to the brim at your next stop. Use the same pump behavior as step 1. Note the number of gallons the pump delivers. This is your “Gallons Used” figure.

  5. Calculate your odometer difference. Subtract your reading from step 2 from your current odometer. This is your “Miles Driven.” Divide miles driven by gallons used and you have your MPG.

Repeat this process across three to five tanks before drawing conclusions. One tank can be an outlier due to short trips, a particularly long highway run, or even small errors in how full the tank was each time.

Trip Computer vs. Fill-Up Method: Why the Numbers Differ

Most modern vehicles display a running MPG estimate on the dashboard. These figures come from the engine control unit, which calculates fuel consumption based on injector pulse width and airflow sensors. The fill-up method, by contrast, measures actual fuel consumed at the pump.

Trip computers are consistently optimistic. Studies and owner reports routinely show they read 5 to 15 percent higher than the fill-up method reveals. A display showing 32 MPG might correspond to a calculated 28 to 30 MPG in reality.

Why the gap? Sensors have tolerances and can drift over time. Fuel temperature affects density, so a gallon measured at the pump in winter weighs slightly more than the control unit assumes. Some manufacturers also calibrate optimistically for marketing reasons. The fill-up method eliminates all these variables because you are measuring exactly what left your tank.

City MPG vs. Highway MPG vs. Combined: What Each Means

When you look up a vehicle’s official rating, you will see three numbers.

City MPG reflects fuel economy during stop-and-go driving. Frequent braking, idling at lights, and low-speed acceleration all burn fuel without covering much distance. City figures are always the lowest of the three.

Highway MPG reflects sustained cruising, typically between 55 and 75 mph, with minimal stops. Engines run more efficiently at steady speeds, so highway figures are always higher than city figures.

Combined MPG is a weighted average: 55 percent city driving and 45 percent highway driving. This is the headline figure most buyers compare across vehicles and the one used to calculate annual fuel cost estimates.

How the EPA Tests Vehicles

The U.S. Environmental Protection Agency does not test vehicles on public roads. Instead, technicians run cars on a dynamometer, which is essentially a treadmill for vehicles, inside a controlled laboratory. The test follows scripted speed-and-time patterns designed to simulate typical driving cycles.

The EPA revised its test cycles in 2008 to add a high-speed test, an air conditioning test, and a cold-temperature test, bringing ratings closer to real-world results. Even so, the lab environment removes variables like wind, hills, and varying road surfaces. This is why many drivers never quite match the sticker number, though it is a fair benchmark for comparing vehicles against each other.

Factors That Reduce Real-World MPG

Several conditions pull your actual fuel economy below the EPA estimate.

Speed is the biggest factor above highway minimums. Aerodynamic drag increases with the square of speed, so driving at 80 mph burns significantly more fuel per mile than driving at 65 mph.

Cold weather hurts in two ways. Cold engines run richer fuel mixtures until they reach operating temperature, and cold air is denser, increasing aerodynamic drag. Winter-blend gasoline also contains slightly less energy per gallon than summer-blend fuel.

Air conditioning adds load to the engine. On a hot day in stop-and-go traffic, A/C can reduce MPG by 5 to 25 percent depending on vehicle size.

Cargo and passenger load increases rolling resistance and the energy needed for acceleration. A fully loaded SUV will burn more fuel per mile than the same vehicle with one driver.

Terrain matters too. Climbing hills requires more energy than flat roads, and while descending recovers some of that through gravity, the net effect of a hilly route is higher fuel consumption than a flat one of equal distance.

Tracking MPG Over Several Tanks

Single-tank measurements are noisy. For a reliable average, log at least four to six fill-ups under similar conditions. Keep a small notebook in the glovebox or use a spreadsheet to record the date, odometer reading, and gallons added each time. After several tanks, average your per-tank MPG figures to get a stable baseline.

This baseline is also useful for spotting problems. A sudden drop of 3 to 5 MPG that persists across multiple tanks can indicate a failing oxygen sensor, under-inflated tires, or a clogged air filter, all of which are worth addressing both for economy and engine health.

For long trips, our Trip Cost Calculator lets you enter your average MPG alongside current fuel prices to project exactly what a journey will cost before you leave.

Worked Example: 312 Miles, 10.4 Gallons

Here is the formula applied to real numbers.

You fill up and reset your trip odometer. Over the next several days you drive 312 miles, a mix of commuting and a weekend errand run. You stop at the pump and it takes exactly 10.4 gallons to fill the tank to the brim again.

312 divided by 10.4 equals 30 MPG.

If your car’s sticker says 28 city / 36 highway / 31 combined, a result of 30 MPG for mixed driving is right in line with expectations. If the same calculation returned 24 MPG across multiple tanks, that would be worth investigating.

The fill-up method is the most reliable way to know what your vehicle is actually doing, and the formula itself takes about five seconds to compute. Used consistently, it gives you a honest picture of your fuel economy that no dashboard estimate can match.