# CO₂ emissions

> An interactive comparison of who emits the world's CO₂: a squarified treemap of shares and an animated bar ranking that flips between total and per-person emissions.

An interactive comparison in one HTML page. A squarified treemap shows how the world's 38.6 billion tonnes of fossil CO₂ in 2024 split between countries; a ranking below flips between total and per-person emissions, and the bars slide to their new places. The three largest emitters keep their colors throughout, so you can follow them as the order turns over.

## Share of world emissions, 2024

fossil fuels and industry · tile area is the share · hover a tile

## Total vs per person

billion tonnes of CO₂ a year

Total Per person



- **China
- **United States
- **India
- **Other countries
- **World average, 4.7 t

## How the ranking flips

Rank among the 16 largest emitters, total → per person:

**China** #1 → #7 32% of the total, 8.7 t a person

**United States** #2 → #3 13% of the total, 14.2 t a person

**India** #3 → #16 8% of the total, 2.2 t a person

Data table

| Country | Total, Gt | Share of world | Per person, t |
| ------- | --------- | -------------- | ------------- |

## How it's built

- **The treemap** uses the squarified layout: tiles are laid out in rows along the shorter side, and a row grows only while it makes its tiles more square. The algorithm is twenty lines of script; labels are drawn only where a tile has room.
- **The ranking** is an HTML list, not SVG. Each row sits at `translateY(calc(var(--rank) * 2rem))` and each bar at `width: var(--w)`, so the toggle only rewrites two custom properties per row and CSS transitions animate the reorder.
- **Color follows the country**, not its rank: China, the United States and India keep their hue in both modes and in the treemap, and every other country is one neutral gray, so three colors carry the whole story.

Source: [Global Carbon Budget 2025](https://globalcarbonbudget.org/), with population from the UN World Population Prospects, as compiled by [Our World in Data](https://ourworldindata.org/co2-emissions). The EU is counted as one bloc; "Rest of world" includes international aviation and shipping.
