Stem-and-Leaf Diagrams

Your class sits a test out of 50, and 30 people hand in a scruffy jumble of scores: 34, 21, 45, 38, 21, 50, 29, \ldots A bar chart could show you the shape — where the marks bunch up — but it throws the actual numbers away. A plain list keeps every number but hides the shape. Is there one picture that does both?

There is, and it is beautifully simple: the stem-and-leaf diagram. It sorts a whole set of data into neat rows so you can see its shape at a glance, while still keeping every single original value so you can read any of them back. That "best of both worlds" is exactly why it was invented — more on that below.

Splitting a number into a stem and a leaf

The trick is to chop each number into two parts. The stem is the leading digit(s) — usually the tens; the leaf is the final digit — the units. So 34 becomes stem 3 and leaf 4; 21 becomes stem 2 and leaf 1.

Then you list the stems down the left in a column, and write each number's leaf in its stem's row, in order, smallest first. Numbers that share a stem line up along one row, so a long row instantly tells you "lots of values around here".

One thing more is non-negotiable: a key. On its own, the entry 3 \mid 4 is ambiguous — is it 34, or 3.4, or 340? The key removes all doubt.

Key: 3 \mid 4 means 34.

Worked example 1 — building one from scratch

Here are the times, in seconds, of 12 swimmers doing one length: 34, 21, 45, 38, 21, 29, 40, 33, 27, 45, 31, 45. Let's build the diagram.

Step 1 — find the stems. The tens digits run from 2 to 4, so our stems are 2, 3, 4.

Step 2 — drop each leaf into its row (units digit), just as they come:

StemLeaf (unsorted)
21  1  9  7
34  8  3  1
45  0  5  5

Step 3 — put every row in order, smallest leaf first. This is the step people skip — and it is the step that makes the diagram useful:

StemLeaf (ordered)
21  1  7  9
31  3  4  8
40  5  5  5

Key: 2 \mid 1 means 21 seconds.

Read the rows back and you recover the full sorted list: 21, 21, 27, 29, 31, 33, 34, 38, 40, 45, 45, 45 — not one value lost, and already sorted for you.

Worked example 2 — reading off the averages

Because the diagram is the sorted data, you can read the mode, median and range straight from it. Using the swimmers' diagram above (12 values):

Notice how the ordered diagram made counting to the middle painless — you just walk along the leaves. That is the whole point of insisting the leaves are sorted.

Worked example 3 — a back-to-back diagram

Want to compare two groups? Share the stems down the middle and grow one group's leaves out to the left, the other's out to the right. Here are two swim squads' times:

Squad A (leaves)StemSquad B (leaves)
9  7  124  8
4  3  132  5  9
540  1  6

Key: for Squad A, 1 \mid 2 means 21; for Squad B, 2 \mid 4 means 24.

The left leaves for Squad A read right-to-left (the units nearest the stem is the smallest), so still in order. Squad A's times bunch low (fast!), while Squad B's spread into the forties — you can see the whole comparison in one picture, and still read back every individual time.

Reading the shape at a glance

Turn the diagram on its side and the leaves become bars — a longer row means more values there. That is the second gift of the stem-and-leaf: the outline of the leaves is the shape of the data. In the swimmers' diagram the 4 row is longest, so the times bunch up in the forties, with a thinner tail down in the twenties.

This lets you spot things a lone average would hide: a gap (a stem with no leaves), a lopsided skew (leaves piling up at one end), or an outlier (a lonely leaf far from the rest). You get the summary and the story — and you can still read back every exact number to check.

Two mistakes ruin a stem-and-leaf diagram, and both are easy to make:

The stem-and-leaf plot was popularised by the American statistician John Tukey in the 1970s — the same restlessly inventive mind that gave us the words "bit" (for a binary digit) and "software". He loved displays that let your eye do the thinking, and this one was a favourite: unlike a bar chart, it shows the shape of the distribution while still letting you read back every exact value — a genuinely rare two-for-one.

Tukey saw it as a stepping stone. Blur the leaves into solid bars and you have a histogram; summarise the same sorted data into quarters and you have a box plot. The stem-and-leaf is where you learn to look at a data set — the fancier pictures grow from it.

See it explained