Stem and Leaf Plot Generator
Paste a dataset to generate a stem-and-leaf plot with summary stats. Supports back-to-back plots for comparing two datasets side by side.
A stem-and-leaf plot organises data by splitting each number into a stem (all digits except the last) and a leaf (the last digit). Unlike a histogram, it preserves every original value while still showing the shape of the distribution. Paste or type your numbers into this tool and the plot builds instantly, complete with summary statistics.
About Stem and Leaf Plot Generator
How to Read a Stem-and-Leaf Plot
The stem is listed on the left of a vertical bar, and the leaves are listed in order on the right. Each leaf represents one data point. To reconstruct a value, combine the stem with the leaf.
Example dataset: 12, 15, 17, 21, 23, 23, 25, 28, 31, 32, 35, 36, 38, 41, 45
| Stem | Leaves | Values Represented |
|---|---|---|
| 1 | 2 5 7 | 12, 15, 17 |
| 2 | 1 3 3 5 8 | 21, 23, 23, 25, 28 |
| 3 | 1 2 5 6 8 | 31, 32, 35, 36, 38 |
| 4 | 1 5 | 41, 45 |
You can immediately see that the 20s and 30s are the most populated ranges, and the data is roughly symmetric with a slight right tail. The leaf count in each row acts like a horizontal bar chart - the longer the row of leaves, the more data points in that range.
How to Construct a Stem-and-Leaf Plot by Hand
- Sort the data from smallest to largest.
- Decide on stems. For two-digit numbers, the tens digit is the stem and the units digit is the leaf. For three-digit numbers, the first two digits form the stem.
- List all stems from the minimum to maximum in order, even if some have no leaves (this shows gaps in the data).
- Write each leaf next to its stem in ascending order.
- Add a key: "1 | 5 means 15" so the reader knows the scale.
This tool handles all of these steps automatically. It also handles decimal data by adjusting the stem-leaf split appropriately.
Stem-and-Leaf Plot vs Histogram
| Feature | Stem-and-Leaf Plot | Histogram |
|---|---|---|
| Shows individual values | Yes - every data point is visible | No - values are grouped into bins |
| Shows distribution shape | Yes - turn it sideways and it looks like a histogram | Yes - bars show frequency |
| Handles large datasets | Gets unwieldy above ~50-100 values | Works well for any size |
| Finding the median | Easy - count leaves to the middle | Can only estimate from bars |
| Comparing two groups | Back-to-back plot on shared stems | Side-by-side or overlapping bars |
| Precision | Exact values preserved | Precision lost within bins |
| Best for | Small to medium datasets, coursework | Large datasets, publications |
What Is a Back-to-Back Stem-and-Leaf Plot?
A back-to-back plot places two datasets on the same set of stems. One dataset's leaves go to the right (as usual), and the other's go to the left (in reverse order). This makes it easy to compare distributions visually.
Example: Compare test scores from two classes.
| Class A (leaves) | Stem | Class B (leaves) |
|---|---|---|
| 8 5 2 | 5 | 1 4 7 |
| 9 7 3 1 | 6 | 2 5 6 8 |
| 8 6 4 2 0 | 7 | 0 3 5 7 9 |
| 5 3 1 | 8 | 1 4 6 8 9 |
| 2 | 9 | 0 3 5 |
Reading this: Class A has a leaf of 8 on stem 5, meaning a score of 58. Class B has a leaf of 1 on stem 5, meaning 51. You can see at a glance that Class B has more students scoring in the 80s and 90s, while Class A clusters more in the 70s. Switch to back-to-back mode in this tool to create these comparison plots.
Finding the Median from a Stem-and-Leaf Plot
Since all values are visible and in order, finding the median is straightforward. Count the total number of leaves (n), then locate the middle value.
| If n is... | Median position | Example |
|---|---|---|
| Odd | (n+1)/2 th value | 15 values: median is the 8th |
| Even | Average of n/2 and (n/2)+1 th values | 14 values: average of 7th and 8th |
Using the earlier example (12, 15, 17, 21, 23, 23, 25, 28, 31, 32, 35, 36, 38, 41, 45): n = 15, so the median is the 8th value = 28. Count through the leaves: stem 1 has 3 leaves (positions 1-3), stem 2 has 5 leaves (positions 4-8). The 8th value is the last leaf on stem 2, which is 8 - giving 28.
The Mean Median Mode Calculator computes all three central tendency measures directly from raw data if you prefer a numeric approach.
Split Stems for Crowded Plots
When many values share the same stem, the plot becomes hard to read. Split stems solve this by dividing each stem into two (or five) lines:
| Stem Type | Leaves on Each Line | When to Use |
|---|---|---|
| Regular | All digits 0-9 | Data spread across many stems |
| Split (2 lines) | 0-4 on first line, 5-9 on second | Few stems with many leaves |
| Split (5 lines) | 0-1, 2-3, 4-5, 6-7, 8-9 | Very concentrated data |
For example, if all your data falls between 40 and 59, a regular plot would have just two stems (4 and 5). Splitting each stem into two lines gives four rows, showing the distribution shape more clearly.
What the Summary Statistics Tell You
This tool displays several statistics below the plot:
| Statistic | What It Measures | How to Interpret |
|---|---|---|
| Min | Smallest value | Lower boundary of the data |
| Max | Largest value | Upper boundary of the data |
| Range | Max - Min | Total spread of the data |
| Median | Middle value when sorted | Typical value, resistant to outliers |
| Mean | Sum / Count | Arithmetic average, sensitive to outliers |
| Mode | Most frequent value | Most common observation |
| Count | Number of data points | Sample size |
For deeper spread analysis including variance and standard deviation, the Variance Calculator takes the same kind of raw data input. For percentile breakdowns, the Percentile Calculator shows quartiles and the five-number summary.
When to Use a Stem-and-Leaf Plot
| Good Use Cases | Poor Use Cases |
|---|---|
| Homework and exams (easy to draw by hand) | Datasets over 100 values (too many leaves) |
| Quick visual of small datasets | Data with many decimal places |
| Comparing two groups (back-to-back) | Data spanning many orders of magnitude |
| Finding median and mode visually | Publication-quality graphics |
| Identifying outliers at a glance | Continuous probability distributions |
Copying the Plot for Assignments
Click the copy button to get a plain-text version of your plot that pastes cleanly into word processors, Google Docs, or assignment submissions. The output uses monospace formatting so the leaves align properly. Include the key line (e.g., "1 | 5 = 15") to make the plot self-explanatory.
Where Did the Stem-and-Leaf Plot Come From?
The modern stem-and-leaf plot was introduced by American statistician John Tukey in his 1977 book Exploratory Data Analysis, published by Addison-Wesley. Tukey designed it as a quick pencil-and-paper technique that preserves raw values while revealing shape - a middle ground between a sorted list and a histogram. The American Statistical Association still cites Tukey's EDA framework as the origin of the form, and it remains on GCSE, A-Level, AP Statistics, and IB curricula for this reason: it rewards careful data-handling without needing software. The Australian Bureau of Statistics and the UK's Office for National Statistics both use stem-and-leaf displays in introductory training material for new analysts.
Tukey's wider goal was to push statisticians toward looking at data before fitting models. A stem-and-leaf plot does exactly that: you see every value, spot typos instantly, and notice gaps or clusters that a summary statistic would hide. The Standard Deviation Calculator is a natural next step once you are comfortable with the shape of your dataset.
Common Mistakes Students Make
| Mistake | What Goes Wrong | Fix |
|---|---|---|
| Not sorting the leaves | Marks lost on exams - leaves must be in ascending order on each row | Sort the full dataset first, then transfer to the plot in order |
| Skipping empty stems | The distribution shape looks wrong - gaps in the data are invisible | List every stem from min to max, even rows with zero leaves |
| Forgetting the key | Reader cannot tell if "3 | 2" means 32 or 3.2 | Always include a key line such as "3 | 2 = 32" |
| Using multi-digit leaves | Values like 12 as a leaf break the one-digit convention and confuse the reader | Round or truncate so leaves are single digits |
| Reversing the right side on back-to-back | Leaves read inward from the stem - left side is right-to-left, right side is left-to-right | On the left dataset, smallest leaf sits closest to the stem |
Exam boards such as AQA, Edexcel, and the College Board (AP Statistics) all deduct marks for these errors even when the plot is otherwise correct. The ordering convention for back-to-back plots is the trickiest: both sides read outward, so the smallest leaf in each row sits next to the stem.
Handling Decimals and Very Spread Data
Stem-and-leaf plots work best on integers or numbers with one decimal. For decimals, the stem is the whole-number part and the leaf is the tenths digit. For example, 4.2, 4.5, 4.7 give a stem of 4 with leaves 2, 5, 7. The key then reads "4 | 2 = 4.2".
When a dataset spans several orders of magnitude (say, 3 to 3,000), a plain stem-and-leaf plot is the wrong choice - you end up with hundreds of mostly-empty stems. Options include rounding the data to a common scale, using a log transformation before plotting, or switching to a histogram or quartile/percentile breakdown. The Royal Statistical Society's guidance for school teachers recommends capping stem-and-leaf use at about 50 values per dataset - above that the plot becomes harder to read than a histogram.
Using Stem-and-Leaf Plots to Spot Outliers
Outliers stand out clearly on a stem-and-leaf plot: they appear as isolated leaves on stems far from the main cluster. The standard statistical rule, described in NIST's Engineering Statistics Handbook, flags any value more than 1.5 times the interquartile range (IQR) below the first quartile or above the third quartile as a potential outlier. On a stem-and-leaf plot you do not need to calculate anything - you can see the isolated values at a glance.
Worked example: Dataset 14, 15, 17, 18, 21, 22, 23, 24, 25, 89. The 89 sits alone on stem 8 while all other values cluster on stems 1 and 2. Q1 = 17, Q3 = 24, IQR = 7, upper fence = 24 + 1.5 x 7 = 34.5. The value 89 is well above 34.5, confirming it is an outlier worth investigating before running further statistics. For automated detection, the Z-Score Calculator gives a numeric measure of how far each point sits from the mean.
Sources
- UC Berkeley - Histograms and Stem-and-Leaf Plots
- NIST Engineering Statistics Handbook - Quartiles and Outliers
- Australian Bureau of Statistics - Stem and Leaf Plots
- College Board - AP Statistics Course Overview
- Royal Statistical Society - Teaching and Training Resources
- Tukey, J. W. (1977) - Exploratory Data Analysis reference (JSTOR)
All processing runs in your browser. No data is sent to any server.
Frequently Asked Questions
What is a stem-and-leaf plot?
A stem-and-leaf plot organizes data by splitting each number into a stem (all digits except the last) and a leaf (the last digit). It shows the distribution shape while preserving the original values, unlike a histogram.
How do I enter my data?
Paste or type numbers separated by commas, spaces, or newlines. The tool automatically parses them and builds the plot. It handles integers and numbers with one decimal place.
What is a back-to-back stem-and-leaf plot?
It puts two datasets on the same stem, with one dataset's leaves going left and the other going right. This makes it easy to compare two groups visually, like test scores from two classes.
What statistics does it show?
The tool shows minimum, maximum, median, mode, range, count, and mean for each dataset. These summary statistics appear below the plot.
Can I copy the plot for my homework?
Yes. Use the copy button to get a plain-text version of the plot that pastes cleanly into documents or assignments. The formatting works well in monospaced fonts.
Related Tools
Link to this tool
Copy this HTML to link to this tool from your website or blog.
<a href="https://toolboxkit.io/tools/stem-and-leaf-plot/" title="Stem and Leaf Plot Generator - Free Online Tool">Try Stem and Leaf Plot Generator on ToolboxKit.io</a>