Fuel Cost Calculator
Estimate trip fuel consumption and cost from distance, fuel efficiency (mpg, km/L, or L/100km), and fuel price.
How It's Calculated
Formula
\text{litersUsed} = \begin{cases} \dfrac{\text{miles}}{\text{mpg}} \times 3.785411784 & \text{mpg mode} \\ \dfrac{\text{km}}{\text{km/L}} & \text{km/L mode} \\ \text{km} \times \dfrac{\text{L/100km}}{100} & \text{L/100km mode} \end{cases}Fuel Cost estimates how much fuel a trip needs and what it will cost, from a distance, a fuel efficiency figure, and a fuel price. Distance and efficiency can be entered in US terms (miles, mpg) or metric terms (kilometers, km/L, or L/100km). Internally, distance is normalized to both miles and kilometers using the exact factor 1 mile = 1.609344 km, and fuel used is normalized to liters: for mpg mode, gallons used = miles / mpg, then liters = gallons x 3.785411784 (the exact liters-per-US-gallon factor); for km/L mode, liters used = km / (km/L); for L/100km mode, liters used = km x (L/100km) / 100. Cost is fuel used (gallons for mpg mode, liters for the metric modes) multiplied by the entered fuel price, computed with decimal.js to avoid floating-point rounding error in the currency result. This is an estimate only — actual fuel consumption varies with driving style, vehicle condition, terrain, and weather.
Worked Examples
100 miles at 25 mpg, $3.50/gallon
- Gallons used: 100 / 25 = 4 gallons.
- Liters used: 4 x 3.785411784 = 15.141647 L.
- Cost: 4 x $3.50 = $14.00.
100 km at 8 L/100km, $1.50/liter
- Liters used: 100 x 8 / 100 = 8 L.
- Cost: 8 x $1.50 = $12.00.
Frequently Asked Questions
Is this an exact prediction of how much fuel I'll use?
No. This is an estimate based on the fuel efficiency figure you enter. Actual fuel use varies with driving style, traffic, terrain, weather, and vehicle condition.
What fuel price unit should I enter?
For MPG mode, enter the price per US gallon. For km/L and L/100km modes, enter the price per liter — the calculator matches the cost calculation to the volume unit implied by your selected efficiency mode.
Why does the calculator normalize everything to liters?
Normalizing to one common volume unit (liters) lets the same underlying calculation handle mpg, km/L, and L/100km consistently, and lets it report fuel required in both liters and US gallons regardless of which mode you used.
Does this account for fuel taxes or price changes over the trip?
No. This calculator uses a single fuel price you provide and does not fetch live fuel prices or apply regional tax logic.