Grouped Data Calculator: Mean, Median, Mode and Standard Deviation from a Frequency Table
Estimate the mean of grouped data from class midpoints or class intervals and frequencies, plus the grouped median, mode, quartiles, variance and standard deviation, with a full frequency table, histogram and worked steps.
How it works
Mean ≈ Σ(f × x) ÷ Σf · Median ≈ L + ((N ÷ 2 − CF) ÷ f) × w · Mode ≈ L + (f₁ − f₀) ÷ (2f₁ − f₀ − f₂) × w · Variance = Σf(x − mean)² ÷ N (population) or ÷ (N − 1) (sample), where x is the class midpoint, L the lower class boundary, CF the cumulative frequency before the class, w the class width
When data comes only as a frequency table, such as age bands or income ranges, the original values are lost, so the statistics have to be estimated. The mean treats every observation in a class as if it sat at the class midpoint: multiply each midpoint by its frequency, add the products and divide by the total count. The median uses interpolation inside the class that contains the middle observation (the N ÷ 2-th value): start at that class’s lower boundary and move across it in proportion to how many observations are still needed. Quartiles use the same idea at N ÷ 4 and 3N ÷ 4. The mode starts in the class with the highest frequency and leans toward whichever neighbouring class is larger. The variance and standard deviation use the midpoints too; the population version divides by N and the sample version by N − 1. You can type midpoints directly, or the class intervals themselves (10-20, 20-30 … or 51-55, 56-60 …). For intervals with gaps between them, the calculator uses the true class boundaries halfway across each gap (55.5, 60.5 …). When you enter midpoints, the boundaries are taken halfway between neighbouring midpoints. All results are approximations whose accuracy depends on how evenly values spread within each class.
Worked example
Midpoints 5, 15, 25, 35 and 45 (classes 0–10 to 40–50) with frequencies 4, 8, 12, 9 and 7: Σf = 40 and Σfx = 20 + 120 + 300 + 315 + 315 = 1,070, so the estimated mean is 1,070 ÷ 40 = 26.75. The 20th value lies in the 20–30 class (cumulative frequency 12 before it), so the median ≈ 20 + (20 − 12) ÷ 12 × 10 = 26.6667. The modal class is also 20–30: mode ≈ 20 + (12 − 8) ÷ (24 − 8 − 9) × 10 = 25.7143. Σf(x − mean)² = 5,977.5, so the population standard deviation is √(5,977.5 ÷ 40) = 12.2245 and the sample standard deviation is √(5,977.5 ÷ 39) = 12.38.
Sources: Math is Fun: Grouped frequency mean, median and mode (estimation formulas and worked examples) · Grouped data, Wikipedia
Frequently asked questions
How do I find a class midpoint?
Average the lower and upper limits of the class. For 10–20 the midpoint is (10 + 20) ÷ 2 = 15, and for 51–55 it is 53. You can also enter the intervals directly and let the calculator do it.
Why is the grouped mean only an estimate?
Grouping throws away where each value fell inside its class, so assuming every value sits at the midpoint introduces some error. If values cluster toward one end of the classes, the estimate is pulled away from the true mean.
How do you find the median of grouped data?
Find the class containing the (N ÷ 2)-th value using cumulative frequencies, then interpolate: median = L + ((N ÷ 2 − CF) ÷ f) × w, where L is the lower boundary of that class, CF the cumulative frequency before it, f its frequency and w its width.
How do you find the mode of grouped data?
Take the class with the highest frequency and use mode = L + (f₁ − f₀) ÷ (2f₁ − f₀ − f₂) × w, where f₁ is the modal class frequency and f₀ and f₂ are the frequencies of the classes before and after it.
What are class boundaries?
The points halfway between one class’s upper limit and the next class’s lower limit. For classes 51–55 and 56–60 the boundary is 55.5, so the 56–60 class runs from 55.5 to 60.5 and has width 5. The median and mode use boundaries, not limits.
Should I use the population or sample standard deviation?
Use the population version (÷ N) if the table covers everyone you care about, and the sample version (÷ (N − 1)) if it is a sample from a larger group. Many textbooks use the sample version for survey data.
Related calculators
For education and quick checks: grouped-data figures are estimates, so check the assumptions before using them for decisions.