Gas Mileage Calculator

Automotive Tools

Gas Mileage Calculator

Work out your car's fuel economy, cost per mile, and the fuel cost of any trip distance.

mi
gal
$
mi
Fuel economy
0MPG
 
Cost per mile$0
Cost of this trip$0
Estimated cost for entered trip length$0
Fuel economy varies with driving style, terrain, load, and weather — treat this as an average for the logged trip, not a guarantee for every trip.
Disclaimer: This calculator is provided for general informational and educational purposes only. It calculates fuel economy from the distance and fuel figures you enter and does not account for changing gas prices, driving conditions, vehicle load, or maintenance status. Actual fuel economy and costs will vary trip to trip.

Gas Mileage Calculator: How to Calculate MPG and Fuel Costs Accurately

Quick summary: A gas mileage calculator divides the miles driven by the gallons of fuel used to determine your vehicle’s fuel efficiency (MPG), then multiplies that by fuel price to estimate cost per mile. This guide explains the formula, walks through worked examples including the IRS standard mileage rate for 2026, and answers the most common questions people ask about tracking gas mileage and driving costs.

What Is a Gas Mileage Calculator?

A gas mileage calculator determines how many miles your vehicle travels per gallon of fuel (MPG), and how much that translates to in real driving costs. You enter your odometer readings (or trip distance) and the gallons of fuel used to fill up, and the calculator returns your fuel efficiency — a number you can use to compare vehicles, track efficiency over time, or estimate trip costs.

Beyond simple curiosity, gas mileage calculations matter for budgeting road trips, comparing vehicles before a purchase, and — for many self-employed drivers — calculating tax-deductible mileage using IRS standard rates.

The Gas Mileage Formula Explained

The core formula is simple:

MPG = Miles Driven ÷ Gallons of Fuel Used

To estimate cost:

Cost per Mile = Price per Gallon ÷ MPG

Total Trip Cost = (Trip Distance ÷ MPG) × Price per Gallon

Calculating Miles Driven Between Fill-Ups

  1. Reset or record your odometer at a full tank.
  2. Drive normally until you need to refuel.
  3. Fill the tank completely again and note how many gallons it took.
  4. Subtract your starting odometer reading from your ending reading to get miles driven.
  5. Divide miles driven by gallons used to get MPG.

Worked Example 1: Calculating MPG

You drive 342 miles between fill-ups, and it takes 11.5 gallons to refill the tank.

MPG = 342 ÷ 11.5 = 29.7 MPG

Worked Example 2: Estimating Trip Fuel Cost

You’re planning a 450-mile road trip. Your car averages 29.7 MPG, and gas costs $3.45 per gallon.

  1. Gallons needed: 450 ÷ 29.7 ≈ 15.15 gallons
  2. Total cost: 15.15 × $3.45 ≈ $52.27

Worked Example 3: Comparing Two Vehicles

You’re deciding between two cars for a 12,000-mile annual commute. Car A gets 25 MPG; Car B gets 40 MPG. Gas averages $3.50/gallon.

  • Car A: 12,000 ÷ 25 = 480 gallons × $3.50 = $1,680/year
  • Car B: 12,000 ÷ 40 = 300 gallons × $3.50 = $1,050/year

Car B saves $630 per year in fuel costs alone, which is a useful figure to weigh against any price difference between the two vehicles.

Worked Example 4: Using the IRS Standard Mileage Rate

If you drive for business and use the IRS standard mileage rate instead of tracking actual gas costs, the 2026 rate is 72.5 cents per mile for the first half of the year, raised to 76 cents per mile effective July 1, 2026, due to rising fuel prices — a rare mid-year adjustment . For 500 business miles driven after July 1, 2026:

500 × $0.76 = $380 deductible using the standard mileage method, which bundles fuel, depreciation, maintenance, and insurance into a single per-mile rate.

Why Fuel Efficiency Standards Matter

