Gas vs Electric Car Cost Calculator

Last Updated: July 23, 2026

Compare gas vs electric car running costs with this free calculator. See annual fuel savings, cost per mile for each car, percent cheaper, and EV payback years.

Gas car
Electric car
Show advanced options

Gas vs Electric Car Cost Formula

The calculator compares the running cost of a gasoline car and an electric car over the same distance. The annual fuel cost of the gas car is the fuel it burns times the price of gas:

C_gas = (D / FE) * P_gas

The annual energy cost of the electric car is the energy it draws from the grid times the price of electricity, where the battery energy is divided by the charging efficiency to account for charging losses:

C_ev = (D * e / n) * P_elec

The annual savings from driving the EV is the difference between the two, and the payback period converts an upfront price premium into years:

S = C_gas - C_ev
 Y = dP / S

Variables:

  • C_gas is the annual gasoline cost and C_ev is the annual electricity cost
  • D is the annual distance driven (miles or km); a per-month or per-week figure is multiplied by 12 or 52 first
  • FE is the gas car fuel economy in miles per gallon; L/100km and km/L inputs are converted to MPG (US)
  • P_gas is the gas price per gallon and P_elec is the electricity price per kWh
  • e is the EV energy use in kWh per mile, derived from the efficiency you enter
  • n is the charging efficiency as a decimal (90% = 0.90), which raises grid energy above battery energy
  • S is the annual savings, dP is the EV price premium, and Y is the payback period in years

The EV energy per mile e comes from whatever efficiency unit you choose. For mi/kWh it is 1 divided by the value; for kWh/100 mi it is the value divided by 100; for Wh/mi it is the value divided by 1000. The metric units km/kWh and kWh/100 km are converted using 1 mile = 1.60934 km.

Annual Fuel Cost: Gas vs Electric

This reference table shows the annual cost to run a 28 MPG gas car versus a 3.5 mi/kWh electric car over 12,000 miles per year, assuming 90% charging efficiency (about 3,810 kWh from the grid and roughly 429 gallons of gas). Costs scale directly with your local prices.

Gas priceElectricity priceGas car / yearElectric car / yearAnnual savings
$3.00/gal$0.13/kWh$1,286$495$790
$3.50/gal$0.17/kWh$1,500$648$852
$4.00/gal$0.20/kWh$1,714$762$952
$4.50/gal$0.25/kWh$1,929$952$976
$5.00/gal$0.30/kWh$2,143$1,143$1,000

At typical US prices the electric car runs for roughly a third to a half of the gas car’s fuel cost, but the gap narrows when electricity is expensive and gas is cheap. Always plug in your own local rates.

Example Problems

Example 1: Annual savings.

You drive 12,000 miles a year. Your gas car gets 28 MPG and gas is $3.50 per gallon. Your EV does 3.5 mi/kWh, electricity is $0.17 per kWh, and charging is 90% efficient.

Gas cost = (12,000 / 28) * $3.50 = 428.6 gallons * $3.50 = $1,500 per year. EV cost = (12,000 * (1/3.5) / 0.90) * $0.17 = 3,810 kWh * $0.17 = $648 per year. Savings = $1,500 – $648 = $852 per year, so the EV is about 57% cheaper to run, at $0.125 per mile for gas versus $0.054 per mile for electric.

Example 2: Payback period.

You drive 15,000 miles a year. The gas car gets 25 MPG at $3.80 per gallon; the EV does 3.0 mi/kWh at $0.15 per kWh with 90% charging. The EV cost $7,000 more to buy than the comparable gas car.

Gas cost = (15,000 / 25) * $3.80 = $2,280. EV cost = (15,000 * (1/3.0) / 0.90) * $0.15 = 5,556 kWh * $0.15 = $833. Savings = $2,280 – $833 = $1,447 per year. Payback = $7,000 / $1,447 = about 4.8 years to recover the EV price premium from fuel savings alone.

Frequently Asked Questions

Is it cheaper to charge an EV or buy gas?

In most of the United States it is cheaper to charge an electric car than to buy gasoline for an equivalent trip, often by half or more, because an EV converts cheap grid electricity to motion very efficiently. The advantage shrinks where electricity is expensive or gas is unusually cheap, and public DC fast charging can cost several times more than home charging. Enter your real home and gas prices to see the true gap for your situation.

How do I calculate cost per mile for each car?

For the gas car, divide the gas price by the fuel economy: at $3.50 per gallon and 28 MPG the cost is $3.50 / 28 = $0.125 per mile. For the electric car, multiply the energy used per mile by the electricity price and divide by charging efficiency: at 3.5 mi/kWh and $0.17 per kWh with 90% charging, that is (1/3.5) * $0.17 / 0.90 = $0.054 per mile. The calculator does both conversions automatically and also reports cost per 100 miles.

What electricity price should I use?

Use the marginal rate you actually pay per kWh at home, including delivery and taxes, since that is what each charge costs you. Many EV owners charge overnight on a lower off-peak or time-of-use rate, which can be well below the average residential price, so check your utility bill or plan. If you rely on public fast charging, use that network’s per-kWh price instead, as it is usually higher than home electricity.

Gas vs Electric Car Cost Calculator