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_price

Cost per Person

cost_per_person = gallons_needed * gas_price / passengers

Gallons of Fuel

gallons_used = gallons_needed

Fuel Cost per Mile

cost_per_mile = gas_price / mpg

Variables

VariableDescriptionDefault
distance_milesTrip Distance(miles)500
mpgVehicle MPG(mpg)28
gas_priceGas Price(USD/gal)3.5
passengersNumber of Passengers2
gallons_neededDerived value= distance_miles / mpgcalculated

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
  1. 01Gallons = 500 / 28 = 17.86 gallons
  2. 02Total cost = 17.86 x $3.50 = $62.50
  3. 03Per person = $62.50 / 2 = $31.25
  4. 04Cost per mile = $3.50 / 28 = $0.125/mile

Ready to run the numbers?

Open Road Trip Cost Estimator