Stem-and-Leaf Plot Calculator

StatisticsLast updated: August 22, 2026

Unlike a histogram, a stem-and-leaf plot shows the shape of a distribution without losing the individual observations. Each number is split into a stem (the leading digits) and a leaf (the last digit); writing the leaves that share a stem side by side produces what looks like a histogram on its side, while every raw value remains readable.

This calculator picks the leaf unit automatically from the range of your data (you can also set it yourself), lists the stems including the empty ones, and shows the frequency and cumulative count of each row. It also interprets whether the distribution is symmetric, skewed, unimodal, or multimodal, and draws a histogram for comparison.

Write the numbers separated by commas, spaces, or line breaks. At least 5 observations are required.
The stem unit is ten times the leaf unit. The automatic setting finds the most detailed unit that produces fewer than 15 stems.

How a Stem-and-Leaf Plot Is Built

Leaf unit:        b = 10ᵏ  (chosen from the data range)
Scaled value:     yᵢ = round(xᵢ / b)
Stem:             gᵢ = int(yᵢ / 10)
Leaf:             lᵢ = yᵢ − 10·gᵢ        (0 ≤ lᵢ ≤ 9)
Stem unit:        10·b
Range of a row:   [gᵢ·10·b , (gᵢ+1)·10·b)
Reading:          g | l  =  g·10·b + l·b
Check:            Σ (row frequencies) = n

The leaf unit is chosen as the most detailed power of ten that produces fewer than 15 stems. The leaves in each row are sorted in ascending order, and empty stems are kept as rows so that the diagram preserves its scale.

How to Calculate

  1. Paste your data values into the box; commas, spaces, and line breaks are all accepted.
  2. Leave the leaf unit on automatic, or pick a power of ten that suits your data.
  3. Read each table row as "stem | leaves"; the range-covered column tells you which values that row represents.
  4. Check that the frequency column sums to the number of observations.
  5. Look at the stem where the leaves pile up and at the length of the tails to judge whether the distribution is symmetric or skewed.
  6. Compare the same data with the histogram: the shape should be the same, but the stem-and-leaf plot also keeps the raw values.

Worked Examples

A plot of two-digit measurements

Since the range of the 30 measurements is 74 − 23 = 51, the automatic setting makes the leaf unit 1 and the stem unit 10, producing 6 stems from 2 to 7. The busiest row is 4 | 1 2 3 4 5 6 7 8: 8 observations in the 40–50 range, that is 26.7%. The median is the midpoint of the 15th and 16th leaves, 44.50; with a mean of 45.67 and a skewness of 0.343 the distribution is approximately symmetric.

Number of stems: 6 · Leaf unit: 1 · Stem unit: 10

Decimal data with a leaf unit of 0.1

When a leaf unit of 0.1 is chosen for decimal data, the stem unit becomes 1 and the row 3 | 2 stands for the value 3.2. The 20 measurements spread across 5 stems from 3 to 7; the busiest row is the 5.0–6.0 range (7 observations, 35%). With a median of 5.05 and a mean of 5.07, the distribution is unimodal and approximately symmetric.

Number of stems: 5 · Leaf unit: 0.1 · Stem unit: 1

A wide range with a leaf unit of 10

When the range is 865 − 125 = 740, the leaf unit becomes 10 and the stem unit 100: the row 8 | 7 represents the value 870 (865 rounded). The 20 observations spread across 8 stems from 1 to 8, and the busiest row is the 200–300 range (5 observations, 25%). The mean of 410.25 is clearly larger than the median of 359; with a skewness of 0.619 the distribution is mildly right-skewed.

Number of stems: 8 · Leaf unit: 10 · Stem unit: 100

Frequently Asked Questions

What makes a stem-and-leaf plot better than a histogram?
A histogram shows class frequencies but hides the raw values; a stem-and-leaf plot gives the same shape while preserving every observation. That lets you read the median, the quartiles, and the mode straight off the diagram, and it makes repeated values and data-entry errors stand out. With large data sets, on the other hand, the rows become unreadable, and a histogram is more useful there.
How is the leaf unit chosen?
The aim is to produce between 5 and 15 stems. This calculator looks at the range and picks the most detailed power of ten that satisfies that condition: usually 1 for two-digit data, 0.1 for decimal data, and 10 for three-digit scores. Too few stems flatten the distribution, while too many make the diagram sparse and hide its shape.
Can a leaf have more than one digit?
No, a leaf is always a single digit (0–9). Values are divided by the leaf unit and rounded, so with a leaf unit of 10 the value 248 appears as "2 | 5" and represents 250. This rounding causes a small loss of information; if you need more detail, choose a smaller leaf unit.
Why aren't the empty stem rows removed?
Empty rows preserve the scale of the diagram. Removing them would erase the real distance between two adjacent occupied rows and make the distribution look denser than it is. The gaps also carry information: breaks in the distribution, bimodal structures, and the space before extreme observations all show up in those rows.
Can I compare two groups in the same diagram?
The classic method is the back-to-back stem-and-leaf plot: one group's leaves are written to the left of a shared stem column and the other group's to the right. This calculator produces a diagram for a single group; to compare two groups, run each group separately and place the stem rows side by side, or compare them with a box plot.
How are negative values shown?
Because each value is divided by the leaf unit and rounded down, negative numbers are ordered consistently as well; the value −12, for example, falls into the stem covering −20 to −10. The range-covered column states exactly which values each row represents, so following that column is the safest way to read a diagram of negative data.
How do I read the median and the quartiles off the diagram?
Because the leaves are already sorted, you can count from the start to reach any position you want. When n is odd, the median is the ((n+1)/2)th leaf; when n is even, it is the average of the (n/2)th and (n/2+1)th leaves. The same logic locates the quartiles at positions n/4 and 3n/4; this calculator also reports the results numerically.