Grouped Data Standard Deviation Calculator — Frequency Tables
When data survives only as a frequency table — counts inside class intervals, the raw values lost to history — the standard deviation must be rebuilt from class midpoints, on the working assumption that each class’s values gather at its centre. Enter your midpoints and frequencies, and this calculator returns the grouped mean, variance and standard deviation, sample or population, with every sum the formulas consume shown in the working.
The Midpoint Assumption, Stated Plainly
Grouping destroys information on purpose: a hundred exam marks become four counts, and the individual values are gone. The grouped formulas rebuild the statistics on one explicit fiction — every value in a class is treated as sitting at the class's midpoint — and their accuracy is exactly the fiction's accuracy. For smoothly distributed data the fiction is kind (values above and below the midpoint roughly cancel within each class), and the grouped mean is usually excellent; the grouped variance inherits a small systematic inflation, because the fiction also pretends the spread within each class is zero at the midpoint while spreading classes apart — Sheppard's correction, named in the calculator's note, is the classical repair when the class width is known and the stakes justify it. The calculator prints the standard grouped figures, because those are what examinations, textbooks and archived reports transact in; the prose's job is to keep the assumption visible where the numbers could make it invisible.
Worked Example: Thirty Values in Four Classes
The defaults are the textbook table: classes 0–10, 10–20, 20–30, 30–40 (midpoints 5, 15, 25, 35) with frequencies 5, 8, 12, 5. Totals: n = 30; Σfx = 25 + 120 + 300 + 175 = 620, so the grouped mean = 620 ÷ 30 ≈ 20.667. Σfx² = 125 + 1,800 + 7,500 + 6,125 = 15,550; the variance numerator is 15,550 − 620² ÷ 30 = 2,736.67, and as a sample (divide by 29) the variance ≈ 94.37, SD ≈ 9.71. Read as a population instead (divide by 30) the variance is 91.22 and the SD 9.55 — the n−1 choice moves the answer by about 2% at this size, a gap that shrinks as n grows and that the selector exists to settle by the table's provenance rather than by habit.
Sample or Population: The Provenance Question
The n versus n−1 question is never arithmetic — it is biography. A table of all 214 employees' salaries is a population: divide by n. A table of 214 surveyed households standing for a city is a sample: divide by n−1, Bessel's correction paying for the mean's own estimation error. Archived tables are the hard case, their provenance lost with the report that printed them; the convention in most textbooks is to treat published frequency tables as samples unless the source says "all". The calculator puts the choice in a labelled selector rather than a default nobody notices, because at small n the difference is the largest single decision in the computation — larger than Sheppard's correction, larger than rounding — and it deserves to be made on purpose, in the open.
Reading Someone Else's Table: A Field Checklist
Grouped tables arrive without their raw data or, often, their methods page, so the consumer's checks are worth listing. First, do the frequencies sum to a plausible n — and does that n match the report's claims elsewhere? Second, are the classes contiguous and non-overlapping, with the boundary convention (does 10 belong to 0–10 or 10–20?) stated or inferable? Third, are there open-ended classes, whose midpoints are somebody's guess wearing the table's authority? Fourth, does the grouped mean this calculator returns sit sensibly against any summary the source itself published — a disagreement of more than a rounding error means a transcription, a midpoint or a class boundary has gone wrong somewhere. The calculator computes what it is fed; these four questions are how the feeding earns trust.
Grouped Data and the Normal Model
A common second act for grouped statistics is to stand in for the distribution itself: the grouped mean and SD become the parameters of a fitted normal curve, from which proportions inside intervals are estimated — the percentage of the class above a grade boundary, the share of components outside a tolerance. The pipeline is legitimate and ancient (it is how much of twentieth-century applied statistics was physically done), and its error compounds the midpoint fiction with the normality assumption, in that order of importance: narrow classes make the first error small, and no class width repairs a distribution that was never bell-shaped. Run the calculator, then look at the frequency pattern it summarises before letting the normal model speak for it — a bimodal table's grouped SD is a true number describing a distribution that does not exist.
Why Anything Is Grouped At All
Grouping was born of necessity twice over: computation (a nineteenth-century actuary with ten thousand policies could tally classes but not sum ten thousand squares) and confession (published tables protect the individuals inside them — grouped release is privacy engineering a century before the term). Both parents survive: administrative and census data still reach analysts pre-grouped by law or by archive format, and examination boards still set grouped-data questions because the midpoint method tests whether a candidate understands what a mean is when it cannot be read off a machine. The calculator's role in that lineage is the tally clerk's, perfected: instant, exact on its stated assumption, and loud about the assumption wherever the number appears.
Related Tools
More from the Statistics Calculators hub: the Descriptive Statistics Calculator for the raw-data version of every figure here, and the Relative Error Calculator for measuring the grouping fiction's cost when both versions exist.
Frequently Asked Questions
How do I find the midpoint of a class?
Add the class's lower and upper limits and halve: the class 10–20 has midpoint 15, as in the worked example. For open-ended classes ( "60 and over" ) there is no honest midpoint — the table's tail must be closed by an assumption (a width borrowed from the neighbouring class is the usual convention) and the resulting statistics inherit the guess. Frequency tables with open ends are priced by this calculator only after you supply a midpoint for that class, which is the fiction made conscious rather than hidden.
Why is the grouped SD different from the SD of the raw data?
Because of the midpoint fiction: within each class, real values spread around the midpoint (which the raw SD counts and the grouped SD ignores), while between classes the fiction stretches values to their midpoints exactly. The two effects partly offset, leaving grouped SDs typically close but slightly high — the bias Sheppard's correction (subtract class-width² ÷ 12 from the grouped variance) was designed to remove for well-behaved distributions. Where the raw data survives, use it; grouped statistics are the archaeology of data that no longer does.
What if my classes have unequal widths?
The formulas do not care — midpoints and frequencies are all they read — but interpretation should. Unequal widths usually signal a skewed variable binned sensibly (income classes widening upward), and the midpoint fiction strains hardest in the wide classes, where values are rarely centred. The calculator computes the table as given; a histogram drawn from the same frequencies (with density, not count, on its axis for unequal widths) is the visual audit that keeps the fiction honest.
Can I compute a grouped median or mode here?
Not on this page — grouped medians (by interpolation within the median class) and modal classes are their own instruments with their own conventions, and folding them in would blur this page's single job. The mean and SD computed here are, however, the inputs most grouped-data follow-ups need, including the standardised scores and normal approximations that treat the grouped mean and SD as the distribution's parameters — another place the midpoint fiction propagates, worth knowing before it is quoted.
What does Sheppard's correction do, exactly?
For equally spaced classes of width h and a smooth underlying distribution, the grouped variance overstates the true variance by about h² ÷ 12 (the variance of a uniform distribution across one class width), so the corrected variance = grouped variance − h²/12. In the worked example, h = 10, so the correction would move the sample variance from 94.37 to about 86.0 and the SD from 9.71 to about 9.28. Apply it for smooth, continuous, equal-width tables at fine tolerances; skip it for examination answers, where the uncorrected grouped figure is the expected convention.
How many classes should a frequency table have?
Enough to show the shape, few enough to keep frequencies meaningful — the classic rules of thumb (Sturges' rule and its successors) land most datasets of a few hundred values between about 5 and 15 classes. Since this calculator consumes tables already built, its user's question is the reverse: whether to trust a table built by someone else. A table with two classes has destroyed nearly everything; a table with forty has barely grouped at all. Between those, the midpoint machinery on this page does its honest, slightly approximate work.