Stem and Leaf Plot Generator
Paste your numbers and get a stem and leaf diagram with the key line drawn, plus the median, mode and range read straight off it.
What this tool does
A stem and leaf plot splits each value into a leading part (the stem) and a final digit (the leaf), listing the leaves beside their stem. Unlike a histogram it keeps every original value, so the median and mode can be read directly from the diagram. Every plot needs a key showing what one stem-leaf pair means.
Sorts your values into stems, orders the leaves within each stem, and draws the key line automatically. It then reports n, minimum, maximum, median, mode and range beneath the plot, so the figures a question usually asks for are already worked out.
Split stems and back-to-back mode are both available. Split stems separate leaves 0 to 4 from 5 to 9 when values bunch onto too few stems; back-to-back puts two data sets either side of a shared stem for comparison.
Flags any value more than 1.5 times the interquartile range from the quartiles as a likely outlier and names it, using the same test taught alongside stem and leaf plots on most syllabuses.
Quartiles are worked out by linear interpolation between ranked values, the same method spreadsheet QUARTILE functions use, so a figure checked against Excel or Sheets agrees.
How to use it
- Paste or type your numbers, separated by commas, spaces or new lines.
- Turn on split stems if your data crowds onto only two or three stems and the plot looks lopsided.
- Turn on back-to-back mode and add a second set if you are comparing two groups.
- Read the summary statistics beneath the plot - n, the quartiles, the interquartile range and the mode are all worked out for you.
- Check the note under the statistics: any value further than 1.5 times the IQR from the quartiles is named, which is the usual test for an outlier.
- Export the diagram as SVG or PNG.
Why use this chart maker
Stem-and-leaf plots show shape and every value at once, but sorting, splitting and keying by hand is where marks are lost. This does it correctly and reads off the median, mode and range.
Why we built it
We built the stem and leaf plot generator to draw the key line and include n, minimum, maximum, median and mode. Compare with a histogram and a box plot of the same data.
If your task goes further, try the Dot Plot Maker, the Cladogram Maker and the Matrix Diagram Maker.
Who this tool is for
- Maths students and teachers
- Statistics classes
- Anyone organising a small data set by hand
When to use it
- Maths and statistics homework or exams.
- Showing a small data set's distribution.
- Finding the median and mode quickly.
- Checking a hand-drawn plot.
How a stem and leaf plot is built
Each value is split at the units digit. For two-digit numbers the tens become the stem and the units become the leaf, so 47 is stem 4, leaf 7. Values sharing a stem sit on one row with their leaves listed in order.
The leaves must be sorted within each row - an unsorted plot is not a stem and leaf diagram and will not earn the marks. Sorting is also what makes the median findable by counting inward from both ends.
The key line is not decoration. Without it, 4 | 7 could mean 47, 4.7 or 470. A plot with no key is incomplete, which is why one is always drawn here.
Reading the median and mode from the plot
This is the reason the diagram exists, and it is what a histogram cannot do.
Because every original value survives, the median is found by counting. With n values, count in from each end to position (n+1)/2. If n is even, take the two middle values and average them. Counting from both ends at once and meeting in the middle is faster and less error-prone than counting from one end.
The mode is the leaf value that appears most often overall - read across the rows for repeated leaves on the same stem. If no value repeats, there is no mode, and saying so is the correct answer rather than picking the largest row.
The range is the largest value minus the smallest, both of which sit at the extreme ends of the first and last rows. All of these are calculated for you beneath the plot, but the method is what gets marked in an exam.
When to split the stems
If your values span only a couple of stems, you end up with two enormous rows of leaves and a diagram that shows nothing about the distribution. Splitting divides each stem into two rows: leaves 0 to 4 on the first, leaves 5 to 9 on the second.
As a rule of thumb, aim for roughly five to ten stems. Fewer than five and the shape is hidden; many more and the plot becomes sparse and equally uninformative.
| Situation | What to do |
|---|---|
| Values crowd onto 2 or 3 stems | Split the stems |
| 5 to 10 well-filled stems | Leave as is |
| Many stems with one leaf each | Data may suit a histogram instead |
| Comparing two groups | Use back-to-back mode |
Back-to-back plots
A back-to-back plot shares one column of stems, with one data set's leaves running leftward and the other's running rightward. Because both sets are measured against the same stems, differences in centre and spread are directly visible.
Leaves on the left-hand side are conventionally written with the smallest nearest the stem, so both sides increase outward. That is how they are drawn here.
The summary statistics shown beneath the plot describe the first data set. Swap the sets over if you need the figures for the other one.
Stem and leaf plot vs dot plot vs histogram
All three keep or discard a different amount of detail - matching one to your data avoids losing information you actually need, or drawing a plot too crowded to read.
| Diagram | Keeps original values? | Best for |
|---|---|---|
| Stem and leaf plot | Yes | Multi-digit numeric data, roughly 5 to 120 values |
| Dot plot | Yes | Small data sets, especially with repeated values |
| Histogram | No - frequency only | Large or continuous data where overall shape matters more than individual figures |
A dot plot and a stem and leaf plot both preserve every individual value, but a dot plot suits smaller counts of data, especially where several values repeat exactly - each repeat just stacks another dot at the same position. A stem and leaf plot handles a larger range of multi-digit values more compactly, because it groups them by leading digit rather than plotting each one at its own spot.
A histogram is the right choice once a data set is too large for either to stay readable, because it trades the original figures for a clearer view of the overall shape - the same trade-off covered in the limitations below.
What you give it, and what you get back
| Item | Details |
|---|---|
| Input | Numbers separated by spaces, commas or lines. |
| Output | The plot with a key and n, min, max, median, mode and range. |
| Notes | Stems are in tens. |
Issues you may run into
| What you see | Why it happens | What to do |
|---|---|---|
| Plot is very long or useless | Values span several orders of magnitude. | Use a histogram instead. |
| Decimals look odd | They are rounded to the units digit. | Scale values first (multiply by 10). |
| A row is skipped | It does not match the expected format. | Check the message listing unreadable lines and fix them. |
Assumptions and limitations
- Stems are formed at a fixed unit of ten, which is the convention every syllabus uses. Data spanning several orders of magnitude will not produce a useful plot.
- Values are split at the units digit, so decimals are rounded into that scheme. For decimal data, scale your values first and say so in the key.
- Summary statistics describe the primary data set only. In back-to-back mode, the second set is drawn but not summarised.
- Negative values are placed on negative stems, but mixing positive and negative data in one plot is rarely readable - consider splitting them.
- Very large data sets produce rows too long to read. Past roughly 120 values, a histogram communicates the distribution better.
Frequently asked questions
How do you make a stem and leaf plot?
Split each value into a stem (all digits but the last) and a leaf (the last digit). List the stems in a column, write each value's leaf beside its stem, then sort the leaves within every row. Finally add a key showing what one stem-leaf pair represents.
What is a stem and leaf plot used for?
It shows the shape of a distribution while keeping every original value, so you can read the median, mode and range straight off it. A histogram shows shape too but loses the individual figures, which is why stem and leaf plots persist in school statistics.
How do you find the median from a stem and leaf plot?
Count the values, then count inward from both ends simultaneously until you meet. With an odd count you land on the median; with an even count you land on two middle values and average them. Sorted leaves are what make this work.
What is a back-to-back stem and leaf plot?
Two data sets share a single column of stems, with one set's leaves extending left and the other's right. Because both are read against the same stems, differences in centre and spread between the groups are immediately visible.
What is the key on a stem and leaf plot?
The key states what one stem-leaf pair means - for example 4 | 7 = 47. Without it the reader cannot tell whether the plot shows 47, 4.7 or 470. A plot missing its key is incomplete and normally loses marks.
When should you split the stems?
Split when your values crowd onto only two or three stems, leaving rows too long to interpret. Splitting puts leaves 0 to 4 on one row and 5 to 9 on the next. Aim for roughly five to ten stems overall.
How are the quartiles calculated?
By linear interpolation between the two nearest ranked values - the same method spreadsheet QUARTILE functions use. A figure calculated this way will usually match Excel or Google Sheets exactly, though other valid quartile methods can give a slightly different answer.
Should I use a stem and leaf plot or a dot plot?
Both keep every original value, so the choice comes down to size and repetition. A dot plot suits small data sets, especially where several values repeat exactly, since each repeat just stacks another dot. A stem and leaf plot handles more values and multi-digit numbers more compactly, because it groups them by leading digit instead of plotting each one separately.