Gas Mileage Per Mile Calculator: MPG & Cost
- Cost per mile
- $/mile
- Result
- Distance
- 300 miles
- You entered
- Fuel used
- 12 gallons
- You entered
This calculator works out your vehicle’s gas mileage per mile in two ways: it converts distance traveled and fuel used into miles per gallon (MPG) or liters per 100 km, and it also estimates the fuel cost per mile when you enter the price per gallon or liter. You enter the distance driven, the fuel consumed, and optionally the fuel price, and you get back your average efficiency and the cost per mile. The first result is your fuel economy in MPG (US), with cost per mile shown as a secondary output.
Formula
The core formula for gas mileage per mile is simple division:
MPG = Distance (miles) ÷ Fuel used (gallons)
For cost per mile, divide the fuel price by the MPG:
Cost per mile ($) = Fuel price ($/gallon) ÷ MPG
Where:
- Distance – the total miles driven (or kilometers, if you convert first).
- Fuel used – the gallons (US) or liters consumed to cover that distance.
- MPG – miles per gallon, the standard US measure of fuel economy.
- Fuel price – what you pay per gallon (or liter) at the pump.
If you measure in metric, use liters per 100 km instead: L/100km = (Fuel in liters ÷ Distance in km) × 100. A lower L/100km number means better efficiency, the opposite of MPG.
Worked Example
Using the default values from the calculator above:
- Distance = 300 miles, Fuel used = 12 gallons, Price = $3.50/gallon.
- MPG = 300 ÷ 12 = 25.0 MPG.
- Cost per mile = $3.50 ÷ 25.0 = $0.140 per mile.
So with those numbers, you get 25 miles per gallon and each mile costs about 14 cents in fuel alone. That matches the calculator’s output.
How to Measure Your Own MPG
The most accurate way is the “full tank� method:
- Fill the tank completely and note the odometer reading (or reset the trip meter).
- Drive normally until you need fuel again.
- Fill the tank completely again and note the gallons pumped and the new odometer reading.
- Subtract the first odometer reading from the second to get distance driven.
- Divide distance by gallons pumped.
For example, if you drove 340 miles and pumped 10.5 gallons, your MPG is 340 ÷ 10.5 = 32.4. This method averages out short-term variations like idling or a single traffic jam.
Why MPG Varies: Real-World Factors
Your car’s sticker MPG is measured in a lab. Real-world numbers differ because of:
- Speed – fuel economy typically peaks around 45–60 mph; above that, aerodynamic drag rises sharply.
- Stop-and-go traffic – city driving uses more fuel per mile because acceleration is inefficient.
- Tire pressure – underinflated tires increase rolling resistance and lower MPG.
- Load and roof racks – extra weight and drag reduce efficiency.
- Climate – cold engines run rich until warm; air conditioning also adds load.
- Fuel quality – ethanol blends have slightly lower energy content than pure gasoline.
So a single trip’s MPG can vary by 10–20% from your long-term average. Track it over several tanks for a reliable number.
Cost Per Mile vs. Total Cost
Cost per mile is useful for budgeting, but it only covers fuel. The full cost of driving includes:
- Depreciation (the biggest cost for most new cars)
- Insurance and registration
- Maintenance and tires
- Parking and tolls
According to general automotive estimates, the total cost per mile for a typical sedan is often 50–70 cents when all these are included, while fuel alone is usually 10–20 cents. For an electric vehicle, the “fuel� cost per mile is typically 3–6 cents, but the purchase price is higher. This calculator gives you the fuel-only number, which is the part you can directly compare between trips.
Common Mistakes and Unit Mix-Ups
Three frequent errors:
- Mixing US and imperial gallons – A US gallon is 3.785 liters; an imperial gallon is 4.546 liters. If you use Canadian or UK fuel data with US gallons, your MPG will be off by about 20%.
- Using liters per 100 km as if it were MPG – Lower is better in L/100km, higher is better in MPG. Never compare them directly.
- Rounding too early – If you round distance to the nearest 10 miles and fuel to the nearest gallon, small errors become large. Use exact odometer readings and the pump’s decimal gallons.
Also, the calculator assumes the fuel price is per gallon. If you enter price per liter, multiply by 3.785 to get per gallon first.
How to Improve Your Gas Mileage
Simple changes that have a measurable effect:
- Drive at a steady speed – use cruise control on highways.
- Accelerate gently and brake early.
- Remove unnecessary heavy items from the trunk.
- Keep tires at the pressure listed on the door sticker.
- Combine short trips – a cold engine uses more fuel per mile.
- Use the recommended grade of motor oil.
Aggressive driving can lower MPG by 15–30% at highway speeds, according to the U.S. Department of Energy. Smooth driving is the single biggest free improvement.
Frequently Asked Questions
What is a good MPG number?
For a modern gasoline car, 30 MPG or higher on the highway is good; 25 MPG combined is average for a sedan. SUVs and trucks often get 18–24 MPG. Hybrids can reach 40–50 MPG, and EVs don’t use MPG at all – they use miles per kWh.
How do I convert MPG to liters per 100 km?
Divide 235.2 by the MPG value. For example, 30 MPG = 235.2 ÷ 30 = 7.84 L/100km. The constant 235.2 comes from converting miles to km and gallons to liters.
Does the calculator work for diesel or hybrid cars?
Yes, as long as you enter the fuel consumed and distance. Diesel has more energy per gallon, so you’ll typically get better MPG than gasoline, but the formula is the same. For hybrids, the same method works, but you must fill the tank completely and measure over a long period to average out the electric-only driving.
Why is my car’s MPG lower than the sticker says?
Sticker values come from controlled lab tests. Real driving includes hills, wind, traffic, climate control, and your driving style. Also, the EPA’s test changed in 2008 to be more realistic, but most cars still fall short by 10–20% in real-world use.
What is the difference between MPG and miles per kWh?
MPG measures how far you go on a gallon of fuel. Miles per kWh measures how far an electric vehicle goes on a kilowatt-hour of battery energy. To compare, use the EPA’s “MPGeâ€� (miles per gallon equivalent), where 1 gallon of gasoline equals about 33.7 kWh. A typical EV gets 100–130 MPGe.
Related
Formula used
in d | Distance | miles | 300 | 0 in f | Fuel used | gallons | 12 | 0 in p | Fuel price | $/gallon | 3.50 | 0 out mpg | Fuel economy | MPG | d / f | 2 out cpm | Cost per mile | $/mile | p / (d / f) | 3
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.