Frequency Distribution Calculator
Paste your data and build a grouped or ungrouped frequency table โ with relative and cumulative frequencies, midpoints and class boundaries.
Sturges: k = 1 + log2(n). For n = 20 that is 6 classes.
Calculation
Grouped frequency table
Each bar is the frequency of one class.
A frequency distribution turns a raw list of numbers into a table that shows how often each value — or each range of values — occurs. It is the first step in almost every descriptive analysis: before you quote a mean or draw a chart, the frequency table tells you where the data pile up and where they thin out.
How to use the frequency distribution calculator
Choose a mode, paste your data and read the table. The calculator does the counting, the relative and cumulative frequencies and the class boundaries for you.
- Paste your data into the box, separated by commas, spaces or line breaks.
- Choose Grouped table or Ungrouped table. Grouped is the default — it suits most real datasets.
- Set the number of classes. Sturges’ rule (k = 1 + log2(n)) is the default; change k to see how the table changes.
- Click Build table and read the table: frequency, relative frequency, cumulative frequency, cumulative %, midpoint and class boundaries.
- Use the bar chart to check the shape at a glance, and copy the link to share your table.
Grouped or ungrouped — which should I use?
An ungrouped table has one row per distinct value. It works when your data take only a few distinct values — dice rolls, survey ratings from 1 to 5, exam marks out of 10. A grouped table collects values into classes (intervals). It is what you need when there are many distinct values, because an ungrouped table then has one row per value and shows no pattern at all.
The worked example on this page makes the point. The 20 values 12 to 33 are all different, so the ungrouped table is 20 rows of 1s. Ungrouped is useless here — that is why we group. The same 20 values grouped into 6 classes show the shape at a glance, and the same data make a much clearer picture as a histogram.
How the classes are built
Three numbers decide a grouped table: how many classes, how wide each class is, and where the edges fall.
- How many classes? Sturges’ rule says k = 1 + log2(n). For n = 20, log2(20) = 4.32, so k = 5.32, rounded up to 6 classes. It uses n only — not the spread — which is why the histogram maker offers Scott and Freedman–Diaconis rules as well: they use the spread, and they give 3 bins for this data instead of 6. The choice of bin width changes the story, and that comparison is the teaching of the histogram page.
- How wide? Class width = (maximum − minimum) ÷ k = (33 − 12) ÷ 6 = 3.5.
- Where do the edges fall? Start at the minimum and add the width: 12, 15.5, 19, 22.5, 26, 29.5, 33. A value goes in the class whose lower edge it reaches — [lower, upper) — except the last class, which also includes the maximum, so 33 sits in 29.5–33 rather than in a class of its own.
Relative vs cumulative frequency
The relative frequency is the share of the data in a class: f ÷ n. The first class holds 3 of the 20 values, so its relative frequency is 3 ÷ 20 = 0.15. Relative frequencies always add to 1 — a quick check that nothing was lost.
The cumulative frequency is the running total as you go down the table: 3, 6, 10, 13, 17, 20. The last row must equal n. The cumulative % is the same running total as a percentage: 15%, 30%, 50%, 65%, 85%, 100%. It answers questions like “what share of the values are below 22.5?” — 50%, straight from the third row.
What are class boundaries?
Class limits are the values printed in the table; class boundaries are the true edges of a class. The convention is: lower boundary = lower limit − 0.5 × gap, and upper boundary = upper limit + 0.5 × gap, where the gap is the distance between successive recorded values. For data written to one decimal place the gap is 0.1, so each boundary sits 0.05 outside its limit: the class 12–15.5 has boundaries 11.95 and 15.55, the class 15.5–19 has boundaries 15.45 and 19.05, and so on through 29.45–33.05 for the last class.
Boundaries matter when you treat the data as continuous — for example, when you work out a standard deviation from a frequency table. The calculator shows them in the last column of the grouped table.
From a frequency table to a standard deviation
A grouped table can stand in for the raw data. Multiply each midpoint by its frequency, add them up and divide by n to estimate the mean: 13.75 × 3 + 17.25 × 3 + 20.75 × 4 + 24.25 × 3 + 27.75 × 4 + 31.25 × 3 = 453.5, and 453.5 ÷ 20 = 22.675 — close to the true mean of 22.5, because grouping rounds every value to its class midpoint. Our guide to the standard deviation from a frequency table works the whole calculation out step by step. For the full summary of the same data — mean, median, mode, SD and quartiles — use the statistics calculator, and for the quartiles themselves the quartile calculator.
Worked examples
Example 1 — grouped table (the worked example)
The 20 values 12, 15, 14, 18, 16, 20, 22, 19, 17, 21, 23, 25, 24, 26, 28, 27, 29, 30, 31, 33 grouped into 6 classes by Sturges’ rule:
| Class | f | Relative f | Cumulative f | Midpoint | Boundaries |
|---|---|---|---|---|---|
| 12 – 15.5 | 3 | 0.15 | 3 | 13.75 | 11.95 – 15.55 |
| 15.5 – 19 | 3 | 0.15 | 6 | 17.25 | 15.45 – 19.05 |
| 19 – 22.5 | 4 | 0.20 | 10 | 20.75 | 18.95 – 22.55 |
| 22.5 – 26 | 3 | 0.15 | 13 | 24.25 | 22.45 – 26.05 |
| 26 – 29.5 | 4 | 0.20 | 17 | 27.75 | 25.95 – 29.55 |
| 29.5 – 33 | 3 | 0.15 | 20 | 31.25 | 29.45 – 33.05 |
The counts 3, 3, 4, 3, 4, 3 are nearly flat — no class dominates. That is no accident: the dataset is deliberately symmetric (the values pair up to sum to 45), so its mean and median are both 22.5 and its sample standard deviation is 6.0914.
Example 2 — ungrouped table (the same 20 values)
Switch the calculator to Ungrouped table with the same data and you get 20 rows — one per value — every frequency 1, every relative frequency 0.05, cumulative frequencies 1, 2, 3, …, 20. Ungrouped is useless here — that is why we group. When every value appears once, the table cannot show where the data pile up; the grouped table and the histogram can.
Example 3 — values with repeats
Ten values with repeats — 1, 1, 2, 2, 2, 3, 3, 3, 3, 4 — are the case ungrouped tables are made for. The ungrouped table has four rows: 1 appears 2 times (relative frequency 0.2, cumulative 2), 2 appears 3 times (0.3, cumulative 5), 3 appears 4 times (0.4, cumulative 9) and 4 appears once (0.1, cumulative 10). The mode is 3. Grouped with Sturges’ rule (k = 5, width 0.6) the same data give classes 1–1.6 (2 values), 1.6–2.2 (3), 2.2–2.8 (0 — an empty class, which still belongs in the table), 2.8–3.4 (4) and 3.4–4 (1).
Frequently asked questions
Grouped or ungrouped — which should I use?
Use an ungrouped table when your data take only a few distinct values — dice rolls, ratings out of 5, exam marks out of 10. Use a grouped table when there are many distinct values. With 20 distinct values in 20 observations, every ungrouped frequency is 1 and the table tells you nothing; grouping into 6 classes shows the shape at a glance. If you want the picture rather than the table, make a histogram from the same data.
What are class boundaries?
Class boundaries are the true edges of a class; class limits are the values printed in the table. For data written to one decimal place, the gap between successive recorded values is 0.1, so a boundary sits half that gap — 0.05 — outside its limit: the class 12–15.5 has boundaries 11.95 and 15.55, and the class 15.5–19 has boundaries 15.45 and 19.05. Boundaries matter when you treat the data as continuous — for example, when you work out a standard deviation from a frequency table.
All examples on this page were recomputed with Python (scipy.stats), last updated 19 November 2026.
See all 91 free statistics tools on Empirical Rule Calculators.
Next steps
๐
โ Live
Histogram Maker
The picture behind the table โ bins, counts and a normal overlay.
Calculator
Try Calculator โ
๐งฎ
โ Live
Statistics Calculator
The full summary of the same data โ mean, median, mode, SD and quartiles.
Calculator
Try Calculator โ
๐
โ Live
Standard Deviation from Frequency Table
Work out the standard deviation straight from a frequency table.
Article
Read Article โ
More Tools to Explore
Keep going with the calculators that pair with the frequency distribution — the histogram, the box plot, quartiles and the full summary.
Histogram Maker
Turn the same data into a histogram — bins, counts and a normal overlay.
Box Plot Maker
Draw a box plot from your data with Tukey or Excel quartile methods.
Quartile Calculator
Find quartiles and the IQR — the numbers behind the box edges.
Standard Deviation Calculator
Work out the spread of your data — sample and population SD, step by step.
Statistics Calculator
The full summary of a dataset — mean, median, mode, SD and quartiles.
Z-Score Calculator
Turn any raw score into a z-score and read off its percentile in seconds.
Explore All Tools→
Browse all 91 free statistics tools — every calculator on this site in one place.