What this fuel cost calculator does
Enter distance, consumption and fuel price: the calculator shows how much fuel the trip needs, what it costs and what each person pays. 300 km at 6.5 L/100 km and 1.80 per liter cost 35.10, a return trip 70.20. It splits tolls and parking as well, works with miles and mpg, and has an electric-car mode based on kWh. Everything runs locally in your browser.
How do I calculate the fuel cost of a trip?
Liters = distance in km ÷ 100 × consumption in L/100 km, then liters × price per liter. With miles and mpg it is even shorter: gallons = miles ÷ mpg, then gallons × price per gallon (for a UK price per liter, one imperial gallon is 4.54609 liters). Enter the one-way distance; the “Return trip” box doubles it. Your trip computer shows the consumption, or you work it out from fill-ups: liters added divided by kilometers driven, times 100 (for mpg: miles driven divided by gallons added). This is what 100 miles cost at 3.50 per US gallon:
| Consumption | Gallons per 100 miles | Cost per 100 miles |
|---|---|---|
| 20 mpg | 5.00 gal | 17.50 |
| 25 mpg | 4.00 gal | 14.00 |
| 30 mpg | 3.33 gal | 11.67 |
| 40 mpg | 2.50 gal | 8.75 |
How do I split the cost between passengers?
Enter how many people share the trip and, if needed, tolls and parking for the whole journey. The calculator rounds the total to the cent and gives any leftover cents to the first people, one each: 35.10 split four ways is 8.78 twice and 8.77 twice, which adds up to exactly 35.10 again. You can share the result as a link, so everyone sees the same numbers.
How does the calculator convert mpg and gallons?
Besides L/100 km it understands km/L and mpg based on either the US or the imperial (UK) gallon. The conversion rests on exact definitions: one mile is 1.609344 km, a US gallon is 3.785411784 liters (NIST Handbook 44, Appendix C) and an imperial gallon is 4.54609 liters (UK Weights and Measures Act 1985). That gives L/100 km = 235.215 ÷ mpg (US) or 282.481 ÷ mpg (UK). Picking mpg (US) switches the price to the US gallon. With mpg (UK) it stays per liter, because UK pumps show pence per liter: enter 142.9p as £1.429.
| mpg | L/100 km with US gallons | L/100 km with imperial gallons |
|---|---|---|
| 20 | 11.76 | 14.12 |
| 30 | 7.84 | 9.42 |
| 40 | 5.88 | 7.06 |
| 50 | 4.70 | 5.65 |
What does the trip cost in an electric car?
Energy = distance ÷ 100 × consumption in kWh/100 km, then times the price per kWh. 300 km at 18 kWh/100 km need 54 kWh. The preset 37 cents per kWh is the German household average from the BDEW electricity price analysis of April 2026, which makes 19.98 euros; at a public charger, enter its price. Add charging losses as a percentage surcharge if your consumption figure only counts what leaves the battery; the size is your assumption.
How much CO₂ does the trip produce?
For gasoline and diesel the calculator estimates the tailpipe CO₂ with the factors of the US Environmental Protection Agency: 8,887 g of CO₂ per gallon of gasoline and 10,180 g per gallon of diesel. The 19.5 liters of gasoline from the 300 km example come to about 45.8 kg. Extraction, refining and transport of the fuel are not included, and for European blends such as E10 the figure is an approximation.
What the calculator deliberately leaves out
- A live fuel price. That would need a server querying a price service. The preset 1.80 is a worked example, not an average.
- Wear, insurance and depreciation. Only fuel or electricity and the extra costs you enter are counted.
- Changing consumption. The maths use one fixed average.
Privacy
Your entries never leave your device; data is stored only locally. The address bar carries the numbers so you can send the calculation to your passengers as a link.