Enter each class midpoint with its frequency. If your data is a frequency table of individual values rather than intervals, enter the values themselves as the midpoints — the arithmetic is identical and the result is then exact rather than an estimate.
| Midpoint (x) | Frequency (f) | Remove |
|---|---|---|
For class intervals such as 10–19, enter the midpoint (14.5). Frequency is how many observations fall in that class.
Show the working, step by step
The formula
x̄ = Σfx / Σf Sample: s = √[ Σf(x − x̄)² / (Σf − 1) ] Population: σ = √[ Σf(x − x̄)² / Σf ]
Every term is the ordinary standard deviation formula with a frequency multiplier attached. A class with a frequency of 12 contributes its squared deviation twelve times over, and n becomes the total frequency Σf rather than the number of rows.
A worked example
Test scores recorded as a grouped frequency table:
| Class | Midpoint x | f | fx |
|---|---|---|---|
| 0–9 | 4.5 | 3 | 13.5 |
| 10–19 | 14.5 | 7 | 101.5 |
| 20–29 | 24.5 | 12 | 294.0 |
| 30–39 | 34.5 | 6 | 207.0 |
| 40–49 | 44.5 | 2 | 89.0 |
| Total | — | 30 | 705.0 |
The mean is 705 ÷ 30 = 23.5. Each class then contributes f(x − 23.5)²: 3(19)² = 1083, 7(9)² = 567, 12(1)² = 12, 6(11)² = 726 and 2(21)² = 882. Those total Σf(x − x̄)² = 3270. As a sample the variance is 3270 ÷ 29 = 112.759 and the standard deviation is 10.6188; as a population it is 3270 ÷ 30 = 109, giving 10.4403. Those figures are loaded into the calculator above.
Getting the midpoints right
Most errors on grouped data come from the midpoints rather than the arithmetic.
| Class as written | Reading | Midpoint |
|---|---|---|
| 10–19 | Discrete, gap to next class | 14.5 |
| 10–20, 20–30 | Continuous, upper bound excluded | 15, 25 |
| 10 ≤ x < 20 | Explicit, unambiguous | 15 |
| Under 10 | Open-ended — see below | assume a bound |
Open-ended classes such as "under 10" or "60 and over" have no midpoint. The usual workaround is to give them the same width as the neighbouring class and take the midpoint of that, but this is a guess, and the standard deviation is sensitive to it because the invented midpoint sits far from the mean and is then squared. Say so if you do it.
How far off is a grouped estimate?
Placing every observation at its class midpoint deletes all the variation inside each class, which pushes the standard deviation down. The effect is small when classes are narrow relative to the overall spread, and grows as they widen.
Sheppard's correction subtracts h²/12 from the variance, with h the class width, to compensate for the discarded within-class spread. It assumes a smooth distribution and classes of equal width, and it is not standard practice in most courses. If you have the raw data, use the ordinary calculator — grouping is a compromise for when the original values are genuinely unavailable, not something to do by choice.
Related calculators
-
Standard deviation calculator
Use this instead if you still have the raw values.
-
Weighted SD
For reliability weights rather than frequency counts.
-
Mean, median, mode
The rest of the summary from a list of values.
-
The formula explained
How the frequency version relates to the ordinary one.
Common questions
How do I find the midpoint of a class interval?
Add the lower and upper boundaries and halve. For 10–19 that is (10 + 19)/2 = 14.5. For a continuous class written 10–20 where 20 belongs to the next class, use (10 + 20)/2 = 15.
Be consistent about which convention the data uses, because mixing them shifts every midpoint by half a unit and quietly biases the mean.
Why is grouped data only an estimate?
Because the raw values are gone. The method assumes every observation in a class sits exactly at the midpoint, when in reality they are spread across the interval. That assumption removes the within-class variation, so a grouped standard deviation typically comes out slightly smaller than the true one.
Sheppard's correction — subtracting h²/12 from the variance, where h is the class width — partially compensates. It is rarely applied in practice and this calculator does not apply it.
What is n for grouped data?
The total frequency, Σf — not the number of rows. A table with 5 classes and frequencies 3, 7, 12, 6, 2 has n = 30, so a sample calculation divides by 29.
Do I use n or n − 1 for grouped data?
The same rule as for raw data: Σf − 1 if the data is a sample, Σf if it is the whole population. Textbook exercises frequently use the population form without saying so, which is a common source of small discrepancies against a printed answer.