Road Trip Cost Estimator Formula
Understand the math behind the road trip cost estimator. Each variable explained with a worked example.
Formulas Used
Total Fuel Cost
total_fuel_cost = gallons_needed * gas_priceCost per Person
cost_per_person = gallons_needed * gas_price / passengersGallons of Fuel
gallons_used = gallons_neededFuel Cost per Mile
cost_per_mile = gas_price / mpgVariables
| Variable | Description | Default |
|---|---|---|
distance_miles | Trip Distance(miles) | 500 |
mpg | Vehicle MPG(mpg) | 28 |
gas_price | Gas Price(USD/gal) | 3.5 |
passengers | Number of Passengers | 2 |
gallons_needed | Derived value= distance_miles / mpg | calculated |
How It Works
Road Trip Fuel Cost
Knowing your fuel costs in advance helps budget for road trips and compare driving vs flying.
Formula
Gallons Needed = Distance / MPG
Total Cost = Gallons x Gas Price
Cost per Person = Total Cost / Passengers
Road trips become more cost-effective with more passengers. A 500-mile trip at 28 MPG and $3.50/gallon costs about $62.50 total, or just $31.25 split two ways.
Worked Example
A 500-mile trip in a 28 MPG car at $3.50/gallon with 2 passengers.
distance_miles = 500mpg = 28gas_price = 3.5passengers = 2
- 01Gallons = 500 / 28 = 17.86 gallons
- 02Total cost = 17.86 x $3.50 = $62.50
- 03Per person = $62.50 / 2 = $31.25
- 04Cost per mile = $3.50 / 28 = $0.125/mile
Ready to run the numbers?
Open Road Trip Cost Estimator