Enter a grouped frequency table, one class interval and its frequency per line, to estimate the mean, median, mode, quartiles, variance and standard deviation. You get every formula with your numbers, a calculation table with midpoints and cumulative frequencies, and a histogram.
Last updated:
One class per line: lower limit, upper limit and frequency, e.g. 10-19, 4 or 10 to 20: 4 or 10 20 4.
Variance and standard deviation
Enter your values to see the result.
Advertisement
Advertisement
How to use the Grouped Data Calculator
Enter each class on its own line as lower limit, upper limit and frequency, such as 20-29, 9.
Choose population or sample for the variance and standard deviation.
Read the mean at the top and the median, mode and spread below.
Follow the steps to see the median and mode formulas filled in.
Check the calculation table and histogram, then copy the results or download the table as CSV.
Grouped data formulas
Statistic
Formula
Symbols
Mean
x̄ = Σfm ÷ Σf
m = class midpoint, f = frequency
Median
L + ((n/2 − CF) ÷ f) × h
L = lower boundary of the median class, CF = cumulative frequency before it, h = class width
Mode
L + ((f₁ − f₀) ÷ (2f₁ − f₀ − f₂)) × h
f₁ = modal class frequency, f₀ and f₂ = neighbors
Quartile Qk
L + ((k·n/4 − CF) ÷ f) × h
same as the median, with k = 1 or 3
Population variance
σ² = Σf(m − x̄)² ÷ n = Σfm² ÷ n − x̄²
n = Σf
Sample variance
s² = Σf(m − x̄)² ÷ (n − 1)
use when the table is a sample of a larger group
Worked example
Scores of 45 students are grouped as 10–19 (4), 20–29 (9), 30–39 (15), 40–49 (11) and 50–59 (6). The class boundaries are 9.5–19.5, 19.5–29.5 and so on, each 10 wide.
Class
Midpoint m
f
Cumulative f
f × m
10–19
14.5
4
4
58
20–29
24.5
9
13
220.5
30–39
34.5
15
28
517.5
40–49
44.5
11
39
489.5
50–59
54.5
6
45
327
Total
45
1,612.5
Mean = 1,612.5 ÷ 45 ≈ 35.83
Median: n/2 = 22.5 lies in 30–39 (cumulative 13 before it), so 29.5 + ((22.5 − 13) ÷ 15) × 10 ≈ 35.83
Mode: the modal class is 30–39 with f₀ = 9 and f₂ = 11, so 29.5 + (6 ÷ 10) × 10 = 35.5
Tips
Open-ended classes such as "60 and over" have no midpoint. Close them with a sensible upper limit before calculating.
A mean well above the median suggests the data are skewed to the right; well below suggests a left skew.
Use the sample option when your table describes a sample, such as one class out of a whole school, and the population option for complete data.
Frequently asked questions
How do you find the mean of grouped data?
Find the midpoint m of each class, multiply it by the class frequency f, add up all the f × m values and divide by the total frequency: x̄ = Σfm ÷ Σf. It is an estimate, because every value in a class is treated as if it sat at the midpoint.
How do you find the median of grouped data?
Find n ÷ 2 and locate the class whose cumulative frequency first reaches it, the median class. Then use Median = L + ((n/2 − CF) ÷ f) × h, where L is the lower boundary of the median class, CF the cumulative frequency before it, f its frequency and h its width.
What is the formula for the mode of grouped data?
Mode = L + ((f₁ − f₀) ÷ (2f₁ − f₀ − f₂)) × h, where the modal class is the one with the highest frequency f₁, f₀ and f₂ are the frequencies of the classes before and after it, L is its lower boundary and h its width.
How do you calculate the standard deviation of grouped data?
Compute f(m − x̄)² for each class, add them up and divide by n for a population or n − 1 for a sample to get the variance, then take the square root. An equivalent shortcut for the population is σ² = Σfm² ÷ n − x̄².
What are class boundaries and why are they used?
When classes are written with gaps, such as 10–19 and 20–29, the true boundaries sit halfway across the gap at 9.5, 19.5, 29.5 and so on. The median, mode and quartile formulas use these boundaries so that the classes join with no gaps. Midpoints are the same either way.
Why is the grouped mean different from the mean of the raw data?
Grouping throws away the exact values and assumes each one lies at its class midpoint. The result is a close estimate, and it gets more accurate with narrower classes. If you have the raw numbers, a regular mean calculator gives the exact mean.
Can the classes have different widths?
Yes. The mean and standard deviation only need midpoints, and the median and quartiles use the width of the class they fall in. The mode formula uses the width of the modal class, though with very unequal widths the modal class is better judged by frequency density.
Are all the tools on FreeToolCabin tested for quality and accuracy?
Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.