About the Frequency Distribution Calculator
This frequency distribution calculator turns a list of raw numbers into a frequency table. Paste your data and it groups the values into classes, counts how many fall in each, and adds the relative frequency (percentage), the cumulative frequency and the cumulative relative frequency for every class, along with a histogram. It also reports the class width, the number of classes, the modal class and the estimated mean from the grouped data.
It is designed for statistics students building frequency tables by hand, teachers summarising test scores, and analysts who need a quick distribution of ages, order sizes, response times or any other numeric variable. Choose automatic grouping (Sturges' rule), set the number of classes yourself, set an exact class width and starting point, or list every distinct value (an ungrouped table) for small discrete data such as dice rolls or number of children.
Classes include their lower limit and exclude their upper limit, except the last class which also includes the maximum. For whole-number data, class limits are shown the way textbooks write them (for example 50–59). Up to 60 classes are shown; values that are not numbers are ignored.
With the default inputs, the number of classes is 5. Change any value above to recalculate instantly.
How to use the frequency distribution calculator
- 1Paste your data values, separated by commas, spaces or new lines.
- 2Choose automatic grouping, a number of classes, a class width and start, or ungrouped values.
- 3Read the frequency table with relative and cumulative columns.
- 4Use the histogram and modal class to describe the shape of the distribution.
Formula and method
A grouped frequency distribution splits the range of the data into k classes of equal width and counts how many values fall in each. With automatic grouping the number of classes comes from Sturges' rule, k = 1 + log₂ n rounded up; the width is the range divided by k, and for whole-number data it is rounded up to a whole number so that classes like 50–59 cover every value. Each class includes its lower limit; the last class also includes the maximum.
Relative frequency divides each count by the total n, and the cumulative columns add the counts (or percentages) from the first class down, so the last row always reaches n and 100%. The grouped mean multiplies each class midpoint by its frequency; it approximates the true mean because it assumes the values in each class are centred on the midpoint.
- n
- Number of data values
- k
- Number of classes
- w
- Class width
- f
- Frequency (count) of a class
Worked examples
25 exam scores in classes of width 10 starting at 50
Classes 50–59, 60–69, 70–79, 80–89 and 90–99 hold 2, 5, 9, 6 and 3 scores. The modal class is 70–79 with 9 of 25 scores (36%), and using midpoints 54.5, 64.5, 74.5, 84.5 and 94.5 the grouped mean is 1,892.5 ÷ 25 = 75.7, close to the true mean of 75.68.
Same scores with Sturges' rule
With n = 25, Sturges gives k = ⌈1 + log₂ 25⌉ = ⌈5.64⌉ = 6 classes. The range 55–94 spans 40 whole numbers, so the width is ⌈40 ÷ 6⌉ = 7: classes 55–61, 62–68, 69–75, 76–82, 83–89 and 90–96 holding 2, 4, 6, 6, 4 and 3 scores, so 69–75 and 76–82 tie as modal classes.
Ungrouped table for 12 dice rolls
Each face gets its own row: 1 appears once, 2 twice, 3 twice, 4 twice, 5 once and 6 four times. The mode is 6 with a relative frequency of 4 ÷ 12 ≈ 33.3%.
Frequently asked questions
How do you make a frequency distribution table?+
Find the minimum and maximum, choose the number of classes (often 5 to 20), compute the class width as range ÷ classes rounded up, list the class limits starting at or below the minimum, then count how many values fall in each class.
How many classes should a frequency distribution have?+
Sturges' rule suggests k = 1 + log₂ n, rounded up: about 6 classes for 25 values, 8 for 100 and 11 for 1,000. Most textbooks recommend between 5 and 20 classes so the shape is visible without too much detail.
What is the difference between relative and cumulative frequency?+
Relative frequency is the share of all values in one class (frequency ÷ n). Cumulative frequency is the running total of frequencies up to and including that class, so it shows how many values are at or below the class upper limit.
How do you calculate class width?+
Divide the range (maximum − minimum) by the number of classes and round up to a convenient number. For whole-number data, rounding up ensures the classes cover every value; for example a range of 39 over 6 classes needs a width of 7.
What is a modal class?+
The modal class is the class with the highest frequency. It plays the role of the mode for grouped data and shows where values are most concentrated.