Show visitors your page’s estimated CO₂e.
From pasting the code to a result on the page.
-
You paste one tag
The script and the component tag before the closing body tag. No account or server setup. -
The browser counts transfer
The component reads the Performance API of the current page load, locally. -
The badge shows CO₂e
The SWDM v4 model turns transfer into an estimate. With incomplete data the badge shows N/D.
A live estimate, calculated on the visitor’s device
- Local calculation, no API
- No cookies or localStorage
- N/D instead of guessing when data is missing
A published measurement as a single image
- Confirmed domain
- A page with the measurement details
- 0 B of JavaScript on your site
Choose a look. Paste the code.
Where to host the file
Paste before the closing body tag
<script type="module" src="https://cometweb.io/scripts/carbon-badge/2.0.7/cometweb-carbon-badge.esm.js"
integrity="sha384-5bPSZPDLIucHdDGUKNmjLyfW/G6WfaEuJwSQ3Pn2NpMCb0oyonTqY4YN1wfqNiBN" crossorigin="anonymous"></script>
<cometweb-carbon-badge mode="estimate"
theme="dark" variant="default" lang="en"></cometweb-carbon-badge> Attributes and score bands
modeestimate, the default local modethemedark | lightvariantdefault | compact | minimallangpl | enurlNot needed. The local badge uses the current page, without query parameters or fragment.- SWDM v4CO₂e estimation model
- 14 kB gzipversion 2.0.7
- dark and lighttwo themes, three variants
- MITmodify and self-host the source
No. It displays a CO₂e estimate based on a model and available data. It is not an energy measurement, certification or ESG report.
Browsers do not always expose every resource size, especially for other domains. Check Timing-Allow-Origin headers with your resource providers. If data is still missing, the badge stays ungraded instead of guessing.
Neither. The browser downloads only the component file and calculates locally, with no server scans. You can host the file on your own site. The default estimate mode shown on this page writes no cookies or localStorage. The README on GitHub describes the component’s other modes.
Yes. The source is MIT-licensed. You can modify it and host it yourself while retaining the license notice.
Want to know what to fix on your site?
The badge shows one indicator. Insight checks performance, SEO, accessibility, security and ecology, then orders the fixes.