What this calculator does
Find out how much you'd save, or spend, each year by driving an electric car instead of a gas car. The calculator compares the cost of driving the same miles in each one. For the gas car, it works out the gallons you'd burn and what they cost. For the electric car, it works out the kilowatt-hours (kWh, the unit on your power bill) you'd use. It prices them at your mix of home and public charging. The difference is your yearly savings, or extra cost, from going electric.
Gas and electricity prices vary a lot from place to place and month to month. So every price here is something you enter. You can also add yearly maintenance for each car. And you can add how much more the electric model costs to buy. Then you'll see how many years of savings it takes to earn that back.
Where it's used
Why this math matters outside the classroom:
- Car shopping. A commuter driving 12,000 miles finds 400 gallons at $3.20 costs $1,280, against $712.80 to charge an electric car.
- Unit rates. Students compare 10.7 cents a mile for gas with 5.9 cents a mile for electricity as two unit rates.
- Charging plans. An owner sees that moving from 10% to 50% public charging raises the yearly charging bill sharply.
- Fleet decisions. A delivery business compares running costs per van before replacing gas vans with electric ones.
- Payback estimates. A buyer divides a $4,000 price difference by $567.20 of yearly savings to get a payback of about 7.1 years.
Grade level and standards: Grades 6–7; Common Core State Standards for Mathematics 6.RP.A.3.b, 7.RP.A.3. © Copyright 2010. National Governors Association Center for Best Practices and Council of Chief State School Officers. All rights reserved.
How to use it
- Enter how many miles you drive a year, the gas car's mpg (miles per gallon) and the gas price.
- Enter the electric car's efficiency and your home electricity price. Then enter the share of charging done at public chargers and their price.
- If you like, add yearly maintenance for each car and the electric car's extra price.
- Read the yearly savings, the cost per mile of each car and the payback time.
What the inputs mean
- Electric car efficiency
- Lower kWh per 100 miles is better. Window-sticker figures are measured from the wall outlet. So they already include the energy lost while charging.
- Home electricity price
- Your total price per kWh, including delivery charges and taxes. To find it, divide your bill's total by the kWh used. Time-of-use plans may offer a lower overnight rate.
- Charging done at public chargers
- The share of your charging energy that comes from public chargers. Fast chargers usually cost several times more per kWh than charging at home.
- Gas car maintenance
- Optional. Oil changes and other upkeep you expect.
- Electric car maintenance
- Optional.
- Extra price of the electric car
- The electric car's price minus the gas car's, after any incentives you actually receive.
Formula and method
gallons = miles ÷ mpg; gas cost = gallons × gas price kWh = miles × kWh per 100 mi ÷ 100 (or miles ÷ miles per kWh) price per kWh = (1 − public share) × home price + public share × public price charging cost = kWh × price per kWh yearly savings = (gas cost + gas maintenance) − (charging cost + EV maintenance) payback = extra price ÷ yearly savings
In the formulas, mpg is the gas car's miles per gallon and kWh is kilowatt-hours of electricity. EV means the electric car. Public share is the fraction of charging done at public chargers, and payback is in years.
Both cars drive the same miles. Fuel economy turns miles into gallons, and efficiency turns miles into kilowatt-hours. Each is then multiplied by its price.
Mixing home and public charging gives a weighted average price. For example, if 10% of your energy comes from public chargers, 10% of each kWh is priced at the public rate.
The break-even gas price is the gas price that would make both cars cost exactly the same to run. Everything else stays as you entered it.
Worked example
You drive 12,000 miles a year. The gas car gets 30 mpg, with gas at $3.20. The electric car uses 30 kWh per 100 miles. Home power costs $0.17 per kWh, and 10% of charging is public at $0.45. Compare over 5 years.
- Gas: 12,000 ÷ 30 = 400 gallons × $3.20 = $1,280.00 a year.
- Electricity: 12,000 × 30 ÷ 100 = 3,600 kWh.
- Average price: 90% × $0.17 + 10% × $0.45 = $0.198 per kWh.
- Charging: 3,600 × $0.198 = $712.80 a year.
- Savings: $1,280.00 − $712.80 = $567.20 a year, or $2,836.00 over 5 years.
Result: At these prices, the electric car saves $567.20 a year in energy. That's about 5.9 cents a mile, against 10.7 cents for gas. Gas would have to fall to about $1.78 a gallon for the two to cost the same.
Understanding the result
A positive result means the electric car is cheaper to run; a negative one means the gas car is. The cost per mile makes it easy to compare against other cars.
Where and how you charge matters as much as the car. Charging mostly at home on a low rate gives the biggest savings. Relying on fast chargers can wipe them out.
Payback only covers running costs. Insurance, registration, resale value and financing can differ between the two cars. They're worth checking separately.
Assumptions and limitations
- Both cars drive the same miles each year, and prices stay the same over the years compared.
- Efficiency figures already include charging losses, as wall-to-wheels ratings do.
- Maintenance is whatever yearly amounts you enter; none is assumed.
- Cold weather, highway speeds and heavy loads can raise both cars' energy use above their ratings.
- Purchase incentives, tax credits and charger installation costs aren't included, unless you fold them into the extra price.
- No one knows future gas and electricity prices. Try several to see how much the savings change.
Frequently asked questions
Where do I find my car's kWh per 100 miles?
It's printed on the window sticker and listed in official fuel-economy ratings. If your car shows miles per kWh instead, switch the unit. 3.3 miles per kWh is about the same as 30 kWh per 100 miles.
Why does public charging matter so much?
Public fast charging often costs two to three times typical home rates, or more. At $0.45 per kWh instead of $0.17, the electric car in the example would cost $1,620 a year to charge. That's more than the gas car.
Should I include maintenance?
If you have estimates, yes. Electric cars need no oil changes and wear their brakes less, but tires and other parts still need attention. Enter your own figures for each car rather than relying on averages.
How is the payback time worked out?
It divides the electric car's extra purchase price by the yearly savings. With a $4,000 difference and $567.20 saved a year, it would take just over 7 years. Payback ignores price changes and the time value of money (the idea that a dollar today is worth more than a dollar later).
How this calculator is checked
Method: Unit-rate energy cost comparison: miles ÷ mpg × gas price against miles × kWh per mile × blended electricity price, plus optional maintenance. The calculation is covered by automated tests with known reference values and edge cases. Last updated 2026-10-18. Found a problem? Tell us.
Embed this calculator
Put this EV vs Gas Cost Calculator on your own website or blog for free. Paste this code where you want it to appear: