EV vs Gas Calculator Widget
Settle the running-cost question with the visitor's own numbers. Annual distance, the petrol car's economy and fuel price, the EV's consumption and electricity price, and any price premium give the yearly cost of each, the saving, the payback period and tailpipe CO2, with grid emissions if the visitor knows their factor.
Live preview
Under the widget on your page: Powered by A2Z Tools
Embed code
<iframe src="https://a2z.tools/embed/w/ev-vs-gas-calculator" title="EV vs Gas Calculator by A2Z Tools" width="100%" height="840" style="border:0;width:100%" loading="lazy" allow="clipboard-write"></iframe>
A plain iframe. Works everywhere, including site builders that strip scripts. Adjust height if your content needs more room.
<div data-a2z-widget="ev-vs-gas-calculator" data-height="840"></div> <script async src="https://a2z.tools/embed.js"></script>
Adds a small script (what it does) that sizes the widget to fit its content, loads it lazily and keeps it isolated from your page's CSS.
Works with
How it works
With the Imperial switch the petrol car's economy is in US miles per gallon and fuel is priced per gallon; with Metric it is litres per 100 km and price per litre. Fuel used is distance over mpg, or distance times L/100 km over 100, and multiplying by the price gives the yearly fuel bill. The EV uses kWh per 100 miles or km times the distance, times the electricity price. Enter consumption measured at the wall - the US EPA label figure already includes charging losses - so nothing is counted twice. The difference is the yearly saving; dividing any extra purchase price by it gives the years to break even, or 'never' if the EV costs more to run. Tailpipe CO2 for petrol uses the EPA's 8,887 g per gallon (2,347.7 g per litre). For the EV, CO2 depends entirely on the local grid, so it appears only when the visitor enters a grid intensity in g/kWh. 12,000 miles at 30 mpg and $3.50 costs $1,400; the same miles at 30 kWh/100 mi and $0.16 cost $576.
Calculation method
- Fuel used = distance / mpg (imperial) or distance x L/100 km / 100 (metric)
- Fuel cost = fuel used x fuel price; EV energy = distance x kWh per 100 / 100
- EV cost = EV energy x electricity price; saving = fuel cost - EV cost
- Payback (years) = price premium / yearly saving
- Petrol CO2 = gallons x 8,887 g (or litres x 2,347.7 g); EV CO2 = kWh x grid g/kWh
Worked examples
US commuter
Inputs: 12,000 mi; 30 mpg at $3.50/gal; EV 30 kWh/100 mi at $0.16/kWh; $5,000 premium
Result: Saving $824 a year ($1,400 vs $576); premium repaid in 6.1 years; petrol CO2 3,555 kg a year
400 gallons versus 3,600 kWh.
European driver
Inputs: 15,000 km; 7 L/100 km at 1.70 per litre; EV 18 kWh/100 km at 0.30 per kWh; grid 400 g/kWh
Result: Saving 975 a year (1,785 vs 810); petrol CO2 2,465 kg vs 1,080 kg from the grid
1,050 litres of petrol against 2,700 kWh.
An estimate of energy costs, not financial advice.
Limitations
- Energy costs only: purchase incentives, insurance, servicing, tyres and resale value are not compared.
- Assumes constant prices and consumption; winter driving raises EV consumption more than petrol consumption.
- Petrol CO2 is tailpipe only and the EV figure is grid generation only; manufacturing emissions are excluded.
Where publishers use it
- A car dealership's EV model pages
- An electricity supplier's EV tariff promotion
- A sustainability blog comparing commuting options
- A company car policy page for employees choosing a vehicle
- A local government climate action page on transport
Questions
Where do I find my EV's consumption?
In the US, the EPA window sticker lists kWh per 100 miles measured from the wall, which already includes charging losses - use it directly. Elsewhere, the trip computer's figure is measured at the battery, so add about 10% for charging losses before entering it.
How is petrol CO2 calculated?
The US EPA states that burning one gallon of gasoline produces 8,887 grams of CO2. Dividing by 3.785411784 litres per US gallon gives 2,347.7 g per litre. 400 gallons a year is about 3,555 kg.
Why is EV CO2 optional?
It depends on how your electricity is generated, which ranges from near zero on a hydro or nuclear grid to several hundred grams per kWh on a coal-heavy one. Enter the figure published by your utility or grid operator; at 400 g/kWh, 2,700 kWh a year is 1,080 kg.
Does it include maintenance or depreciation?
No - only energy. EVs usually need fewer oil changes and brake jobs, but insurance, tyres and resale values differ by model, so compare those separately.
What if I charge at public fast chargers?
Use a blended electricity price: if 80% of charging is at home for $0.16 and 20% at a fast charger for $0.48, the average is 0.8 x 0.16 + 0.2 x 0.48 = $0.224 per kWh.
Can I compare a diesel car?
The cost part works for any fuel; enter diesel's economy and price. The CO2 line, however, uses the gasoline factor and would understate diesel, which the EPA puts at 10,180 g per gallon.
Sources
- Greenhouse Gas Emissions from a Typical Passenger Vehicle - U.S. Environmental Protection Agency . 8,887 grams CO2 per gallon of gasoline; 10,180 grams per gallon of diesel. Checked 2026-10-01.
Cite or recommend this tool
If you reference this tool in an article, course or documentation, these formats are ready to copy. They are optional - nothing is added to your site unless you paste it.
A2Z Tools EV vs Gas Calculator https://a2z.tools/embed/ev-vs-gas-calculator
<a href="https://a2z.tools/embed/ev-vs-gas-calculator">A2Z Tools EV vs Gas Calculator</a>
[A2Z Tools EV vs Gas Calculator](https://a2z.tools/embed/ev-vs-gas-calculator)
EV vs Gas Calculator by A2Z Tools - https://a2z.tools/embed/ev-vs-gas-calculator
Related widgets
-
Cost and energy to charge an electric car between two battery levels, with charging losses.
-
Fuel needed and trip cost from distance, economy and fuel price, split between passengers.
-
Convert between MPG (US), MPG (UK), L/100 km and km per litre with exact factors.
-
How long an electric car takes to charge between two levels on a given AC or DC charger.
-
Monthly car payment with down payment, trade-in, sales tax and fees, plus the total cost.
-
Diameter, sidewall and revolutions of a tyre size, and the speedometer error of a new size.