Skip to main content

CometWeb Labs / Carbon Badge

Small component.
Your footprint, visible.

Show visitors your page’s estimated CO₂e in a lightweight component that fits your website.

Free, with no account or API key. The badge calculates in the visitor’s browser. It sends no page URL or measurement data to Insight. MIT-licensed source.

cometweb.ioComponent preview

Calculated locally for this page. N/D means incomplete data — not zero emissions.

MIT · Web Component
Source and documentation on GitHub

INSTALLATION

Choose a look. Paste the code.

Choose the theme and size in the preview above. No account or server setup needed.

1. Choose where to host the file

The browser downloads a pinned static file from cometweb.io. It calculates on-device, without requesting Insight scans.

Download ESM file v2.0.1 · SRI integrity check included

The badge writes no cookies or localStorage. File downloads are subject to ordinary hosting logs. Cross-origin resources may hide their size — in that case the badge shows N/D.

2. Paste before the closing body tag

<script type="module" src="https://cometweb.io/scripts/carbon-badge/2.0.1/cometweb-carbon-badge.esm.js"
  integrity="sha384-fjg7RaM8cI8U2Bpq+dPBzwKPLEuDTmjHbezvNYhYydb5ug2Wm3IIZo5ZGYWDEw0a" crossorigin="anonymous"></script>
<cometweb-carbon-badge mode="estimate"
  theme="dark" variant="default"></cometweb-carbon-badge>

If your site uses CSP, allow the chosen script origin in script-src. The estimate describes the current page load and can vary between devices.

DATA SOURCE

Where does the result come from?

The badge estimates one page load. Insight helps you find and prioritise improvements.

CometWeb Insight

Want to know what to improve?

Move from a single indicator to a site audit, priorities and actions in Insight. It is a separate tool — the badge does not require an account.

Audit your site in Insight
mode="estimate"

An estimate in the browser

The component uses the local Performance API. It makes no result request and does not use the URL attribute to determine page weight.

Default · no server scans · incomplete data = N/D
SWDM v4CO₂e estimation model
No APIlocal calculation, no runtime dependencies
dark / lighttwo component themes
MITmodify and self-host the source

DETAILS

Settings and score bands.

Attributes
modeestimate — default local mode
themedark | light
variantdefault | compact | minimal
urlNot needed. The local badge uses the current page, excluding query parameters and fragments.
Score thresholds (g CO₂e / page load)
A+< 0.10g
A< 0.20g
B< 0.40g
C< 0.70g
D< 1.00g
F≥ 1.00g

The grams of CO₂e come from the SWDM v4 model; the A+–F letter bands are our own presentation scale, not thresholds published by Sustainable Web Design. This estimates page transfer emissions — not an org-wide footprint or ESG certificate.