Fuel economy

How to calculate gas mileage

To calculate gas mileage, fill your tank completely, note your odometer (or reset the trip meter), drive normally until you need fuel, fill up completely again, and divide the miles driven by the gallons it took to refill. For example, 300 miles on 12 gallons is 25 miles per gallon (MPG). Repeat this over several tanks and divide total miles by total gallons for a reliable average.

What is gas mileage (MPG)?

Gas mileage, measured in miles per gallon (MPG), is the number of miles a vehicle travels on one gallon of fuel. Higher is better. As Edmunds explains in its MPG guide, MPG is the standard way fuel consumption is measured in the United States, while most other countries use liters per 100 kilometers (L/100 km), where lower is better.

  • Fuel economy is the general name for how far a vehicle goes on a given amount of fuel. MPG and km/L are fuel economy units.
  • Fuel consumption is the inverse: how much fuel a vehicle burns over a set distance, such as L/100 km. The two describe the same thing from opposite directions, which is why a car with better fuel economy has a higher MPG but a lower L/100 km figure.

How do you calculate gas mileage step by step?

The most accurate manual method is the full-tank (or tank-to-tank) method. It measures exactly how much fuel your car used over a known distance, in six steps.

  • Fill the tank completely. Stop at the first automatic click of the pump. Don't top off, because squeezing in extra fuel makes each fill a slightly different size.
  • Record the odometer or reset the trip meter. Write down the total mileage, or zero out Trip A. A photo of the dashboard works too.
  • Drive normally. Use the car as you usually do until you need fuel again. The longer the stretch, the smaller the effect of small pump differences.
  • Fill the tank completely again, stopping at the first click, just like the first fill.
  • Record two numbers: the gallons you just pumped (from the pump display or receipt) and the miles driven since the last fill-up (trip meter, or new odometer minus old odometer).
  • Divide miles by gallons. The result is your MPG for that tank.

What is the formula for gas mileage?

The gas mileage formula is MPG = miles driven ÷ gallons used. If you only have odometer readings, calculate the distance first: miles driven = current odometer − odometer at the last full fill-up.

Worked example: your odometer read 42,150 at your last full tank. Today it reads 42,462 and the pump says you added 12.4 gallons. Miles driven: 42,462 − 42,150 = 312 miles. Gas mileage: 312 miles ÷ 12.4 gallons = 25.2 MPG.

The gallons you use are the ones pumped at the end of the interval, not the beginning: that fill replaces exactly the fuel the car burned since the previous full tank. Outside the US the same method gives fuel consumption in metric units: L/100 km = liters used ÷ kilometers driven × 100.

How do you calculate average gas mileage over several tanks?

One tank is a snapshot. A week of highway driving and a week of school runs can differ by several MPG, so the number that tells you what your car really does is an average over several full tanks.

To calculate average gas mileage correctly, add up all the miles and all the gallons, then divide total miles by total gallons. Don't average the individual MPG figures, because that gives a short tank the same weight as a long one. Across three tanks of 312, 180 and 405 miles, the gap between the two methods is about half an MPG, and it grows when tank sizes vary a lot, pointing in whichever direction the short tanks happen to lean. Weighting by distance is what makes the average match what you actually spent at the pump.

Average gas mileage over three full tanks
TankMiles drivenGallons addedMPG for that tank
Tank 131212.425.16
Tank 21808.122.22
Tank 340514.627.74
Total89735.125.56 (correct average)
  • Correct method: 897 miles ÷ 35.1 gallons = 25.56 MPG.
  • Misleading shortcut: (25.16 + 22.22 + 27.74) ÷ 3 = 25.04 MPG.

How do you calculate MPG without filling up?

Sometimes you can't fill the tank: you're in a hurry, the station is expensive, or you only need enough to get home. You can still get an accurate MPG figure if you treat partial fills correctly.

Pump shutoff points are not perfectly consistent either. Say you drove 300 miles and the refill took 10.1 gallons at one pump, while a different pump might have clicked off at 10.5 gallons. That is 29.7 MPG versus 28.6 MPG for the same driving. Over three or four tanks those small variations cancel out; on a single short tank, they don't.

  • Keep the chain going. Record every partial fill's gallons, but don't calculate MPG at that point. At the next full fill, add up all the gallons pumped since the last full tank (partials included) and divide by all the miles driven over that whole stretch.
  • Never compute MPG from a partial fill alone. Ten gallons into a half-empty tank tells you nothing about how much fuel the car burned.
  • Missed a fill-up entirely? If you forgot to write one down, the interval that contains it is unreliable. Throw that interval out and restart from the next full tank rather than producing an impossible number.
  • Use the trip computer as a rough check. The dashboard reading is fine for spotting a trend, but it is an estimate, not a measurement.

Why doesn't my dashboard MPG match my calculation?

Most modern cars display an average MPG on the instrument cluster. It is convenient, but Edmunds notes that these onboard readouts tend to be overly optimistic, and that working MPG out by hand from fill-ups is more accurate.

The reason is simple: the car doesn't measure fuel directly. It estimates consumption from engine data such as injector activity, while your calculation uses the actual gallons the pump delivered. Use the dashboard for quick feedback while driving, and fill-up math when you want the true number.

