Electric car cost calculator UK: by number plate, with the 3p-a-mile charge
Type your number plate: the calculator reads your yearly mileage from your car's MOT history and shows what an electric car would cost you, at home or public chargers, with the 3p-a-mile charge from April 2028. It also shows how long one charge takes and what it costs.
Type your number plate, and this calculator reads how many miles your car does in a year from its MOT history. It then works out what an electric car would cost you for the same miles: in electricity, charged at home or at public chargers, and in the new pay-per-mile charge of 3p a mile from April 2028. If you already drive an electric car, it shows what the new charge will cost you. The second part works out how long one charge takes, and what it costs, on a 3-pin plug, a home charger, a public charger or a rapid charger.
The calculator needs JavaScript switched on in your browser.
How it works
Every MOT records the car’s mileage. The calculator takes the latest reading and the reading nearest to three years before it, and works out the miles a year from the two. A car that has had only one or two MOTs is compared with zero miles on the day it was first used. If a reading is lower than an earlier one, the calculator says so, because the yearly figure may then be wrong.
For fuel economy, it finds your car in the Vehicle Certification Agency’s official figures and adjusts them to what cars like it do on the road. Petrol cars sold since 2019, which were tested on the newer WLTP test, use about 24% more fuel on the road than in the test, and diesel cars about 18% more, according to the European Commission’s data from cars’ own fuel meters. Electric cars go about 18% less far per kWh than their official figure, according to Which?’s range tests. The journey cost calculator explains these adjustments in more detail.
It then compares the fuel your car uses in a year with the electricity an electric car needs for the same miles. Unless you change it, the electric car does 3.5 miles per kWh.
Worked example: 7,000 miles a year
A petrol car that does 45 mpg uses 7,000 ÷ 45 × 4.546 = 707 litres of petrol in a year. At 175.3p a litre, that is £1,240.
An electric car that does 3.5 miles per kWh needs 7,000 ÷ 3.5 = 2,000 kWh. Charged at home at 26.32p a kWh, that is £526, which is £713 a year less than the petrol car. From April 2028, the pay-per-mile charge adds 7,000 × 3p = £210, so the saving falls to £503 a year.
Without a charger at home, the same 2,000 kWh from public slow and fast chargers at 54p a kWh costs £1,080. With the £210 charge on top, the electric car then costs £50 a year more to run than the petrol car.
Yearly costs at different mileages
| Miles a year | Petrol (45 mpg) | Diesel (52 mpg) | Electric, charged at home | Electric, public chargers | Pay-per-mile charge (electric) |
|---|---|---|---|---|---|
| 5,000 | £885 | £874 | £376 | £771 | £150 |
| 7,000 | £1,240 | £1,224 | £526 | £1,080 | £210 |
| 10,000 | £1,771 | £1,748 | £752 | £1,543 | £300 |
| 15,000 | £2,656 | £2,623 | £1,128 | £2,314 | £450 |
At UK prices for October 2026: petrol at 175.3p and diesel at 200.0p a litre, home electricity at 26.32p and public slow and fast chargers at 54p a kWh, and an electric car that does 3.5 miles per kWh. The pay-per-mile charge starts in April 2028. Plug-in hybrids pay half of it: £75 for 5,000 miles and £150 for 10,000.
The pay-per-mile charge explained
The government calls it Electric Vehicle Excise Duty (eVED). It confirmed the details in July 2026, after a consultation:
- How much: 3p a mile for electric cars and 1.5p a mile for plug-in hybrids, from April 2028. The rate rises with inflation (CPI) from April 2029.
- Which vehicles: electric and plug-in hybrid cars. Hydrogen fuel cell cars pay the electric rate, and range extenders pay the plug-in hybrid rate. Vans, buses, coaches and lorries are not included, and neither are special vehicles such as hearses and campervans.
- How you pay: through the vehicle tax system. When you tax the car, you give its mileage and an estimate of the miles you will drive in the coming year, and you can pay monthly, every six months or once a year. Your estimate is later checked against the car’s real mileage, and any difference is charged at the rate at that time. If you expect to drive more than you estimated, you can pay more in advance.
- Where the readings come from: when the car has its MOT, the tester’s reading counts as a checked reading.
The government’s own example is a car driven 5,000 miles in a year, which pays £150.
How long a charge takes
Three things decide it: the charger, the most power your car can take from it, and how full the battery already is. Charging a 60 kWh battery from 20% to 80% puts 36 kWh into it. In a car that takes up to 11 kW from AC chargers and 100 kW from rapid chargers:
| Charger | Power | Time, 20% to 80% | Cost |
|---|---|---|---|
| 3-pin plug | 2.3 kW | About 18 hours 25 minutes | £11.15 at home |
| Home charger | 7.4 kW | About 5 hours 24 minutes | £10.53 at home |
| Public charger (22 kW) | 11 kW, the car’s limit | About 3 hours 31 minutes | £20.90 at 54p a kWh |
| Rapid charger | 50 kW | About 1 hour 5 minutes | £28.44 at 79p a kWh |
| Ultra-rapid charger (150 kW) | 100 kW, the car’s limit | About 32 minutes | £28.44 at 79p a kWh |
Home electricity at 26.32p a kWh, and public prices at the UK averages for September 2026. On the ultra-rapid charger, carrying on from 80% to 100% takes about another 29 minutes, almost as long as going from 20% to 80%.
Why a 3-pin plug is so slow
A 3-pin charging cable draws about 10 amps from a household socket at 230 volts, which is 2.3 kW. Some of that never reaches the battery: it is lost as heat in the car’s own charger, and some runs the car’s electronics while it charges. In ADAC tests of five cars, 13% to 24% of the electricity from a household socket was lost, against 5% to 7% at an 11 kW wall charger. So a 3-pin plug is slow, and it costs a little more for the same charge.
Why your car sets the speed at home and on street chargers
Home and street chargers supply alternating current (AC). The car’s own charger turns it into direct current (DC) for the battery, and that charger has a limit, often 7.4 kW or 11 kW. A 22 kW public charger gives 22 kW only to cars with a 22 kW charger built in; a car that takes 11 kW charges at 11 kW. Most homes in the UK have a single-phase supply, so a home charger gives at most 7.4 kW.
Why rapid charging slows down after 80%
Rapid chargers supply DC straight to the battery, so the car can take far more power. But a battery can only take its top speed while it is fairly empty. As it fills, the car asks for less to protect the battery, and above about 80% the speed falls a long way. In an example from Osprey Charging, a car took 26 minutes to reach 80% and another 19 minutes to go from 80% to 100%. On a long journey, it is usually quicker to stop at about 80% and charge again later.
How the calculator estimates it
- AC chargers: the lower of the charger’s power and your car’s limit, with 15% of the electricity lost on a 3-pin plug, 10% on a 7.4 kW home charger and 7% on faster chargers.
- Rapid chargers: on average two-thirds of the lower of the charger’s power and your car’s top speed up to 80%, and a quarter of it above 80%. Rapid chargers charge for the energy they deliver to the car.
- A check: Renault says the Renault 5 with the 52 kWh battery charges from 15% to 80% in 17 hours 13 minutes on a 3-pin plug, 5 hours 11 minutes at 7.4 kW, 3 hours 13 minutes at 11 kW and about 30 minutes on a 100 kW rapid charger. For the same car, the calculator gives 17 hours 17 minutes, 5 hours 5 minutes, 3 hours 18 minutes and 30 minutes.
Your car’s handbook or its maker’s website gives its battery size and top charging speeds, and often its own charging times.
What the calculator leaves out
- Vehicle tax, insurance and servicing.
- The price of the car, and how much value it loses each year.
- Electricity lost while charging, in the yearly figures, so the real cost of charging can be a little higher than shown. The one-charge part includes it.
- The weather. Electric cars cover fewer miles per kWh in winter: in What Car?’s winter tests, cars fell 16% to 33% short of their official range. Lower the miles per kWh to see a winter month.
Where the figures come from
- Mileage: the odometer readings in the DVSA’s MOT history service.
- Fuel economy: the Vehicle Certification Agency’s official figures, adjusted for real-world driving with data from the European Commission, the ICCT and Which?.
- Petrol and diesel: 175.3p and 200.0p a litre, the UK average pump prices for the week of 12 October 2026 from the government’s weekly road fuel price statistics.
- Home electricity: 26.32p a kWh, Ofgem’s energy price cap for 1 October to 31 December 2026 (paying by Direct Debit, average for England, Scotland and Wales).
- Public charging: 54p a kWh, Zapmap’s pay-as-you-go average for slow and fast chargers in September 2026. Rapid and ultra-rapid chargers averaged 79p.
- The pay-per-mile charge: the government’s response to the eVED consultation, July 2026.
Braindumps checks these prices every month and updates the calculator when they move.
Questions people ask
How much will the pay-per-mile charge cost me?
For an electric car, 3p a mile: £150 a year for 5,000 miles, £210 for 7,000 miles, £300 for 10,000 miles and £450 for 15,000 miles. Plug-in hybrids pay half. It starts in April 2028 and rises with inflation from April 2029.
Is an electric car still cheaper to run with the new charge?
If you can charge at home, usually yes. At 7,000 miles a year, it saves about £503 a year over a 45 mpg petrol car, even after the charge. If you rely on public slow and fast chargers at 54p a kWh, it costs about £50 a year more. Your own figures will differ, and the calculator shows them.
How long does an electric car take to charge?
For a 60 kWh battery from 20% to 80%: about 18 hours on a 3-pin plug, 5 hours 24 minutes on a 7.4 kW home charger, and from about 30 minutes to an hour on a rapid charger, depending on the charger and how fast your car can charge. The last 20%, from 80% to 100%, is much slower on a rapid charger.
How does the calculator know my mileage?
From the odometer readings in your car’s MOT history, which the DVSA publishes for every car that has had an MOT. A car less than three years old has not had one yet, so you type your own figure. Braindumps does not keep number plates.
To see what the advisories in a car’s MOT history mean, use the MOT history checker. To work out the cost of a single trip, use the journey cost calculator. If you use rapid chargers often, the EV charging subscription calculator shows whether a network’s subscription would save you money. More free calculators are on the free tools page.
Sources
GOV.UK: Electric Vehicle Excise Duty, government response to the consultation (July 2026); GOV.UK: weekly road fuel prices; Ofgem: energy price cap, 1 October to 31 December 2026; Zapmap: UK EV charging price index; DVSA: MOT history API; Vehicle Certification Agency: car fuel data; European Commission: real-world CO2 emissions from cars (2024); ICCT: From laboratory to road; Which?: the truth about electric car range; Fleet News: What Car? winter range tests; Renault UK: Renault 5 E-Tech charging times; SolarQuotes: ADAC’s tests of charging losses (September 2026); Osprey Charging: what is a charging curve?.
Vehicle details and MOT readings contain public sector information licensed under the Open Government Licence v3.0. Fuel economy data: Vehicle Certification Agency, Crown copyright.
Use this calculator on your own site
You are welcome to use this calculator on your own website. Copy the code below into a Custom HTML block in WordPress, or into any web page. It needs no other files. This version leaves out the number plate lookup, so it needs no API key or account: people type in their mileage and their car’s fuel economy themselves. We only ask that you keep the link to Braindumps at the bottom.
<!-- Braindumps electric car cost calculator (UK). Self-contained: no external files. Prices are UK averages; change them to your own. -->
<div id="bd-evc">
<style>
#bd-evc{--bd-red:#d63333;--bd-line:rgba(127,127,127,.35);--bd-soft:rgba(127,127,127,.08);font:inherit;color:inherit;max-width:760px;margin:1.5em 0}
#bd-evc *{box-sizing:border-box}
#bd-evc [hidden]{display:none!important}
#bd-evc fieldset{border:1px solid var(--bd-line);border-radius:10px;padding:14px 16px 6px;margin:0 0 14px;min-width:0}
#bd-evc legend{font-weight:700;padding:0 6px}
#bd-evc .row{display:grid;grid-template-columns:1fr 1fr;gap:10px 16px}
@media (max-width:560px){#bd-evc .row{grid-template-columns:1fr}}
#bd-evc label{display:block;font-size:.92em;margin-bottom:10px}
#bd-evc .hint{display:block;opacity:.7;font-size:.88em}
#bd-evc input,#bd-evc select{width:100%;padding:8px 10px;margin-top:4px;border:1px solid var(--bd-line);border-radius:6px;font:inherit;background:transparent;color:inherit}
#bd-evc .seg{display:flex;flex-wrap:wrap;gap:8px;margin:2px 0 12px;border:0;padding:0}
#bd-evc .seg label{display:flex;align-items:center;gap:6px;margin:0;padding:8px 14px;border:1px solid var(--bd-line);border-radius:999px;cursor:pointer;font-size:.95em}
#bd-evc .seg input{width:auto;margin:0;accent-color:var(--bd-red)}
#bd-evc .seg label:has(input:checked){border-color:var(--bd-red);background:var(--bd-soft);font-weight:700}
#bd-evc .result{border:2px solid var(--bd-red);border-radius:10px;padding:14px 16px;background:var(--bd-soft)}
#bd-evc .total{font-size:1.7em;font-weight:700;margin:0;line-height:1.2}
#bd-evc .sub{margin:2px 0 6px}
#bd-evc table{width:100%;border-collapse:collapse;margin:8px 0}
#bd-evc td{padding:5px 0;border-bottom:1px solid var(--bd-line);text-align:left;vertical-align:top}
#bd-evc td:last-child{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap;padding-left:12px}
#bd-evc details{margin-top:8px}
#bd-evc summary{cursor:pointer;font-weight:700}
#bd-evc pre{white-space:pre-wrap;font-size:.85em;margin:8px 0 0;background:transparent;border:0;padding:0}
#bd-evc .note{font-size:.85em;opacity:.75;margin:10px 0 0}
#bd-evc .warn{color:var(--bd-red);font-weight:700}
#bd-evc .result+fieldset{margin-top:22px}
</style>
<fieldset>
<legend>Your car</legend>
<div class="seg" role="radiogroup" aria-label="Your car runs on">
<label><input type="radio" name="bd-ev-now" value="petrol" checked> Petrol or hybrid</label>
<label><input type="radio" name="bd-ev-now" value="diesel"> Diesel</label>
<label><input type="radio" name="bd-ev-now" value="phev"> Plug-in hybrid</label>
<label><input type="radio" name="bd-ev-now" value="electric"> Electric</label>
</div>
<div class="row">
<label>Miles a year
<input id="bd-ev-miles" type="number" min="0" step="10" value="7000" inputmode="numeric">
<span class="hint">Your MOT certificates show the mileage at each test.</span></label>
</div>
<div class="row" id="bd-ev-ice">
<label>Fuel economy (mpg)
<input id="bd-ev-mpg" type="number" min="0" step="any" value="45" inputmode="decimal">
<span class="hint" id="bd-ev-mpghint">Your trip computer shows it. Many family cars do 40 to 55 mpg.</span></label>
<label>Fuel price (pence per litre)
<input id="bd-ev-price" type="number" min="0" step="0.1" value="175.3" inputmode="decimal">
<span class="hint" id="bd-ev-pricehint"></span></label>
</div>
</fieldset>
<fieldset>
<legend id="bd-ev-evlegend">An electric car instead</legend>
<div class="row">
<label>Efficiency (miles per kWh)
<input id="bd-ev-mpk" type="number" min="0" step="0.1" value="3.5" inputmode="decimal">
<span class="hint">Most electric cars manage 3 to 4 miles per kWh, and less in winter.</span></label>
<label>Home electricity (pence per kWh)
<input id="bd-ev-home" type="number" min="0" step="0.01" value="26.32" inputmode="decimal">
<span class="hint" id="bd-ev-homehint"></span></label>
<label>Public chargers (pence per kWh)
<input id="bd-ev-public" type="number" min="0" step="0.01" value="54" inputmode="decimal">
<span class="hint" id="bd-ev-publichint"></span></label>
</div>
</fieldset>
<div class="result" aria-live="polite">
<p class="total" id="bd-ev-total">£0</p>
<p class="sub" id="bd-ev-sub"></p>
<table><tbody id="bd-ev-lines"></tbody></table>
<p id="bd-ev-said"></p>
<details><summary>Show the working</summary><pre id="bd-ev-working"></pre></details>
<p class="note" id="bd-ev-note"></p>
</div>
<fieldset>
<legend>One charge: how long it takes and what it costs</legend>
<div class="seg" role="radiogroup" aria-label="Charger">
<label><input type="radio" name="bd-ev-chg" value="plug"> 3-pin plug (2.3 kW)</label>
<label><input type="radio" name="bd-ev-chg" value="home" checked> Home charger (7.4 kW)</label>
<label><input type="radio" name="bd-ev-chg" value="public"> Public charger (22 kW)</label>
<label><input type="radio" name="bd-ev-chg" value="rapid"> Rapid (50 kW)</label>
<label><input type="radio" name="bd-ev-chg" value="ultra"> Ultra-rapid (150 kW)</label>
</div>
<div class="row">
<label>Battery size (kWh)
<input id="bd-ev-batt" type="number" min="0" step="0.1" value="60" inputmode="decimal">
<span class="hint">The usable size, from the handbook or the maker's website.</span></label>
<label>Fastest AC charging your car takes (kW)
<input id="bd-ev-carac" type="number" min="0" step="0.1" value="11" inputmode="decimal">
<span class="hint">Many cars take 11 kW and some 7.4 kW. Home chargers give up to 7.4 kW.</span></label>
<label>Charge from (%)
<input id="bd-ev-from" type="number" min="0" max="100" step="1" value="20" inputmode="numeric"></label>
<label>Charge to (%)
<input id="bd-ev-to" type="number" min="0" max="100" step="1" value="80" inputmode="numeric"></label>
<label>Fastest rapid charging your car takes (kW)
<input id="bd-ev-cardc" type="number" min="0" step="1" value="100" inputmode="numeric">
<span class="hint">The car's top DC charging speed, in the handbook or the maker's specification.</span></label>
<label>Rapid charger price (pence per kWh)
<input id="bd-ev-rapid" type="number" min="0" step="0.01" value="79" inputmode="decimal">
<span class="hint" id="bd-ev-rapidhint"></span></label>
</div>
</fieldset>
<div class="result" aria-live="polite">
<p class="total" id="bd-ev-time">0 minutes</p>
<p class="sub" id="bd-ev-timesub"></p>
<details><summary>Show the working</summary><pre id="bd-ev-timework"></pre></details>
<p class="note" id="bd-ev-timenote"></p>
</div>
<p class="bd-credit" style="font-size:.85em;opacity:.75;margin:10px 0 0">Electric car cost calculator by <a href="https://braindumps.co.uk/electric-car-cost-calculator/">Braindumps.co.uk</a></p>
<script>
(function () {
"use strict";
/* BEGIN CALC */
var LITRES_PER_GALLON = 4.54609; // UK gallon
// Electric Vehicle Excise Duty from April 2028, in pence per mile (rises with inflation from April 2029).
var EVED = { electric: 3, phev: 1.5 };
function yearCosts(o) {
var miles = o.miles > 0 ? o.miles : 0;
var r = { miles: miles, litres: 0, fuelCost: 0, kwh: 0 };
if (o.now !== "electric" && o.mpg > 0) {
r.litres = miles / o.mpg * LITRES_PER_GALLON;
r.fuelCost = r.litres * o.pencePerLitre / 100;
}
r.kwh = o.milesPerKwh > 0 ? miles / o.milesPerKwh : 0;
r.homeCost = r.kwh * o.homePence / 100;
r.publicCost = r.kwh * o.publicPence / 100;
r.evedElectric = miles * EVED.electric / 100;
r.evedNow = o.now === "electric" ? r.evedElectric : (o.now === "phev" ? miles * EVED.phev / 100 : 0);
// What an electric car charged at home saves over the car now (a negative figure costs more).
r.savingNow = r.fuelCost - r.homeCost;
r.saving2028 = r.fuelCost + r.evedNow - (r.homeCost + r.evedElectric);
r.savingPublic2028 = r.fuelCost + r.evedNow - (r.publicCost + r.evedElectric);
return r;
}
// One charge. On AC chargers the power is the lower of the charger's and the car's, and part of the
// electricity is lost in the car's own charger (ADAC tests: 13% to 24% from a 3-pin socket, 5% to 7% at
// 11 kW). On rapid (DC) chargers the car averages about two-thirds of its top speed up to 80% and about a
// quarter of it above 80%, where charging slows down to protect the battery.
var CHARGERS = {
plug: { kind: "ac", kw: 2.3, eff: 0.85, name: "a 3-pin plug" },
home: { kind: "ac", kw: 7.4, eff: 0.9, name: "a home charger" },
public: { kind: "ac", kw: 22, eff: 0.93, name: "a 22 kW public charger" },
rapid: { kind: "dc", kw: 50, name: "a 50 kW rapid charger" },
ultra: { kind: "dc", kw: 150, name: "a 150 kW ultra-rapid charger" }
};
var DC_TO_80 = 2 / 3;
var DC_ABOVE_80 = 1 / 4;
function oneCharge(o) {
var from = Math.min(100, Math.max(0, o.from)), to = Math.min(100, Math.max(0, o.to));
var c = o.charger;
var r = { kwh: 0, billed: 0, hours: 0, hoursAbove80: 0, kw: 0 };
if (!(o.battery > 0) || !(to > from)) { return r; }
r.kwh = o.battery * (to - from) / 100;
if (c.kind === "ac") {
r.kw = Math.min(c.kw, o.carAc > 0 ? o.carAc : c.kw);
r.billed = r.kwh / c.eff;
r.hours = r.billed / r.kw;
} else {
r.kw = Math.min(c.kw, o.carDc > 0 ? o.carDc : c.kw);
var below = o.battery * (Math.min(to, 80) - Math.min(from, 80)) / 100;
r.billed = r.kwh; // rapid chargers bill the energy they deliver to the car
r.hoursAbove80 = (r.kwh - below) / (r.kw * DC_ABOVE_80);
r.hours = below / (r.kw * DC_TO_80) + r.hoursAbove80;
}
return r;
}
/* END CALC */
// UK averages. Update these when prices change.
var PRICES = {
petrol: { p: 175.3, label: "UK average petrol price, week of 12 October 2026." },
diesel: { p: 200.0, label: "UK average diesel price, week of 12 October 2026." },
home: { p: 26.32, label: "Energy price cap for England, Scotland and Wales, 1 October to 31 December 2026." },
slow: { p: 54, label: "UK pay-as-you-go average for slow and fast chargers, September 2026. Rapid chargers average 79p." },
rapid: { p: 79, label: "UK pay-as-you-go average for rapid and ultra-rapid chargers, September 2026. Change it to the price at your charger." }
};
var TYPICAL = { petrol: 45, diesel: 52, electric: 3.5 };
var root = document.getElementById("bd-evc");
if (!root) { return; }
function el(id) { return document.getElementById(id); }
function num(id) { var v = parseFloat(el(id).value); return isFinite(v) && v >= 0 ? v : 0; }
function pounds(v) { return "£" + Math.round(Math.abs(v)).toLocaleString("en-GB"); }
function money(v) { return "£" + v.toLocaleString("en-GB", { minimumFractionDigits: 2, maximumFractionDigits: 2 }); }
function fixed(v, d) { return v.toLocaleString("en-GB", { minimumFractionDigits: d, maximumFractionDigits: d }); }
// Up to d decimal places, without trailing zeros: 54 stays "54", 26.32 stays "26.32".
function short(v, d) { return v.toLocaleString("en-GB", { maximumFractionDigits: d }); }
function now() { var c = root.querySelector('input[name="bd-ev-now"]:checked'); return c ? c.value : "petrol"; }
var edited = {};
["bd-ev-mpg", "bd-ev-price"].forEach(function (id) {
el(id).addEventListener("input", function () { edited[id] = true; });
});
var NAMES = { petrol: "petrol", diesel: "diesel", phev: "plug-in hybrid", electric: "electric" };
function row(tbody, a, b) {
var tr = document.createElement("tr");
var td1 = document.createElement("td"); td1.textContent = a;
var td2 = document.createElement("td"); td2.textContent = b;
tr.appendChild(td1); tr.appendChild(td2); tbody.appendChild(tr);
}
function cheaper(v) { return v >= 0 ? pounds(v) + " a year less" : pounds(v) + " a year more"; }
function update() {
var n = now();
var o = {
now: n, miles: num("bd-ev-miles"), mpg: num("bd-ev-mpg"), pencePerLitre: num("bd-ev-price"),
milesPerKwh: num("bd-ev-mpk"), homePence: num("bd-ev-home"), publicPence: num("bd-ev-public")
};
var r = yearCosts(o);
var ev = n === "electric";
var lines = el("bd-ev-lines"); lines.textContent = "";
var miles = fixed(r.miles, 0) + " miles a year";
var said = "";
if (ev) {
el("bd-ev-total").textContent = pounds(r.evedElectric) + " a year";
el("bd-ev-sub").textContent = "for the pay-per-mile charge from April 2028: 3p a mile on " + miles + " (" + money(r.evedElectric / 12) + " a month)";
row(lines, "Charging at home (" + short(o.homePence, 2) + "p a kWh)", pounds(r.homeCost));
row(lines, "Charging only at public chargers (" + short(o.publicPence, 2) + "p a kWh)", pounds(r.publicCost));
row(lines, "Pay-per-mile charge from April 2028 (3p a mile)", pounds(r.evedElectric));
var petrol = yearCosts({ now: "petrol", miles: o.miles, mpg: TYPICAL.petrol, pencePerLitre: PRICES.petrol.p, milesPerKwh: 0, homePence: 0, publicPence: 0 });
row(lines, "Petrol for the same miles in a " + TYPICAL.petrol + " mpg car", pounds(petrol.fuelCost));
said = "Charging at home and paying the new charge, your car would cost " + pounds(r.homeCost + r.evedElectric) + " a year to run, against " + pounds(petrol.fuelCost) + " for petrol in a " + TYPICAL.petrol + " mpg car.";
} else {
el("bd-ev-total").textContent = cheaper(r.saving2028);
el("bd-ev-sub").textContent = "to run an electric car charged at home than your " + NAMES[n] + " car, from April 2028, when the pay-per-mile charge starts. Until then: " + cheaper(r.savingNow) + ".";
row(lines, "Your car now: fuel (" + short(o.mpg, 1) + " mpg)", pounds(r.fuelCost));
if (n === "phev") { row(lines, "Your car: pay-per-mile charge from April 2028 (1.5p a mile)", pounds(r.evedNow)); }
row(lines, "Electric car charged at home (" + short(o.homePence, 2) + "p a kWh)", pounds(r.homeCost));
row(lines, "Electric car charged only at public chargers (" + short(o.publicPence, 2) + "p a kWh)", pounds(r.publicCost));
row(lines, "Electric car: pay-per-mile charge from April 2028 (3p a mile)", pounds(r.evedElectric));
said = "Without a charger at home, using public chargers at " + short(o.publicPence, 2) + "p a kWh, an electric car would cost " + cheaper(r.savingPublic2028).replace(" less", " less to run").replace(" more", " more to run") + " than your car from April 2028.";
if (n === "phev") { said += " The fuel figure for your plug-in hybrid does not include the electricity you charge it with."; }
}
el("bd-ev-said").textContent = said;
var w = [];
if (!ev) {
w.push("Fuel used = " + fixed(r.miles, 0) + " miles / " + short(o.mpg, 1) + " mpg x 4.546 litres = " + fixed(r.litres, 1) + " litres");
w.push("Fuel cost = " + fixed(r.litres, 1) + " litres x " + short(o.pencePerLitre, 1) + "p = " + money(r.fuelCost));
}
w.push("Electricity = " + fixed(r.miles, 0) + " miles / " + short(o.milesPerKwh, 1) + " miles per kWh = " + fixed(r.kwh, 0) + " kWh");
w.push("At home = " + fixed(r.kwh, 0) + " kWh x " + short(o.homePence, 2) + "p = " + money(r.homeCost));
w.push("Public = " + fixed(r.kwh, 0) + " kWh x " + short(o.publicPence, 2) + "p = " + money(r.publicCost));
w.push("Pay per mile = " + fixed(r.miles, 0) + " miles x 3p = " + money(r.evedElectric) + " (electric, from April 2028)");
if (n === "phev") { w.push("Your car = " + fixed(r.miles, 0) + " miles x 1.5p = " + money(r.evedNow) + " (plug-in hybrid, from April 2028)"); }
if (!ev) {
w.push("Saving now = " + money(r.fuelCost) + " - " + money(r.homeCost) + " = " + (r.savingNow < 0 ? "-" : "") + money(Math.abs(r.savingNow)));
w.push("From 2028 = " + money(r.fuelCost + r.evedNow) + " - " + money(r.homeCost + r.evedElectric) + " = " + (r.saving2028 < 0 ? "-" : "") + money(Math.abs(r.saving2028)));
}
el("bd-ev-working").textContent = w.join("\n");
var missing = o.miles <= 0 ? "how many miles you drive in a year" : (!ev && o.mpg <= 0 ? "your car's fuel economy" : (o.milesPerKwh <= 0 ? "the miles per kWh" : ""));
var note = el("bd-ev-note");
if (missing) { note.innerHTML = '<span class="warn">Enter ' + missing + " to see the cost.</span>"; }
else { note.textContent = "Vehicle tax, insurance, servicing and the price of the car are not included. The pay-per-mile charge rises with inflation from April 2029. Fuel economy changes with speed, traffic, load and weather, so treat the answer as a good estimate, not an exact figure."; }
updateCharge();
}
// "1.5 hours" becomes "1 hour 30 minutes".
function duration(h) {
var m = Math.max(1, Math.round(h * 60));
var hh = Math.floor(m / 60), mm = m % 60;
var mins = mm + " minute" + (mm === 1 ? "" : "s");
if (!hh) { return mins; }
return hh + " hour" + (hh === 1 ? "" : "s") + (mm ? " " + mins : "");
}
function updateCharge() {
var picked = root.querySelector('input[name="bd-ev-chg"]:checked');
var key = picked ? picked.value : "home";
var ch = CHARGERS[key];
var o = { battery: num("bd-ev-batt"), from: num("bd-ev-from"), to: num("bd-ev-to"), charger: ch, carAc: num("bd-ev-carac"), carDc: num("bd-ev-cardc") };
var note = el("bd-ev-timenote");
if (!(o.battery > 0) || !(Math.min(o.to, 100) > o.from)) {
el("bd-ev-time").textContent = "–";
el("bd-ev-timesub").textContent = "";
el("bd-ev-timework").textContent = "";
note.innerHTML = '<span class="warn">' + (!(o.battery > 0) ? "Enter your car's battery size." : "The charge to finish at must be higher than the charge to start from.") + "</span>";
return;
}
var r = oneCharge(o);
var atHome = key === "plug" || key === "home";
var price = atHome ? num("bd-ev-home") : (key === "public" ? num("bd-ev-public") : num("bd-ev-rapid"));
var cost = r.billed * price / 100;
var to = Math.min(o.to, 100);
el("bd-ev-time").textContent = "About " + duration(r.hours);
var sub = "to charge a " + short(o.battery, 1) + " kWh battery from " + short(o.from, 0) + "% to " + short(to, 0) + "% (" + short(r.kwh, 1) + " kWh) with " + ch.name + ", at up to " + short(r.kw, 1) + " kW. ";
if (ch.kind === "ac") {
sub += "It takes about " + short(r.billed, 1) + " kWh from the " + (atHome ? "mains" : "charger") + ", because some is lost on the way into the battery: " + money(cost) + " at " + short(price, 2) + "p a kWh.";
} else {
sub += "It costs " + money(cost) + " at " + short(price, 2) + "p a kWh.";
if (r.hoursAbove80 > 0) { sub += " The part above 80% takes " + duration(r.hoursAbove80) + " of that, because charging slows down as the battery fills."; }
}
el("bd-ev-timesub").textContent = sub;
var w = [];
w.push("Into the battery = " + short(o.battery, 1) + " kWh x (" + short(to, 0) + "% - " + short(o.from, 0) + "%) = " + short(r.kwh, 2) + " kWh");
if (ch.kind === "ac") {
w.push("Power = " + (o.carAc > 0 ? "the lower of " + short(ch.kw, 1) + " kW (charger) and " + short(o.carAc, 1) + " kW (car)" : short(ch.kw, 1) + " kW (charger)") + " = " + short(r.kw, 1) + " kW");
w.push("From the supply = " + short(r.kwh, 2) + " kWh / " + ch.eff + " = " + short(r.billed, 2) + " kWh (" + short(Math.round((1 - ch.eff) * 100), 0) + "% lost)");
w.push("Time = " + short(r.billed, 2) + " kWh / " + short(r.kw, 1) + " kW = " + short(r.hours, 2) + " hours");
} else {
var below = o.battery * (Math.min(to, 80) - Math.min(o.from, 80)) / 100;
w.push("Top speed = " + (o.carDc > 0 ? "the lower of " + ch.kw + " kW (charger) and " + short(o.carDc, 1) + " kW (car)" : ch.kw + " kW (charger)") + " = " + short(r.kw, 1) + " kW");
if (below > 0) { w.push("Up to 80% = " + short(below, 2) + " kWh / (" + short(r.kw, 1) + " kW x 2/3) = " + short(below / (r.kw * DC_TO_80), 2) + " hours"); }
if (r.hoursAbove80 > 0) { w.push("Above 80% = " + short(r.kwh - below, 2) + " kWh / (" + short(r.kw, 1) + " kW x 1/4) = " + short(r.hoursAbove80, 2) + " hours"); }
}
w.push("Cost = " + short(r.billed, 2) + " kWh x " + short(price, 2) + "p = " + money(cost));
el("bd-ev-timework").textContent = w.join("\n");
note.textContent = "An estimate. Charging is slower, and more is lost, when the weather and the battery are cold, and every car's charging is a little different.";
}
function setNow() {
var n = now();
var ev = n === "electric";
el("bd-ev-ice").hidden = ev;
el("bd-ev-evlegend").textContent = ev ? "Charging your car" : "An electric car instead";
if (!ev) {
var f = n === "diesel" ? "diesel" : "petrol";
if (!edited["bd-ev-price"]) { el("bd-ev-price").value = PRICES[f].p.toFixed(1); }
if (!edited["bd-ev-mpg"]) { el("bd-ev-mpg").value = TYPICAL[f]; }
el("bd-ev-pricehint").textContent = PRICES[f].label + " Change it to what you pay.";
el("bd-ev-mpghint").textContent = n === "phev" ? "Plug-in hybrids vary widely, so use your own figure if you can." : "Your trip computer shows it. Many family cars do 40 to 55 mpg.";
}
update();
}
root.addEventListener("input", update);
root.addEventListener("change", update);
root.querySelectorAll('input[name="bd-ev-now"]').forEach(function (r) { r.addEventListener("change", setNow); });
el("bd-ev-homehint").textContent = PRICES.home.label + " Change it to your own rate.";
el("bd-ev-publichint").textContent = PRICES.slow.label;
el("bd-ev-rapid").value = PRICES.rapid.p;
el("bd-ev-rapidhint").textContent = PRICES.rapid.label;
setNow();
})();
</script>
</div>