Fuel Efficiency Calculator Formula

Understand the math behind the fuel efficiency calculator. Each variable explained with a worked example.

Formulas Used

Vehicle A Annual Fuel

annual_cost_a = cost_a

Vehicle B Annual Fuel

annual_cost_b = cost_b

Annual Savings (B vs A)

annual_savings = cost_a - cost_b

5-Year Savings

five_year_savings = (cost_a - cost_b) * 5

Variables

VariableDescriptionDefault
annual_milesAnnual Miles Driven(miles)12000
gas_priceGas Price(USD/gal)3.5
mpg_aVehicle A MPG(MPG)25
mpg_bVehicle B MPG(MPG)35
cost_aDerived value= annual_miles / mpg_a * gas_pricecalculated
cost_bDerived value= annual_miles / mpg_b * gas_pricecalculated

How It Works

How to Compare Fuel Efficiency

Calculate each vehicle's annual fuel cost and find the difference.

Formula

Annual Fuel Cost = Annual Miles / MPG x Gas Price

Savings = Cost A - Cost B

Worked Example

12,000 miles/year at $3.50/gal: Vehicle A gets 25 MPG, Vehicle B gets 35 MPG.

annual_miles = 12000gas_price = 3.5mpg_a = 25mpg_b = 35
  1. 01Vehicle A cost = 12,000 / 25 x $3.50 = $1,680
  2. 02Vehicle B cost = 12,000 / 35 x $3.50 = $1,200
  3. 03Annual savings = $1,680 - $1,200 = $480
  4. 045-year savings = $480 x 5 = $2,400

Ready to run the numbers?

Open Fuel Efficiency Calculator