Gas Mileage Calculator

How do I calculate gas mileage?

Divide the miles you drove by the gallons it took to refill the tank. For example, 310 miles on 11.4 gallons is 310 / 11.4 = 27.19 MPG, which is 8.65 L/100km. At $3.45 a gallon that tank cost about 12.7 cents per mile.

This gas mileage calculator works out your real fuel economy from what you drove and what you put in the tank. Enter miles driven and gallons used, and it returns miles per gallon (MPG), liters per 100 km and km per liter. Add the price per gallon and it also shows your fuel cost per mile and per 100 miles.

A single tank tells you about one tank. The MPG Tracker tab lets you add one row per fill-up (miles, gallons and price) and gives your true average MPG across all of them, your best and worst tank, total miles, total gallons and total spent. That average is the number worth checking against the window sticker or your trip computer.

Enter your details

How to Use the Gas Mileage Calculator

  1. 1

    Fill the tank and zero the trip meter

    Fill up until the pump clicks off, then reset your trip odometer (or write down the odometer reading).

  2. 2

    Drive, then fill up again

    Drive normally until you need fuel. Fill to the first click again and note the gallons on the pump and the miles on the trip meter.

  3. 3

    Enter miles, gallons and price

    On the Single Calculation tab, type the miles driven and gallons used. Add the price per gallon if you want cost per mile.

  4. 4

    Track several fill-ups

    Switch to MPG Tracker and press Add Fill-up for each tank. The average uses total miles divided by total gallons across every row you enter.

How the calculator works

MPG is miles divided by gallons. The calculator converts that to metric using the US gallon: L/100km = 235.215 / MPG, and km/L = 100 / (L/100km). Cost per mile is the price per gallon divided by MPG, and cost per 100 miles is that times 100.

In the tracker, the average is total miles divided by total gallons, not the average of each row's MPG. The two differ when tanks are different sizes, and the weighted figure is the correct one. Best and worst are the highest and lowest single-tank MPG. Total spent adds gallons x price for every row where you entered a price.

MPG = miles driven / gallons used
L/100km = 235.215 / MPG
km/L = 100 / (L/100km)
Cost per mile = price per gallon / MPG
Average MPG (tracker) = total miles / total gallons

MPG to L/100km conversion chart

Values the calculator shows for common fuel economy figures. L/100km runs the other way from MPG: a lower number is better. All figures use US gallons; a UK (imperial) gallon is about 20% larger, so UK MPG figures are higher for the same car.

MPG (US)L/100kmkm/L
1023.524.25
1515.686.38
2011.768.50
259.4110.63
307.8412.75
356.7214.88
405.8817.01
504.7021.26

Fuel cost per mile at different gas prices

Cost per mile is price per gallon divided by MPG. This table shows cents per mile and dollars per 100 miles. To budget a whole trip or a year of driving from these figures, use the fuel cost calculator.

  • Over 12,000 miles a year at $3.50 a gallon, a 25 MPG car spends about $1,680 on fuel and a 30 MPG car about $1,400. Five MPG is worth roughly $280 a year.
MPG$3.00/gal$3.50/gal$4.00/gal$5.00/gal
2015.0¢ ($15.00/100 mi)17.5¢ ($17.50)20.0¢ ($20.00)25.0¢ ($25.00)
2512.0¢ ($12.00/100 mi)14.0¢ ($14.00)16.0¢ ($16.00)20.0¢ ($20.00)
3010.0¢ ($10.00/100 mi)11.7¢ ($11.67)13.3¢ ($13.33)16.7¢ ($16.67)
407.5¢ ($7.50/100 mi)8.75¢ ($8.75)10.0¢ ($10.00)12.5¢ ($12.50)

Worked example: three tanks in the tracker

The tracker shows an average of 935 / 34.40 = 27.18 MPG, best 28.35, worst 25.87 and total spent $118.72. It does not show a per-row MPG or a tracker cost per mile, but you can get the latter yourself: $118.72 / 935 miles = 12.7 cents per mile. A spread of 2 to 3 MPG between ordinary tanks is normal, which is why one fill-up is a poor basis for deciding something has changed.

