Fuel cost calculator
Distance, mileage and price in; the trip’s gas cost out.
Your files stay on your device
This tool runs entirely in your browser. What you paste is processed on your device and is never sent to a server, so it is safe to use with tokens, keys and unpublished text.
Example
Road trip gas cost: 475 miles each way at 32 mpg, split three ways
Three friends drive 475 miles to a wedding and back. Settings: Distance 475, in Miles; Fuel economy 32, in “Automatic (mpg, US gallons)”; Fuel price 3.29 a gallon; Round trip ticked; 3 people sharing; Tolls and parking 18.40.
- Round trip doubles the distance to 950 miles. Gallons = 950 ÷ 32 = 29.69.
- Fuel = 29.69 gal × $3.29 = $97.67; tolls and parking add $18.40, so the trip costs $116.07.
- Divided by 3, each person pays $38.69. Everything included, the trip costs $0.12 a mile.
| Car | Fuel economy | Fuel or energy | Trip cost | Each of 3 |
|---|---|---|---|---|
| Compact sedan | 32 mpg | 29.69 gal | $116.07 | $38.69 |
| SUV | 22 mpg | 43.18 gal | $160.47 | $53.49 |
| Hybrid | 45 mpg | 21.11 gal | $87.86 | $29.29 |
| Electric car, $0.16 a kWh | 18 kWh/100 km | 275.2 kWh | $62.43 | $20.81 |
The trip costs $116.07, or $38.69 each. Taking a 22 mpg SUV instead would add $44.40, so it is worth comparing cars before comparing gas prices.
How it works
- Type the distance and your car’s fuel economy — mpg, or litres per 100 km, or kWh per 100 km for an electric car.
- Type the price per gallon (or litre, or kWh), and tick round trip if you are coming back.
- Add tolls and parking and the number of people, and the cost appears with each person’s share.
Frequently asked questions
- How is the fuel cost worked out?
- Gallons = miles ÷ mpg, and the cost is gallons × the price. 300 miles at 28 mpg is 10.71 gallons; at $3.45 a gallon that is $36.96.
- What if my car is rated in litres per 100 km?
- Choose litres per 100 km or kilometres per litre, the distance in kilometres, and the price per litre: the calculator converts nothing you have not chosen.
- Does it work for an electric car?
- Yes: choose kWh per 100 km and type the price per kWh you pay for charging.
- How is the cost shared?
- The total — fuel plus tolls and parking — is divided equally between the people you enter.
- My electric car shows miles per kWh. What do I enter?
- Choose “Miles per kWh (electric car)” and type the figure as it is, with the price per kWh. For 950 miles at 3.5 mi/kWh and $0.16 a kWh, the car uses 271.43 kWh and charging costs $43.43.
- Does it work with UK mpg and prices per litre?
- Yes. Choose “Miles per imperial gallon” and the pound, and type the pump price per litre as it is: the calculator converts the gallons to litres. 200 miles at 45 mpg uses 20.2 litres; at £1.45 a litre that costs £29.30.
- Is anything uploaded?
- No. It is worked out in your browser, and nothing you type leaves your computer.