How to use the gas cost calculator
- Enter the trip distance and choose miles or kilometers, then one-way or round trip.
- Enter your vehicle’s fuel efficiency in the unit you know: US MPG, UK MPG, L/100 km or km/L.
- Enter the fuel price and its unit. The default price is only an example.
- Optionally split the cost between several people.
How the calculation works
Fuel used is distance divided by fuel economy (or distance × L/100 km ÷ 100). Cost is fuel used multiplied by the price per unit of fuel. All units are converted internally using exact factors: 1 mile = 1.609344 km, 1 US gallon = 3.785411784 L and 1 UK gallon = 4.54609 L.
Formula
Worked examples
250 miles at 28 MPG and $3.40 per gallon
Fuel = 250 ÷ 28 = 8.93 gallons. Cost = 8.93 × 3.40 = $30.36 one way, $60.71 round trip.
400 km at 6.5 L/100 km and 1.80 per liter
Fuel = 400 × 6.5 ÷ 100 = 26 L. Cost = 26 × 1.80 = 46.80.
Assumptions and limitations
- Real fuel economy varies with speed, traffic, terrain, load, weather and air conditioning use. Highway and city figures can differ substantially.
- Tolls, parking, vehicle wear and charging costs for electric vehicles are not included.
- The currency symbol is shown as $, but the math works for any currency.
Frequently asked questions
How do I calculate gas cost for a trip?
Divide the distance by your MPG to get gallons, then multiply by the price per gallon.
How do I convert MPG to L/100 km?
L/100 km = 235.215 ÷ US MPG. For example, 30 MPG ≈ 7.84 L/100 km.
How do I find my car’s real fuel economy?
Fill the tank, reset the trip meter, drive normally, then refill. Divide the miles driven by the gallons needed to refill (or the liters by the kilometers × 100 for L/100 km). Averaging a few tanks gives a more realistic figure than the official rating.
What is the difference between US and UK MPG?
A UK (imperial) gallon is about 20% larger than a US gallon, so the same car shows a higher MPG figure in UK gallons.
Sources and references
- NIST Special Publication 811, Guide for the Use of the International System of Units (SI).
- UK Weights and Measures Act 1985 (imperial gallon = 4.54609 litres).