To check your car's display, reset the dashboard average when you reset the trip meter at a full tank. At the next full tank, compare the display to your own calculation. The percentage gap tends to stay similar over time, so once you know it, you can mentally correct future readings.

Why is my gas mileage lower than the EPA estimate?

The MPG on a new car's window sticker comes from standardized EPA laboratory tests that use fixed driving cycles for city, highway and combined ratings. Edmunds explains that the EPA revised those tests in 2008 (adding higher speeds and air-conditioning use) and again for the 2017 model year, which lowered estimates overall. Even so, the label is a comparison tool, not a promise. Real-world results depend on how, where and when you drive, and the U.S. Department of Energy's fueleconomy.gov quantifies the biggest factors.

This is also why tracking your own MPG over time is useful: your history becomes the baseline. A drop of a few MPG in January is probably the weather. A drop of a few MPG in June, with the same commute, is worth a closer look at tire pressure, a dragging brake or an overdue service.

What lowers real-world gas mileage, according to fueleconomy.gov
FactorEffect on gas mileageSource
Aggressive driving (speeding, hard acceleration and braking)Roughly 15% to 30% lower at highway speeds, 10% to 40% lower in stop-and-go trafficDriving More Efficiently
Speed above 50 mphEach 5 mph over 50 is like paying an extra $0.30 per gallonDriving More Efficiently
Rooftop cargo boxAbout 2% to 8% lower in city driving, 6% to 17% on the highway, 10% to 25% at Interstate speedsDriving More Efficiently
Extra weightAbout 1% lower per extra 100 pounds (45 kg)Driving More Efficiently
IdlingA quarter to a half gallon of fuel per hour, depending on engine size and A/C useDriving More Efficiently
Cold weather, gasoline car (20°F / -7°C vs. 77°F / 25°C)Roughly 15% lower in city driving, up to 24% lower on short trips of 3-4 miles (5-6 km)Fuel Economy in Cold Weather
Cold weather, hybrid (20°F / -7°C vs. 77°F / 25°C)About 30% to 34% lowerFuel Economy in Cold Weather

Figures as published by fueleconomy.gov, checked September 2026. The speed cost follows fuel prices and changes over time.

How do you calculate gas mileage for a trip?

Calculating gas mileage for a trip usually means one of two things: figuring out how much fuel and money a trip will take before you leave, or measuring the MPG you actually got after the trip.

Before a trip, estimate fuel and cost: gallons needed = trip distance ÷ your MPG, and trip fuel cost = gallons needed × price per gallon. In one step, trip fuel cost = (trip miles ÷ MPG) × price per gallon.

Example: a 450-mile road trip in a car that averages 28 MPG, with fuel at $3.40 per gallon (an example price), needs 450 ÷ 28 = 16.07 gallons, which costs 16.07 × $3.40 = about $54.64 one way. Use your own measured average MPG rather than the sticker number, and knock a little off if the trip involves high highway speeds, a roof box or a fully loaded car. For a round trip, double it.

After a trip, measure the MPG you got: fill up completely right before you leave and reset the trip meter. Fill up completely again when you get back, or at the last stop before home. Add up every gallon you bought along the way, including the final fill, and divide the trip meter's miles by that total. This is the same full-tank method, applied to one journey.

How do you calculate gas cost per mile?

Cost per mile tells you what each mile of driving costs in fuel alone. To calculate it, divide the price per gallon by your MPG: fuel cost per mile = price per gallon ÷ MPG. At $3.40 per gallon and 28 MPG, fuel costs 3.40 ÷ 28 = $0.12 per mile.

You can also calculate it from your fill-up records over a period: add up everything you spent on fuel and divide by the miles driven. That version automatically reflects the real prices you paid.

Is fuel cost per mile the same as the IRS mileage rate?

No. The IRS standard mileage rate covers the full cost of operating a vehicle for business, including depreciation, insurance and maintenance, not just fuel. According to the Journal of Accountancy (July 2026), the IRS set the 2026 business rate at 72.5 cents per mile for January through June and raised it to 76 cents per mile from July 1, 2026 (IRS Announcement 2026-11).

Your fuel-only cost per mile will be a fraction of that. If you drive for work, what matters for the standard rate is an accurate log of business miles, not your MPG. This is general information, not tax advice.

How many miles is $20 of gas?

Miles from a dollar amount = (dollars ÷ price per gallon) × MPG. At $3.50 per gallon, $20 buys about 5.7 gallons. In a 25 MPG car, that is 5.7 gallons × 25 MPG ≈ 143 miles. Plug in your own price and your own average MPG for an accurate figure.

How do you convert MPG to L/100 km and km/L?

If you read a European or Canadian review, or your car displays metric units, these conversions help: L/100 km = 235.215 ÷ MPG (US), km/L = MPG (US) × 0.4251, and MPG (UK imperial) = MPG (US) × 1.201. Starting from imperial MPG, L/100 km = 282.48 ÷ MPG (UK).

Imperial gallons are larger than US gallons (about 4.55 liters versus 3.79 liters), so the same car shows a higher MPG figure in the UK.

