Math · Statistics
Grouped data calculator.
Enter each class interval and its frequency to estimate the mean, median, mode and range of a grouped frequency table. Your data stays in this browser.
For OpenStax’s test-score frequency table (19 students in eight classes from 50 to 98.5) the best estimate of the mean is Σfm / Σf = 1460.25 / 19 = 76.86. The median falls in the class 74.5 to 80.5 and is estimated at 76.0.
How it works
With only a frequency table, the individual values are unknown, so each class is represented by its midpoint m = (lower + upper) / 2. OpenStax gives the mean of a frequency table as Σfm / Σf, where f is the frequency and m the midpoint of each interval.
The median and mode use common textbook interpolation formulas inside one class (these two are not taken from the sources below): median = L + ((n/2 − CF) / f) × w, where L is the lower limit of the median class (the first class where the cumulative frequency reaches n/2), CF the cumulative frequency before it, f its frequency and w its width; and mode = L + (d1 / (d1 + d2)) × w, where L and w belong to the modal class (highest frequency), d1 is its frequency minus the previous class’s and d2 its frequency minus the next class’s. If two classes tie for the highest frequency no single mode is given. The range estimate is the highest upper limit minus the lowest lower limit, and the standard deviation uses the midpoints with an n − 1 divisor.
Worked example
OpenStax asks for the class mean from Professor Blount’s test: classes 50–56.5, 56.5–62.5, 62.5–68.5, 68.5–74.5, 74.5–80.5, 80.5–86.5, 86.5–92.5, 92.5–98.5 with frequencies 1, 0, 4, 4, 2, 3, 4, 1. The midpoints are 53.25, 59.5, 65.5, 71.5, 77.5, 83.5, 89.5, 95.5, Σfm = 1460.25, n = 19, so the mean is 76.86, matching OpenStax. Half of n is 9.5; the cumulative frequency reaches 9 after the fourth class, so the median class is 74.5 to 80.5 and median = 74.5 + ((9.5 − 9) / 2) × 6 = 76.0. Three classes tie for the highest frequency of 4, so there is no single modal class and the calculator reports the tie instead of a mode. For a second table, classes 0–10, 10–20, 20–30, 30–40 with frequencies 2, 8, 4, 1, the modal class is 10–20 and the mode estimate is 10 + (6 / (6 + 4)) × 10 = 16.
Limits
Every grouped statistic is an estimate; wider classes mean cruder estimates, and open-ended classes (such as “65 and over”) cannot be used. Use class boundaries such as 9.5–19.5 for whole-number data so each value belongs to exactly one class. If you have the raw values, use the statistics calculator instead.
Source, opened 8 October 2026: OpenStax Introductory Statistics 2e, 2.5 Measures of the Center of the Data (midpoint of each interval, mean of a frequency table = Σfm / Σf, and the class-mean example with Σfm = 1460.25 and mean 76.86). The median and mode interpolation formulas are a standard textbook convention and are not stated on that page.
Frequently asked questions
How do you find the mean of grouped data?
Find the midpoint of each class, multiply it by the class frequency, add those products and divide by the total frequency: mean = sum(f x m) / sum(f). For the OpenStax table that is 1460.25 / 19 = 76.86.
How do you find the median of grouped data?
Find the class where the cumulative frequency first reaches n / 2, then interpolate inside it: L + ((n/2 - CF) / f) x w. For the OpenStax table the median class is 74.5 to 80.5 and the estimate is 76.0. This is a textbook convention, not a formula from the cited sources.
How do you find the mode of grouped data?
The modal class is the class with the highest frequency. A common estimate interpolates inside it using the frequencies of its neighbours. When two or more classes tie, there is no single modal class, and the calculator says so.
Why is the answer only an estimate?
A frequency table hides the original values, so each one is treated as if it sat at its class midpoint. The true mean of the raw data can differ.
What format should the classes be in?
One class per line with lower limit, upper limit and frequency, such as "10 20 5" or "10-20 5". Classes must not overlap, so use boundaries like 9.5-19.5 for whole numbers.
Can I use this with raw data?
No, it is built for frequency tables. For raw values use the statistics calculator, or the quartile calculator for quartiles and a box plot.
Learning aid, not for decisions
Educational calculator. Results assume the conditions listed on this page, which real data often only roughly meet. Do not use it for clinical, regulatory, legal or financial decisions.