MPG Calculator

Quick answer: Divide the miles you drove by the gallons of fuel you used: MPG = miles ÷ gallons. For example, 320 miles ÷ 12.4 gallons = 25.8 MPG. At $3.45 per gallon, fuel costs you $0.134 per mile — about 13.4 cents — and $42.78 for the whole 320-mile trip.

Measure your real-world fuel efficiency with this free MPG calculator. Enter the miles you drove and the gallons used — or two odometer readings — and it instantly computes your miles per gallon, fuel cost per mile, and the total fuel cost of the trip.

Enter your numbers

mi
gal
$

Your results

Fuel efficiency—

Estimate of that trip's fuel use. Real-world MPG varies with traffic, speed, weather, cargo, and fuel grade.

How to use this calculator

Choose whether to enter trip miles directly or two odometer readings, then enter the gallons of fuel the trip used. Add the fuel price per gallon to also get your cost per mile and total trip fuel cost. Results update instantly as you type.

How this is calculated

Fuel efficiency is defined as miles per gallon (MPG):

MPG = miles driven ÷ gallons of fuel used

Cost metrics derive directly from it:

  • Cost per mile = fuel price per gallon ÷ MPG
  • Total trip fuel cost = gallons used × fuel price per gallon
  • Gallons per 100 miles = 100 ÷ MPG

Assumptions and edge cases: the calculator takes your inputs at face value, so odometer entry requires the end reading to be greater than the start reading, and gallons must be greater than zero. Fuel price is optional — leave it blank to see efficiency numbers only. The result reflects the conditions of that trip; a single tankful is not necessarily representative of your car's long-term average.

Worked example

A driver records 320 trip miles and uses 12.4 gallons, with fuel at $3.45 per gallon:

  • MPG = 320 ÷ 12.4 = 25.8 MPG
  • Cost per mile = $3.45 ÷ 25.8 = $0.134 per mile (≈ 13.4¢)
  • Total trip fuel cost = 12.4 × $3.45 = $42.78
  • Gallons per 100 miles = 100 ÷ 25.8 = 3.9 gal

Reference data

This tool is pure math — no external data table is used. The standard constants it works with are the definitions of miles per gallon (miles ÷ gallons) and cost per mile (price per gallon ÷ MPG), which the calculator computes live from your inputs.

Frequently asked questions

How do you calculate MPG?

Divide the number of miles you drove by the number of gallons of fuel you used: MPG = miles driven ÷ gallons used. The most reliable way is the fill-up method: fill the tank, reset or record your odometer, drive, then refill and divide the miles by the gallons added.

How do I calculate MPG with my odometer?

Fill your tank and note the odometer reading. Drive normally, then fill the tank again and note the new odometer reading. Subtract the start reading from the end reading to get miles driven, then divide by the gallons it took to refill the tank.

What is cost per mile and how is it calculated?

Cost per mile is the fuel price per gallon divided by your MPG: fuel price ÷ MPG. For example, at $3.45 per gallon and 25.8 MPG, fuel costs $3.45 ÷ 25.8 = $0.134 per mile, about 13.4 cents per mile.

Is my MPG result exact or an estimate?

The math itself is exact, but your real-world MPG varies with traffic, speed, weather, cargo, and fuel grade. Treat the result as a measurement of that particular trip, and average several fill-ups for a stable long-term figure.

Related calculators