AllFreeCalculator

Gas Mileage Calculator

Calculate MPG, km per liter, and cost per mile from your distance and fuel usage.

How Gas Mileage Is Calculated

Gas mileage is the distance traveled per unit of fuel consumed:

MPG = Distance (miles) / Fuel Used (gallons) MPG=df

For km per liter:

km/L = Distance (km) / Fuel Used (liters)

To convert MPG to km/L, multiply by 0.4251. To find cost per mile: divide fuel price per gallon by MPG.

Cost per mile=Price/galMPG

Variable Definitions

Distance Driven: The total distance traveled on a tank of fuel or between fill-ups, in miles or kilometers. Use your trip odometer for accuracy rather than estimating from a map.

Fuel Used: The total fuel consumed during the trip, in gallons or liters. The most accurate method is to fill the tank completely, drive, then fill again and note how much fuel went in.

Fuel Price: The cost per gallon or per liter of fuel. This is optional but lets you see cost per mile and cost per km, which is useful for budgeting and comparing vehicles.

Worked Example

You drove 350 miles and used 12 gallons of gas at $3.50 per gallon:

  1. MPG = 350 / 12 = 29.17 MPG
  2. km/L = 29.17 x 0.4251 = 12.40 km/L
  3. Cost per mile = $3.50 / 29.17 = $0.120 per mile
  4. Cost per km = $0.120 / 1.609 = $0.075 per km

Edge Cases and Advanced Scenarios

Why MPG drops in city driving: In city driving, engines idle at traffic lights, accelerate from stops, and run accessories (A/C, headlights). These consume fuel without adding distance. City MPG is typically 20-30% lower than highway. Hybrid vehicles close this gap because they recapture energy during braking and shut off the engine at idle.

Seasonal MPG changes: Cold weather reduces MPG by 10-20%. Winter-blend gasoline has lower energy content, cold engines are less efficient, and tire pressure drops (each 1 PSI drop costs about 0.2% in fuel economy). Warming up your car for more than 30 seconds wastes fuel without improving engine performance.

What to Do with Your Result

  • Track your MPG over several fill-ups to establish a baseline. A sudden drop may indicate a maintenance issue (dirty air filter, underinflated tires, failing O2 sensor).
  • Compare your result to your vehicle's EPA rating to see if you are above or below the official estimate.
  • Use the cost-per-mile figure to compare the true running cost of different vehicles you are considering.
  • Improve MPG by maintaining steady speeds, keeping tires inflated to spec, removing excess weight, and avoiding aggressive acceleration.

Frequently asked questions

How do I calculate my MPG?

Fill your tank completely, reset your trip odometer, drive normally, then fill up again. Divide the miles driven by the gallons it took to refill. That is your MPG.

What is good gas mileage?

The EPA average for new passenger vehicles is about 28 MPG combined. Above 30 MPG is good for a gasoline car. Hybrids achieve 45-55 MPG, and many EVs get 100+ MPGe.

Why is my MPG lower in the city?

City driving involves frequent stops, starts, and idling, all of which waste fuel. Highway driving at a steady speed uses the engine more efficiently. City MPG is typically 20-30% lower than highway MPG.

Does speed affect gas mileage?

Yes. Most vehicles reach peak fuel efficiency at 45-65 mph. Above 65, aerodynamic drag increases rapidly. Every 5 mph above 50 is roughly equivalent to paying an extra $0.20 per gallon.

How do I convert MPG to km per liter?

Multiply MPG by 0.4251. For example, 30 MPG equals about 12.75 km/L. This calculator shows both units automatically.

Does air conditioning reduce gas mileage?

Yes, by about 5-25% depending on the vehicle and conditions. At low speeds, opening windows is more efficient. At highway speeds, A/C is more efficient than the drag from open windows.

Related calculators