Grouped Data Calculator
Type your classes and frequencies — one per line, like “10-20, 5” — and get the mean, median, mode, quartiles, variance and standard deviation of grouped data, with the frequency table, the interpolation formulas worked out with your numbers, and a histogram. Free, no sign-up, and nothing leaves your browser.
0 classes read
Enter at least one class with a frequency — for example “10-20, 5” — to see the mean, median, mode and standard deviation.
How to Use the Grouped Data Calculator
- 1. Enter the classes. One class per line: the lower limit, the upper limit and the frequency, separated by a comma, colon or space. A hyphen, en dash or the word “to” works between the limits, so “10-20, 5”, “10 – 20: 5” and “10 to 20 5” are all read the same way.
- 2. Choose how boundaries are treated. If your classes touch (0–10, 10–20) they are used as written. If they leave a gap (10–19, 20–29) the calculator moves each boundary half the gap outward (9.5–19.5) by default, which is what textbooks do for the median. You can switch this off.
- 3. Read the statistics. The cards give the mean, median, mode and sample standard deviation; the table lists the quartiles and the population versions too.
- 4. Follow the working. Every formula is written out with your numbers, so you can check it against your notes or copy the method.
The Formulas for Grouped Data
A grouped table throws away the individual values, so each class is represented by its midpoint x and every value in it is treated as if it equalled x. With frequency f and total frequency n = Σf:
| Statistic | Formula | Notes |
|---|---|---|
| Mean | x̄ = Σfx ÷ n | Each midpoint weighted by its frequency |
| Sample variance | s² = (Σfx² − (Σfx)² ÷ n) ÷ (n − 1) | Divide by n instead for a population |
| Median | L + ((n ÷ 2 − CF) ÷ f) × w | L = lower boundary of the median class, CF = cumulative frequency before it, w = class width |
| Quartile Q1, Q3 | L + ((n ÷ 4 − CF) ÷ f) × w, and 3n ÷ 4 for Q3 | Same idea at the 25% and 75% marks |
| Mode | L + (Δ1 ÷ (Δ1 + Δ2)) × w | Δ1 = f₁ − f₀, Δ2 = f₁ − f₂; f₁ is the modal class frequency, f₀ and f₂ its neighbours |
The median class is the first class whose cumulative frequency reaches n ÷ 2. The formula places the median proportionally inside that class, which is the same as reading it off a cumulative frequency polygon (an ogive). The modal class is the one with the highest frequency; the mode is pulled toward whichever neighbour is taller.
Class Limits Versus Class Boundaries
Class limits are the smallest and largest values a class can hold as recorded: 10–19 and 20–29 for ages in whole years. There is a gap between 19 and 20, so a measured value of 19.6 belongs nowhere. Class boundaries close the gap by splitting it: 9.5–19.5 and 19.5–29.5. The median, quartile and mode formulas use boundaries, because they interpolate along a continuous scale. The midpoint is the same either way, so the mean and standard deviation do not change.
A Worked Example
Click “Try an example” to load five classes of marks out of 50 — 0–10 (3 students), 10–20 (7), 20–30 (12), 30–40 (14) and 40–50 (9) — so n = 45 and the midpoints are 5, 15, 25, 35 and 45.
- Mean: Σfx = 15 + 105 + 300 + 490 + 405 = 1,315, so x̄ = 1,315 ÷ 45 = 29.2222.
- Variance and SD: Σfx² = 44,525, so s² = (44,525 − 1,315² ÷ 45) ÷ 44 = 138.5859 and s = 11.7722. Divided by n instead, the population variance is 135.5062 and the SD is 11.6407.
- Median: n ÷ 2 = 22.5. The cumulative frequencies are 3, 10, 22, 36, 45, so the median class is 30–40, with CF = 22 and f = 14. Median = 30 + ((22.5 − 22) ÷ 14) × 10 = 30.3571.
- Quartiles: Q1 falls at 11.25, in the class 20–30: 20 + ((11.25 − 10) ÷ 12) × 10 = 21.0417. Q3 falls at 33.75, in 30–40: 30 + ((33.75 − 22) ÷ 14) × 10 = 38.3929.
- Mode: the modal class is 30–40 (f₁ = 14), with neighbours 12 and 9. Δ1 = 2 and Δ2 = 5, so the mode is 30 + (2 ÷ 7) × 10 = 32.8571.
The mean (29.2) is below the median (30.4), which is below the mode (32.9) — the order you expect for data with a longer tail toward low marks.
How Accurate Are Grouped Statistics?
They are estimates. Replacing every value by its class midpoint is exact only if values are spread evenly inside each class, so the grouped mean usually lands close to the true mean, and the grouped median and mode are interpolations rather than observed values. For continuous data the variance tends to be slightly overstated; Sheppard's correction subtracts w² ÷ 12 (w being the class width) when the classes are equal and narrow relative to the spread. When you still have the raw data, use the Descriptive Statistics Calculator instead; use this tool when a table is all you have.
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 up those products and divide by the total frequency: x̄ = Σfx ÷ n. For the classes 0–10, 10–20 and so on with frequencies 3, 7, 12, 14 and 9, the products add to 1,315 and the mean is 1,315 ÷ 45 = 29.2222.
- How do you find the median of grouped data?
- Work out n ÷ 2, find the first class whose cumulative frequency reaches it (the median class), then apply L + ((n ÷ 2 − CF) ÷ f) × w, where L is that class's lower boundary, CF the cumulative frequency before it, f its frequency and w its width. The result lies somewhere inside the median class.
- How do you find the mode of grouped data?
- Pick the class with the highest frequency (the modal class) and use L + (Δ1 ÷ (Δ1 + Δ2)) × w, where Δ1 is its frequency minus the previous class's, Δ2 is its frequency minus the next class's, and w is its width. If two classes tie, the calculator reports a mode for each.
- How do you calculate standard deviation from a frequency table?
- Compute the mean, then s² = (Σfx² − (Σfx)² ÷ n) ÷ (n − 1) and take the square root. Use n instead of n − 1 for a population. The calculator shows both so you can match whichever your course expects.
- What is the difference between class limits and class boundaries?
- Limits are the recorded endpoints of a class (10–19, 20–29). Boundaries are the points halfway through the gaps (9.5, 19.5, 29.5) that make the classes continuous. Median, quartile and mode formulas use boundaries; the midpoint, mean and standard deviation are unaffected.
- Why is my grouped mean different from the mean of the raw data?
- Grouping loses information. Every value in a class is treated as if it were at the midpoint, so the grouped mean is only an approximation. The more classes you use, and the more evenly values are spread within each, the closer it gets.
- Can the classes have different widths?
- Yes. The mean, variance, median and quartiles work with any widths. For the mode, the calculator compares frequency density (frequency ÷ width) instead of raw frequency, because a wide class naturally collects more values. It shows a note when it does this.