Whether you are budgeting a road trip, comparing a commute with the train or splitting gas money with a friend, the fuel bill follows from three numbers: how far you drive, how efficient the car is, and what a gallon (or litre) costs. This fuel cost calculator combines them into the fuel used, the total cost and the cost per mile or kilometre, in US or metric units.
How to use the fuel cost calculator
- Enter the distance and pick miles or kilometres.
- Choose how your fuel economy is stated — US mpg, L/100 km or km/L — and type the figure. If it is in another unit, convert it first with the fuel economy converter.
- Enter the fuel price and whether it is per US gallon or per litre.
The fuel used can be shown in gallons or litres with the menu beside the result. Trips with tolls, hotels or several vehicles are easier in the trip cost calculator.
Fuel cost formula
Fuel cost = fuel used × price per gallon
Cost per mile = price per gallon ÷ mpg
With metric figures the same logic holds: fuel (L) = distance (km) × L/100 km ÷ 100, then multiply by the price per litre. Internally the calculator converts everything to litres and kilometres using the exact definitions 1 US gallon = 3.785411784 L and 1 mile = 1.609344 km, so the answer is the same whichever units you pick.
Worked example: a 300-mile drive
You drive 300 miles in a car rated at 30 mpg. Gas costs $3.50 per gallon.
- Fuel used: 300 ÷ 30 = 10 gallons.
- Cost: 10 × $3.50 = $35.00.
- Cost per mile: $35.00 ÷ 300 = $0.117, or about 11.7 cents.
In metric terms the same drive is 482.8 km, and the car uses 7.84 L/100 km, or 37.9 litres in total.
Cost of 100 miles at different prices
The table is computed as 100 ÷ mpg × price. It shows how much both factors matter: moving from 20 to 40 mpg halves the bill, and a dollar swing in the pump price is worth as much as a big change in the car.
| Fuel economy | Gas at $3.00/gal | Gas at $3.50/gal | Gas at $4.00/gal |
|---|---|---|---|
| 20 mpg | $15.00 | $17.50 | $20.00 |
| 25 mpg | $12.00 | $14.00 | $16.00 |
| 30 mpg | $10.00 | $11.67 | $13.33 |
| 40 mpg | $7.50 | $8.75 | $10.00 |
| 50 mpg | $6.00 | $7.00 | $8.00 |
Getting a realistic estimate
The EPA label figure is a standardized lab result. Highway speed above about 60 mph, cold weather, short trips, roof boxes, heavy loads, under-inflated tires and aggressive acceleration all lower real economy, often by 10–30%. If you want an accurate budget, use the figure from your own recent fill-ups instead of the sticker value. When a trip crosses regions, fuel prices can vary by a dollar a gallon or more, so look at prices along the route rather than only at home.
Also remember that fuel is only part of the cost of a mile. Depreciation, insurance, maintenance and tires frequently cost as much per mile as the gas itself. The fuel figure here is best used for comparing routes, vehicles and trips, not as the full cost of driving.
Sources
Unit definitions from NIST Special Publication 811. Fuel economy labelling and the factors that reduce real-world mpg are described by the US EPA and DOE at fueleconomy.gov.
Frequently asked questions
How do I calculate the cost of gas for a trip?
Divide the distance by your miles per gallon to get gallons used, then multiply by the price per gallon. For 300 miles at 30 mpg and $3.50 that is 10 gallons × $3.50 = $35.
How do I find my car’s real fuel economy?
Fill the tank, reset the trip meter, drive normally, then refill and divide the miles driven by the gallons added. Repeat over a few tanks. The MPG calculator on this site does the division for you.
Does the calculator include round trips?
Only the distance you enter, so double it for a round trip. For tolls, parking and meals use the trip cost calculator.
What is a typical cost per mile for gas?
At 25 mpg and $3.50 per gallon the fuel alone costs 14 cents per mile. Maintenance, tires, insurance and depreciation add much more to the true cost of driving.
Can I use litres and kilometres?
Yes. Switch the distance menu to km, choose L/100 km or km/L for the fuel economy, and set the price to “per litre”.