calculate-loan

01 Loan payments

Gas vs Electric Car Cost Calculator: Compare Ownership

Calculator No. 01-8468 · Updated · Formula and assumptions shown below

The calculator on this page is switched off while it is checked. The formula is below, and the worked example shows how to do the sum by hand.

Estimate for education, not financial advice. The result follows from the numbers you enter and the formula shown. It is not a quote or an offer, and it does not include fees, taxes or insurance unless the calculator asks for them. Ask your lender for the exact figures.

This gas vs. electric car cost calculator estimates the energy cost per mile and over your chosen ownership distance for each vehicle. Enter each car’s efficiency, local fuel or electricity price, and miles driven; it returns comparable energy totals and the difference, before purchase price, maintenance, insurance, or other costs.

Formula

For either vehicle, energy cost equals distance divided by efficiency, multiplied by the price of the energy unit:

  • Gas cost = miles × gas price per gallon ÷ gas miles per gallon.
  • Electricity cost = miles × electricity price per kilowatt-hour ÷ electric miles per kilowatt-hour.
  • Difference = electric cost − gas cost. A negative result means the electric car’s modeled energy cost is lower; a positive result means it is higher.

Variables: miles is the distance driven in miles; gmpg is the gas car’s fuel economy in miles per gallon; gprice is the gas price in dollars per gallon; empkwh is the electric car’s efficiency in miles per kilowatt-hour; and eprice is the electricity price in dollars per kilowatt-hour. The per-mile outputs divide each energy price by the corresponding efficiency.

Worked Example

Using the calculator’s defaults—12,000 miles, 30 mpg, $3.50 per gallon, 3.5 miles per kWh, and $0.16 per kWh:

  1. Gas cost per mile = $3.50 ÷ 30 = $0.1167 per mile, rounded to four decimal places.
  2. Electricity cost per mile = $0.16 ÷ 3.5 = $0.0457 per mile, rounded to four decimal places.
  3. Gas energy cost = 12,000 × $3.50 ÷ 30 = $1,400.00.
  4. Electricity energy cost = 12,000 × $0.16 ÷ 3.5 = $548.57.
  5. Difference = $548.57 − $1,400.00 = −$851.43. The electric car’s modeled energy cost is $851.43 lower for this distance.

Assumptions

  • Efficiency and prices remain constant throughout the selected distance.
  • The gas vehicle’s stated mpg and the electric vehicle’s miles per kWh represent the driving being compared.
  • Electricity price is the effective price per kWh for charging; charging losses and separate public-charging fees are not added.
  • The estimate includes only gasoline or electricity. It excludes vehicle purchase price, financing, depreciation, maintenance, repairs, insurance, registration, taxes, and charging equipment.

How to Use the Comparison

Use figures that fit the vehicles and conditions you are actually considering. A vehicle’s advertised efficiency is a reference, not a promise for every trip. Cold weather, high speeds, hills, heavy loads, short journeys, and air conditioning or heating can change real-world efficiency. If you have records from similar driving, using your observed average may make the estimate more relevant.

  • Gas price: enter a price per gallon, not per litre. If you track fuel in another unit, convert it before entering it.
  • Electricity price: use dollars per kWh. A home bill may have a tiered or time-based price; a public charger may charge differently. Use a reasonable blended price for the charging you expect.
  • Efficiency: enter miles per gallon and miles per kWh, not gallons per 100 miles or kWh per 100 miles. Convert those measures first if necessary.
  • Distance: choose the same total miles for both cars. For an annual comparison, enter annual mileage; for an ownership-period estimate, enter the total expected miles over that period.

The difference is an energy-only comparison, not a complete ownership-cost verdict. To estimate total cost, separately account for the vehicles’ purchase prices and resale values, financing, insurance, maintenance, repairs, and any charging equipment or installation. Those amounts vary by vehicle, location, usage, and time, so they are not assumed here.

What Can Change the Result?

Charging location is a major source of variation. Home charging can use a household electricity rate, while public charging may have a different price structure. If you charge partly at home and partly away, calculate a weighted average: multiply the share of energy from each source by its price, then add the results. Do not confuse the electricity supply price with a charger’s displayed session total if the latter includes fees.

Electric-car efficiency is commonly expressed in miles per kWh, but some information sources use kWh per 100 miles. These measures run in opposite directions: lower kWh per 100 miles means higher efficiency. Convert before entering values. For example, a vehicle using 30 kWh per 100 miles travels about 3.33 miles per kWh (100 ÷ 30), not 30 miles per kWh.

Likewise, mpg figures are not linear measures of fuel savings. Moving from 20 to 30 mpg does not cut fuel use by one-third for every distance; fuel consumed is distance divided by mpg. This calculator uses that relationship directly. It also does not account for hybrid vehicles, which use both fuel and electricity; those require a separate model that includes both energy sources.

Limits and Common Mistakes

This simple calculation assumes a constant rate of energy use and a constant energy price. It does not forecast future prices, account for changing routes, or model battery degradation. The outputs are rounded for display, so tiny differences can be affected by rounding; the underlying formulas use the entered values.

  • Do not compare different distances or different time periods.
  • Check that fuel and electricity prices match the units shown.
  • Do not treat energy savings as total savings: upfront price differences and non-energy costs are outside this calculation.
  • For a household with solar panels, consider the relevant cost or value of electricity used for charging rather than assuming every kWh is free.

Frequently Asked Questions

Is an electric car cheaper to run than a gas car?
It can have a lower energy cost per mile when electricity cost per mile is below gasoline cost per mile. The result depends on each vehicle’s efficiency and the actual local energy prices. This calculator compares energy only, not total ownership costs.

How do I compare miles per gallon with miles per kWh?
Calculate each energy cost per mile separately: gas price divided by mpg, and electricity price divided by miles per kWh. The two cost-per-mile figures can then be compared directly.

Should I include charging losses?
The calculator uses the vehicle’s entered miles-per-kWh figure as given and does not separately add charging losses. If your efficiency figure measures energy drawn from the wall, those losses may already be reflected; check how the figure was measured to avoid counting them twice.

Can I use this calculator for a hybrid?
Not directly. A hybrid uses both gasoline and electricity, so a useful estimate needs its fuel consumption, electricity use, and the share of driving powered by each source.

Does this show which car costs less overall?
No. It shows estimated gasoline and electricity spending for the selected distance. Purchase cost, depreciation, financing, maintenance, insurance, repairs, taxes, and charging equipment must be compared separately.

Related

Formula used
in gmpg | Gas car fuel economy | miles per gallon | 30 | 1 | 200
in gprice | Gas price | $ per gallon | 3.50 | 0 | 100
in empkwh | Electric car efficiency | miles per kWh | 3.5 | 0.1 | 20
in eprice | Electricity price | $ per kWh | 0.16 | 0 | 10
in miles | Distance driven | miles | 12000 | 0 | 1000000
out diff | Electric minus gas energy cost | $ | miles * eprice / empkwh - miles * gprice / gmpg | 2
out gas | Gas energy cost | $ | miles * gprice / gmpg | 2
out elec | Electric energy cost | $ | miles * eprice / empkwh | 2
out gasmi | Gas energy cost per mile | $ per mile | gprice / gmpg | 4
out elecmi | Electric energy cost per mile | $ per mile | eprice / empkwh | 4

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard loan formula for this calculation, fixed rate and monthly compounding unless stated, rounded as each result states. Not financial advice; no lender, rate or product is recommended. See formulas and assumptions, the disclaimer or report an error.

More in this section

The whole Loan payments section →