Fill-upMilesGallons$/galTank MPGTank cost
131011.4$3.4527.19$39.33
228210.9$3.5225.87$38.37
334312.1$3.3928.35$41.02
Totals93534.4027.18 avg$118.72

Tips for accurate fill-up tracking

  • Fill to the first click every time, ideally at the same station and pump. Topping off adds fuel the pump cannot measure consistently and skews this tank and the next.
  • Write the trip miles and gallons down at the pump, not later from memory.
  • If you skip a fill-up or only add a partial tank, add those miles and gallons to the next full-tank row rather than entering a partial row on its own.
  • Log at least three to five tanks before trusting the average.
  • Expect winter to be worse. Cold starts, denser air and winter fuel blends commonly cut fuel economy by 10 to 20%.
  • Your odometer can be off too. Oversized or worn tires change how far the car thinks it went; check the effect with the tire size calculator.
  • Trip computers estimate fuel use rather than measuring it and often read a few percent optimistic. A log against pump gallons is the figure to trust.

What the numbers are useful for

  • Spotting a problem early: a sustained drop of several MPG across consecutive tanks, with nothing else changed, can point to low tire pressure, a dragging brake or a failing sensor. That is the time to see a mechanic.
  • Comparing cars honestly: cost per mile puts a thirsty car on cheap fuel and an efficient one on premium fuel on the same footing.
  • Checking a change worked: compare several tanks before a new set of tires or a tune-up against several after, never one against one.
  • Working in metric? Convert distances to miles first; this calculator takes miles and US gallons as inputs.

Features

  • Single fill-up MPG calculation
  • Multi fill-up MPG tracker
  • L/100km and km/L conversions
  • Cost per mile analysis
  • Best/worst/average MPG stats
  • Total fuel cost tracking

Frequently Asked Questions

How do I calculate my car's MPG?

Fill the tank to the click and reset the trip meter. Drive normally, fill up again, and divide the miles on the trip meter by the gallons you just added. 310 miles on 11.4 gallons is 27.19 MPG.

How do I convert MPG to L/100km?

Divide 235.215 by the MPG (US gallons). 30 MPG is 235.215 / 30 = 7.84 L/100km, and 25 MPG is 9.41 L/100km. To go the other way, divide 235.215 by the L/100km figure: 8 L/100km is about 29.4 MPG.

How do I work out fuel cost per mile?

Divide the price per gallon by your MPG. At $3.50 a gallon and 25 MPG, fuel costs $0.14 per mile, or $14.00 per 100 miles. This is fuel only; insurance, maintenance and depreciation are extra.

Why is my average MPG different from averaging each tank?

The tracker divides total miles by total gallons, which weights long tanks more than short ones. In the three-tank example the tanks were 27.19, 25.87 and 28.35 MPG; their simple average is 27.14, but the true average is 935 / 34.40 = 27.18 MPG.

How many fill-ups do I need for an accurate average?

Three to five. Single tanks vary by a couple of MPG because of traffic, weather, load and how the pump clicked off, so one reading can easily be 10% out. Several tanks average that away.

Why is my MPG lower than the EPA rating?

EPA ratings come from standardized lab test cycles. Short trips, cold weather, aggressive acceleration, highway speeds above about 50 mph, roof racks, heavy loads and idling all lower real-world MPG, and 10 to 20% below the sticker is common.

Can I enter kilometers and liters?

No. Inputs are miles and US gallons, and the results include L/100km and km/L conversions. If you log in metric, convert your figures first, or use the fuel cost calculator, which accepts kilometers and price per liter for trip costs.

Sources and review

Prepared by the Codezyra editorial team. The figures and rules on this page were checked against these official sources:

This is general information, not personal tax, legal or medical advice.

Last reviewed