Treemap vs Sunburst: Which Hierarchy Chart to Use
Treemap vs sunburst, compared on the same 2024 world GDP data: what each hierarchy chart shows well, what it hides, and how to pick one.

Treemap vs sunburst is a choice between two ways of drawing the same thing: a total that breaks down into parts, which break down again. A treemap nests rectangles inside rectangles. A sunburst stacks rings around a centre. Neither is better in general. They lose different information, so the right one is the one that loses the part your reader does not need.
To make that concrete, both charts below use the same data: world GDP in 2024 from the World Bank, grouped into seven regions and then into economies.
Treemap vs sunburst: the short answer
Use a treemap when the reader cares about the individual items (which countries, products or folders are biggest) and you have many of them. Use a sunburst when the reader cares about the shape of the hierarchy (which branch dominates, how deep it goes) and the tree is three or more levels deep. If neither the nesting nor the totals matter, use a sorted bar chart.
The same data, drawn twice
Here is the treemap. Every rectangle's area is that economy's share of world GDP, and the coloured frames are the regions.
And here is the sunburst. The inner ring is the region and the outer ring is the economy; a segment's angle is its share. Click a region to zoom into it.
Look at the same three facts in each chart:
- The United States is about a quarter of the world. Its $29.3 trillion is 26% of the World Bank's $111.7 trillion world total. Both charts show this well, as a quarter of the area or a quarter of the circle.
- Germany versus the United Kingdom. In the treemap the two rectangles sit side by side with labels and values, so the comparison ($4.7 trillion vs $3.7 trillion) is easy. In the sunburst they are two arcs on the outer ring, and you are judging angle.
- Sub-Saharan Africa. The whole region is about $2 trillion, under 2% of world GDP. In the treemap it is a small but labelled box. In the sunburst it is a sliver of about 6 degrees, and Angola, at $103 billion, is a third of a degree: present in the data, invisible on screen until you zoom.
That last point is the whole trade-off in one example.
What the two charts have in common
Both charts take a hierarchy (regions containing countries, categories containing products, folders containing files) and encode two things at once:
- Size: each item's share of its parent, as area in a treemap and as angle in a sunburst.
- Structure: which item sits inside which, as nesting in a treemap and as distance from the centre in a sunburst.
Both also take the same data shape: one row per leaf, one column per level of the hierarchy, and a value column. The CSV behind both charts above looks like this:
| Region | Country | GDP 2024 (US$ bn) |
|---|---|---|
| North America | United States | 29298 |
| North America | Canada | 2270 |
| East Asia & Pacific | China | 18730 |
| Sub-Saharan Africa | South Africa | 401 |
How a treemap and a sunburst differ
| Treemap | Sunburst | |
|---|---|---|
| Encodes size as | Rectangle area | Segment angle |
| Encodes depth as | Boxes inside boxes | Rings further from the centre |
| Uses the space | All of it | The centre is empty and outer rings are thin |
| Leaf labels | Fit inside most cells | Rotated, shrunk or dropped |
| Readable depth | About two levels | Three or four levels |
| Small values | Squeezed but present | Slivers that need a zoom |
A treemap spends its pixels on the leaves. A sunburst spends them on the structure. Ben Shneiderman designed the treemap around 1990 to see what was filling a shared hard disk, and published it in ACM Transactions on Graphics in 1992: the question was which files are biggest, a question about leaves. The sunburst came out of John Stasko's group at Georgia Tech, and their own InfoVis 2000 paper is about its main weakness: as a hierarchy grows, many items become small peripheral slices that are hard to tell apart.
When to use a treemap
Use a treemap when the reader's question is about the items themselves: which products carry the revenue, which budget lines cost the most, which economies make up a region.
- Every leaf gets a real area, so it can carry its own label and value without a legend.
- Long lists survive. Fifty leaves in a treemap is busy but readable; fifty leaves on the outer ring of a sunburst is a texture.
- No space is wasted. A treemap fills its rectangle, which matters on a phone and in a report column.
The cost is that nesting gets hard to read past two levels. Three levels of boxes inside boxes all use the same visual device, so readers rely on border weight and colour to tell depth apart. For a step-by-step build, see how to create a treemap.
When to use a sunburst
Use a sunburst chart when the shape of the hierarchy is the finding: how deep the tree goes, which branch dominates, where one parent splits into many children and another does not split at all.
- Depth is unambiguous. Each level is one ring further out, so a four-level tree still reads as four levels.
- Branch size is obvious at a glance. In the GDP sunburst, North America and East Asia & Pacific together take more than half the circle.
- It invites zooming. Clicking a segment to expand that branch is natural on a radial layout, and it is the standard fix for the thin outer ring.
The cost is precision. Outer segments are arcs at different radii, labels have to rotate, and small leaves round to nothing. For a step-by-step build, see how to create a sunburst chart.
What both charts are bad at
- Precise comparison. In Cleveland and McGill's 1984 experiments, people judged position and length more accurately than angle or area. If the reader needs to know that A is 12% bigger than B, use a bar chart.
- Negative values. Area and angle cannot go below zero. Filter negatives out and say so, or use another chart.
- Change over time. Two treemaps side by side are a spot-the-difference puzzle. Show the change itself as bars, or use a stacked bar chart per year.
- Flat data. With only one level, a sunburst is a donut and a treemap is a grid of boxes, and both are harder to read than a pie chart or a bar chart.
- Flows between categories. If the question is where something goes rather than how it splits, a Sankey diagram is the better fit.
How to build either chart in PlotSet
Both charts start from the same table: one row per leaf, a column for each level, and a value column.
- Open the treemap or sunburst template.
- Upload a CSV, paste the rows from your spreadsheet, or link a Google Sheet. From Excel, save the sheet as CSV first.
- Bind the columns: for the treemap, the nesting columns (outermost first) and the size column; for the sunburst, the inner ring, the outer ring and the size column.
- Colour by the top-level branch, not by leaf. Colour should carry the grouping, not repeat the labels.
- Publish an interactive embed with hover values, or export SVG, PNG or JPG.
If you are undecided, build the treemap first. It is the more forgiving of the two, and if the hierarchy is hard to follow in it, that is the signal to switch to a sunburst.
FAQ
What is the difference between a treemap and a sunburst chart?
Both show hierarchical part-to-whole data. A treemap draws each item as a rectangle whose area is its value, nested inside its parent's rectangle. A sunburst draws each level as a ring around a centre, with each segment's angle showing its value.
Is a sunburst chart better than a treemap?
Neither is better in general. A sunburst shows the structure of a deep hierarchy more clearly; a treemap shows the individual items, especially small ones and long lists, more clearly. Pick based on whether your reader cares about the branches or the leaves.
How many levels can a treemap or sunburst show?
A treemap is easiest to read at one or two levels, because deeper nesting uses the same boxes-in-boxes cue. A sunburst stays readable at three or four levels, with the outer rings getting thinner each time.
When should I use a bar chart instead?
When the reader needs precise comparisons, when the data has only one level, or when you are showing change over time. A sorted bar chart is easier to read accurately than either hierarchy chart.
Can I make a treemap or sunburst from Excel data?
Yes. Arrange the data as one row per leaf with a column per level and a value column, save it as CSV, and upload it to the treemap or sunburst template. You can also paste the rows directly.


