Skip to content

WIRXL

projects & experiments

wirxl.com // projects // emissions

Personal Emissions Calculator

[ sustainability ]

What it is

A seven-step calculator for your household’s annual greenhouse gas emissions. Bills, travel, bins, diet and spending go in. A number in tonnes of CO2e comes out, split by category, with a comparison against the UK average and some suggestions for bringing it down.

Why I built it

I wanted to know my own number, and got annoyed at every calculator I tried. They hand you a figure and no working. You can’t see which emissions factors they used, what year those came from, or which single assumption is doing most of the work.

The pre-filled fields bother me more. Load most calculators and every box already contains a national average, so you’re well above zero before you’ve typed anything. Everything here starts empty. Diet has a skip option, because not everyone wants to answer that question.

How it works

One static page. The steps are divs that get an active class toggled on and off. No router, no framework. Any change to any input runs a single calculate() that reads every field and recomputes the whole thing from scratch. Slightly wasteful, but there’s no partial state to fall out of sync, and the running total in the sidebar is never stale.

The waste section is the bit I’d point at. You give it bin size, how full it usually is when it goes out (up to 150%, for the weeks you put extra beside it) and how often it’s collected. That converts litres to kilograms at 0.15 kg/litre, then applies the DEFRA factors: 0.497 tonnes CO2e per tonne of residual waste, 0.673 for food and garden, 0.00469 for mixed recycling. Water works the same way, turning spend into cubic metres at roughly £2.67/m³ before applying the combined supply and treatment factor of 0.36218 kg CO2e/m³.

Results are drawn with Chart.js, reusing one chart instance and calling update() rather than tearing it down and rebuilding. The total also gets translated into things you can picture: phone charges, square metres of sea ice, trees, roughly what it would cost to offset.

What I’d change

Electricity, gas and shopping are all inferred from money spent, and that’s the weak point. The conversion goes stale every time tariffs move. It should ask for kWh and fall back to spend, rather than the other way round.

The factors are hardcoded in the JavaScript too. DEFRA publish new ones every June, so updating them means editing code instead of a data file. That will catch me out eventually.

How to use it

Get your bills out first. Electricity and gas per month, water per bill along with the dates it covers, and a rough monthly figure for general spending. Transport wants weekly car mileage and what you drive, flights per year split into short and long haul, and for buses and trains the typical journey distance and how many you make a month.

For bins, the size is usually stamped on the lid, and 140L or 240L covers most of the UK. Note how often each one is emptied and estimate how full it goes out. Anything you’d rather not answer, leave at zero and it won’t drag the total anywhere. The sidebar updates as you go, so you’ll normally spot the category that’s dominating long before you reach the last step.

▚ stack

HTMLCSSVanilla JavaScriptChart.js

added

View it