The L/100 km column shows something the MPG column hides. Going from 20 to 30 MPG saves almost 4 liters every 100 km, but going from 40 to 50 MPG saves only about 1.2 liters. Edmunds makes the same point: improving a thirsty vehicle saves more fuel than improving an already efficient one.

MPG (US) converted to L/100 km, km/L and imperial MPG
MPG (US)L/100 kmkm/LMPG (UK)
2011.88.524.0
259.410.630.0
307.812.836.0
405.917.048.0
504.721.360.0

What mistakes make gas mileage calculations wrong?

Check these before you trust an MPG figure. Each one produces a number that looks plausible and is wrong.

  • Starting or ending on a partial fill. Both ends of the interval must be full tanks.
  • Topping off. Stop at the first click so every fill ends at roughly the same level.
  • Using the wrong gallons. Use the gallons from the fill at the end of the interval, plus any partial fills in between.
  • Forgetting a fill-up. One missing entry makes the interval impossible to compute. Discard it and restart.
  • Averaging MPG figures instead of totals. Divide total miles by total gallons.
  • Judging from one short tank. Use at least three full tanks before drawing conclusions.
  • Mixing units. US and imperial gallons are different sizes; liters and gallons don't mix.
  • Comparing winter numbers to summer numbers. Cold weather alone costs a gasoline car roughly 15% in city driving, according to fueleconomy.gov.

Should you track gas mileage by hand or with an app?

Pen and paper work: a notebook in the glovebox with the date, odometer, gallons and price for every fill-up is enough for every formula on this page. A spreadsheet adds automatic totals and charts.

The weak point of any manual log is the set of rules above. It's easy to forget one fill-up, compute a partial fill by mistake, or average the averages. An app built for fuel logging can apply those rules for you.

WrenchTime, an iOS app for tracking vehicle maintenance, fuel and EV charging logs, trips and running costs for cars and motorcycles, handles this with a few specific features: you mark each fill-up as a full tank or not, so consumption is computed tank to tank; you flag a missed fill-up, so that interval is excluded instead of producing an impossible figure; and it alerts you when your economy drops meaningfully against your own history. It shows efficiency in MPG (US or imperial), km/L or L/100 km, charts fuel cost per distance over time, and estimates per-trip fuel consumption from the fill-ups on either side of a recorded drive. The fuel economy tracker guide covers the details, and automatic mileage tracking records the distance side of the equation.

Your fuel log is also part of your car's history. A consistent record of fill-ups sits naturally alongside the service documents covered in our guide to which car maintenance records to keep, and a sudden MPG drop is often the first hint that something in that service history is overdue.

Key takeaways: how to calculate gas mileage

The whole method, and the rules that keep it honest, in seven lines.

  • Gas mileage = miles driven ÷ gallons used, measured between two full tanks.
  • Average correctly: total miles ÷ total gallons over at least three tanks, never the average of individual MPG figures.
  • Partial fills are fine as long as you add their gallons into the next full-tank calculation; a missed fill-up invalidates that interval.
  • Dashboard MPG is an estimate and tends to read high; the EPA sticker is a lab-based comparison figure.
  • Driving style and weather matter: aggressive driving can cut MPG by 15% to 40%, and cold weather by roughly 15% in city driving, per fueleconomy.gov.
  • Trip cost = (miles ÷ MPG) × price per gallon, and fuel cost per mile = price per gallon ÷ MPG.
  • L/100 km = 235.215 ÷ MPG (US). For imperial MPG, divide 282.48 instead.

Track your MPG without the math

If you'd rather log a fill-up in a few seconds and let the app handle full tanks, missed fill-ups and averages, download WrenchTime on the App Store. The free version covers 1 vehicle with 3 fuel entries per month, and WrenchTime Pro removes those limits with unlimited vehicles and entries. The fuel economy tracker guide shows exactly how it computes your MPG.

Frequently asked questions

What is the formula for calculating gas mileage?

Divide the miles driven since your last full tank by the gallons it took to refill the tank. MPG = miles driven ÷ gallons used. For example, 300 miles on 12 gallons is 25 MPG.

How many tanks should I use to calculate my real MPG?

Use at least three full tanks and divide total miles by total gallons. A single tank can be skewed by one long highway trip, a cold week or an inconsistent pump shutoff.

Is the MPG shown on my dashboard accurate?

It is a useful estimate, but it is often somewhat optimistic because the car calculates fuel use from engine data rather than measuring it. Fill-up calculations based on gallons pumped are more accurate.

How do I calculate gas cost for a trip?

Divide the trip distance by your average MPG to get gallons needed, then multiply by the price per gallon. A 450-mile trip at 28 MPG and $3.40 per gallon costs about $54.64 in fuel.

How do I convert MPG to L/100 km?

Divide 235.215 by the MPG figure in US gallons. For example, 25 MPG equals about 9.4 L/100 km. For imperial MPG, divide 282.48 by the MPG figure instead.

WrenchTime app icon, orange engine and wrench

Made for people who would rather know than guess.

Free to download. One vehicle, real features, no ads. Your garage will thank you.

Download WrenchTime on the App Store