Fuel efficiency isn’t just a personal budgeting question — it’s shaped by federal policy. Fuel economy standards for new vehicles have increased substantially over the past decade, with regulatory targets requiring new vehicle fleets to average significantly higher MPG than a decade ago, a shift driven partly by the fact that SUVs and trucks — which are generally less efficient than sedans — now make up the majority of new vehicle sales <sup>[2]</sup>. This context helps explain why real-world MPG for a “new” vehicle today may differ from a similar model bought years earlier.

What Drivers Ask on Reddit About Gas Mileage

On forums like r/cars and r/personalfinance, a recurring question is why displayed dashboard MPG doesn’t match manually calculated MPG from fill-ups. The general consensus is that manual calculation (miles driven ÷ gallons used at the pump) is more accurate than the trip computer’s real-time estimate, which can be thrown off by how full the “full tank” actually was at each fill-up, temperature effects on fuel expansion, and rounding in the vehicle’s onboard computer. Drivers are frequently advised to average MPG over several fill-ups rather than trusting a single tank’s number, since driving conditions (highway vs. city, weather, terrain) cause significant variation.

Common Mistakes When Calculating Gas Mileage

  • Not filling the tank completely at both the start and end of the measurement period, which skews the gallons-used figure.
  • Relying on a single tank’s data instead of averaging several fill-ups, since one tank of mostly highway driving looks very different from one tank of stop-and-go city driving.
  • Confusing the IRS standard mileage rate with actual fuel cost. The IRS rate covers more than just gas — it includes depreciation, maintenance, and insurance, so it will not match your gas-only cost per mile.
  • Forgetting that fuel prices change. A cost-per-mile estimate calculated with old gas prices can be significantly off from current costs.

Frequently Asked Questions

How do you calculate gas mileage?

Divide the total miles driven by the gallons of fuel used to refill the tank: MPG = Miles Driven ÷ Gallons Used.

What is a good MPG for a car?

Most modern gasoline sedans average 28–40 MPG on the highway, while SUVs and trucks typically average 18–28 MPG. Hybrid vehicles often exceed 45–55 MPG.

How much does a road trip cost in gas?

Divide your trip distance by your car’s MPG to get gallons needed, then multiply by the current price per gallon: Cost = (Distance ÷ MPG) × Price per Gallon.

What is the 2026 IRS mileage rate?

The IRS set the 2026 standard business mileage rate at 72.5 cents per mile starting in January, then raised it to 76 cents per mile effective July 1, 2026, due to rising fuel costs — an uncommon mid-year adjustment.

Why does my dashboard MPG differ from my calculated MPG?

Onboard trip computers estimate MPG in real time and can be affected by fill-up inconsistencies, temperature, and rounding. Manually calculating MPG from odometer readings and gallons used at the pump is generally considered more accurate.

Conclusion

A gas mileage calculator turns two simple numbers — miles driven and gallons used — into insight you can act on, whether you’re comparing vehicles, budgeting a road trip, or tracking a business mileage deduction. With 2026 fuel prices and IRS mileage rates shifting throughout the year, recalculating regularly with current numbers ensures your gas mileage estimates stay accurate.

Related Calculators

Sources: [1] Journal of Accountancy, “IRS raises standard mileage rates for remainder of 2026,” https://www.journalofaccountancy.com/news/2026/jul/irs-raises-standard-mileage-rates-for-remainder-of-2026/; IRS.gov, “IRS sets 2026 business standard mileage rate at 72.5 cents per mile,” https://www.irs.gov/newsroom/irs-sets-2026-business-standard-mileage-rate-at-725-cents-per-mile-up-25-cents [2] CBS News/AP, “New Vehicles Must Average 40 Mpg By 2026, Up From 24 Mpg,” https://www.cbsnews.com/amp/detroit/news/new-vehicles-must-average-40-mpg-by-2026-up-from-24-mpg