EV Charging Cost Calculator Formula

Understand the math behind the ev charging cost calculator. Each variable explained with a worked example.

Formulas Used

Charging Cost

charge_cost = kwh_to_add * electricity_rate

Energy Added

kwh_added = kwh_to_add

Est. Cost per Mile (at 3.5 mi/kWh)

cost_per_mile = electricity_rate / 3.5

Variables

VariableDescriptionDefault
battery_kwhBattery Capacity(kWh)75
current_charge_pctCurrent Charge Level(%)20
target_charge_pctTarget Charge Level(%)80
electricity_rateElectricity Rate(USD/kWh)0.13
kwh_to_addDerived value= battery_kwh * (target_charge_pct - current_charge_pct) / 100calculated

How It Works

EV Charging Costs

Electric vehicles are typically much cheaper to fuel than gasoline cars, especially when charging at home with off-peak rates.

Formula

Energy to Add (kWh) = Battery Size x (Target % - Current %) / 100

Cost = Energy to Add x Electricity Rate

Home charging at $0.13/kWh costs roughly $0.037 per mile (at 3.5 miles/kWh), compared to $0.125/mile for a 28 MPG gas car at $3.50/gallon.

Worked Example

Charging a 75 kWh battery from 20% to 80% at $0.13/kWh.

battery_kwh = 75current_charge_pct = 20target_charge_pct = 80electricity_rate = 0.13
  1. 01Energy to add = 75 x (80 - 20) / 100 = 45 kWh
  2. 02Cost = 45 x $0.13 = $5.85
  3. 03Cost per mile = $0.13 / 3.5 = $0.037/mile

Ready to run the numbers?

Open EV Charging Cost Calculator