Stem and leaf plot generator
A stem-and-leaf plot is only complete with its key. The row 20 | 3 5 7 stands for 23, 25 and 27 — but only because the leaf unit is 1, and the same row would be 2.3, 2.5, 2.7 at a leaf unit of 0.1. This generator prints the key, keeps empty stems, splits stems when the plot would otherwise be four rows tall, and says when the values are spread too wide to read back.
Paste a list. Commas, spaces and new lines all work.
Conventions checked against the NIST handbook · How we check
12 values · leaf unit 1
Key: 20 | 3 means 23
| Stem | Leaves | Count |
|---|---|---|
| 20 | 357 | 3 |
| 30 | 128 | 3 |
| 40 | 147 | 3 |
| 50 | 25 | 2 |
| 60 | 1 | 1 |
How to read one
Each row splits a number in two. Everything but the last digit is the stem, on the left; the last digit is the leaf, on the right. A row with six leaves holds six values, so the column of leaves is a bar chart made out of the data — turn the page sideways and the histogram is already drawn.
That is the whole reason the plot survives in teaching after the plotting was automated. A histogram shows the shape and loses the numbers. This shows the shape and keeps them, so a reader can find the median by counting inward from both ends and read the actual value off the row.
Questions people actually ask
- What is the key line for?
- It says what one leaf is worth, and without it the plot means nothing. A row reading 3 | 7 is 37 if the leaf unit is 1, 3.7 if it is 0.1, and 370 if it is 10 — three different data sets, one identical drawing. Every marking scheme asks for the key, and it is the line generators most often leave off.
- Should an empty stem be left in?
- Yes. If nothing falls between 40 and 49 the row stays, blank. Deleting it closes the gap and makes the data look evenly spread when it is not, and a gap in the middle of a distribution is usually the most interesting thing on the plot. This generator keeps every stem between the smallest and the largest.
- When do I split the stems?
- When the plot is only three or four rows tall, which hides the shape the same way a histogram with four bars would. Splitting puts leaves 0-4 on one row and 5-9 on the next, doubling the resolution without changing the data. This page splits automatically below five stems and lets you force it either way.
- How do I handle decimals?
- Set the leaf unit to 0.1 and the last digit becomes the leaf: 12.4 is stem 12, leaf 4. The generator picks that automatically from the precision of what you paste, so a list of one-decimal values gets a leaf unit of 0.1 without being asked.
- What about negative numbers?
- They work, and the stems run from the most negative upward. Be aware that the convention makes −23 sit on stem −30 with leaf 7, because the stem is the block of ten below the value. Some textbooks instead write a separate negative section with leaves counting away from zero; check which one your course uses.
- When is a stem-and-leaf plot the wrong choice?
- When the data spans more than about two orders of magnitude. At that point one leaf can no longer hold the last digit, several values collapse onto the same stem and leaf, and the plot stops being a record of the numbers. This page says so when it happens; a histogram is the right drawing there.