About this calculator
The formula, a worked example, where to find your numbers, and what is not included.
How it's calculated
Fuel needed = distance ÷ fuel economy in MPG, in gallons; or distance × fuel economy in L/100 km ÷ 100, in liters. Cost = fuel needed × the price per gallon or liter.
A round trip doubles the distance first. Cost per mile or km = cost ÷ total distance. Cost per person = cost ÷ people, rounded to the cent, so the shares may not add up exactly to the total. Fuel is also shown in the other unit: 1 US gallon = 3.785411784 liters, exactly.
Example: 300 miles at 25 MPG needs 300 ÷ 25 = 12.00 gallons (45.42 liters). At $3.00 a gallon, that costs 12 × $3.00 = $36.00. In metric, 500 km at 7.5 L/100 km needs 500 × 7.5 ÷ 100 = 37.50 liters, which costs 67.50 at 1.80 a liter.
Finding your numbers
Fuel economy: your vehicle's EPA rating at fueleconomy.gov, or your own average from the trip computer. Use the highway figure for long drives and the combined figure for mixed driving.
Fuel price: the pump price where you'll fill up. For a US average, see EIA's weekly Gasoline and Diesel Fuel Update. The calculator never fills in a price, because prices change every week.
Distance: the driving distance from a map app or odometer, not the straight-line distance.
What's not included
Real fuel economy changes with speed, load, air conditioning, idling, hills, weather and city traffic, so treat the result as an estimate. It covers fuel only: tolls, parking, maintenance and wear are not included.
Sources
- National Institute of Standards and Technology (NIST), Handbook 44, Appendix C: General Tables of Units of Measurement (2026 edition): 1 US gallon = 231 cubic inches = 3.785411784 liters, exact. Accessed December 3, 2026.
- U.S. Energy Information Administration, Gasoline and Diesel Fuel Update: average US retail fuel prices, updated weekly. Accessed December 3, 2026.
- U.S. Department of Energy and U.S. Environmental Protection Agency, fueleconomy.gov: official fuel economy ratings for vehicles. Accessed December 3, 2026.