Standard Deviation from Frequency Table
To find the standard deviation from a frequency table, weight each value by its frequency: first find the mean as Σfx ÷ n, where f is the frequency of each value and n is the total frequency. Then work out s = √(Σf(x − x̄)² ÷ (n − 1)) for a sample, or divide by n for a population. For class intervals, use the midpoint of each class as x.
This guide works the method through step by step, with four fully worked examples in which every number has been checked on the free Grouped Data Standard Deviation Calculator. You will see how to work with value–frequency tables and with class intervals, when to divide by n and when to divide by n−1, and how to do the same calculation in Excel. If the basics feel rusty, start with how to calculate standard deviation for a plain list of values.
What Is a Frequency Table?
A frequency table lists each value in a dataset once, next to the number of times it occurs — its frequency, f. Instead of writing out all sixty results of a dice experiment, for example, you record that 1 came up 8 times, 2 came up 11 times, and so on. The table keeps every value and every count, but it is far shorter than the raw list.
Data are grouped into class intervals when there are too many distinct values to list one by one — test scores, heights or times, for instance. Each interval, such as 80–86, is a class, and its frequency is the number of values that fall inside it. You no longer know the individual values inside a class, only how many there are, and that changes how the standard deviation is worked out: every value in the class is treated as if it were the class midpoint.
That makes two kinds of frequency table, and this guide covers both. In a value–frequency table, x is an exact value (2, 4, 6). In a class-interval table, x is the midpoint of each class (5, 15, 25 for the classes 0–10, 10–20, 20–30). The formulas are the same in both cases; only what x stands for changes.
The Formulas
For a value–frequency table, the mean and the two standard deviations are:
- Mean: x̄ = Σfx ÷ n, where n = Σf is the total number of values.
- Sample standard deviation: s = √(Σf(x − x̄)² ÷ (n − 1))
- Population standard deviation: σ = √(Σf(x − x̄)² ÷ n)
Here x is a value, f is its frequency, and fx is the value multiplied by its frequency. Σfx adds up all the fx products, and Σf(x − x̄)² adds up each squared distance from the mean, weighted by its frequency. A frequency of 3 means that value’s squared distance counts three times — that weighting is the whole point of the method. The mean is the balance point of the data, so the table’s mean is a frequency-weighted average, not a plain average of the values.
For a class-interval table, use the midpoint m of each class in place of x:
- Mean: x̄ = Σfm ÷ n
- Sample standard deviation: s = √(Σf(m − x̄)² ÷ (n − 1))
- Population standard deviation: σ = √(Σf(m − x̄)² ÷ n)
The midpoint of a class is the average of its two limits: m = (lower limit + upper limit) ÷ 2. For the class 10–20 the midpoint is 15. The midpoint is a stand-in for every value in the class — a class of 10–20 is treated as if all its values were 15.
The reference definitions of the sample and population standard deviations are set out in the NIST/SEMATECH e-Handbook of Statistical Methods, which defines the standard deviation as the square root of the variance and the sample version with the n − 1 divisor.
How to Find the Standard Deviation from a Frequency Table in 5 Steps
Whatever the table looks like, the calculation follows the same five steps:
Step 1: Build the working table
Add columns for x, f, fx and fx². For class intervals, add a midpoint column m first and use m in place of x. Every row is one value or one class.
Step 2: Add up the frequencies
n = Σf. This is the total number of values in the dataset — the denominator that the mean and the variance both use.
Step 3: Find the mean
x̄ = Σfx ÷ n. Multiply each value by its frequency, add the products, and divide by n.
Step 4: Work out the sum of squares
Σf(x − x̄)² = Σfx² − (Σfx)² ÷ n. This shortcut form saves you from working out every squared distance by hand; it gives exactly the same result as the definition form, as Worked Example 2 shows.
Step 5: Divide and take the square root
Divide the sum of squares by n − 1 for a sample or by n for a population, then take the square root. The result is the standard deviation, in the same units as the data.
Worked Example 1: Class Intervals
Twenty measurements are grouped into three classes:
| Class | f | Midpoint (m) | f × m | f × m² |
|---|---|---|---|---|
| 0–10 | 5 | 5 | 25 | 125 |
| 10–20 | 8 | 15 | 120 | 1,800 |
| 20–30 | 7 | 25 | 175 | 4,375 |
| Total | 20 | — | 320 | 6,300 |
So n = 20, Σfm = 320 and Σfm² = 6,300. The mean is x̄ = 320 ÷ 20 = 16.000.
Now the sum of squares, using the shortcut form: Σf(m − x̄)² = Σfm² − (Σfm)² ÷ n = 6,300 − 320² ÷ 20 = 6,300 − 5,120 = 1,180.
Divide by n for the population value and by n − 1 for the sample value:
- Population: variance = 1,180 ÷ 20 = 59.000, so σ = √59.000 = 7.681.
- Sample: variance = 1,180 ÷ 19 = 62.105, so s = √62.105 = 7.881.
Both figures describe the same twenty measurements. The sample figure is slightly larger because it divides by 19 instead of 20. Run the same classes through the grouped-data calculator and you will see both values, with the full table of midpoints and products.
Worked Example 2: Value–Frequency
Here the values are exact — no classes and no midpoints. The value 2 occurs 3 times, 4 occurs 5 times and 6 occurs 2 times:
| Value (x) | Frequency (f) | f × x | f × x² |
|---|---|---|---|
| 2 | 3 | 6 | 12 |
| 4 | 5 | 20 | 80 |
| 6 | 2 | 12 | 72 |
| Total | 10 | 38 | 164 |
n = 10 and Σfx = 38, so the mean is x̄ = 38 ÷ 10 = 3.800.
The definition form. Work out the squared distance of each value from the mean, weighted by its frequency:
Σf(x − x̄)² = 3 × (2 − 3.8)² + 5 × (4 − 3.8)² + 2 × (6 − 3.8)² = 3 × 3.24 + 5 × 0.04 + 2 × 4.84 = 9.72 + 0.20 + 9.68 = 19.60.
The shortcut form. The same sum of squares comes from Σfx² − (Σfx)² ÷ n = 164 − 38² ÷ 10 = 164 − 144.4 = 19.60. Two routes, one answer — use whichever is faster for the table in front of you.
Divide by 10 for the population value and by 9 for the sample value:
- Population: variance = 19.60 ÷ 10 = 1.960, so σ = √1.960 = 1.400.
- Sample: variance = 19.60 ÷ 9 = 2.178, so s = √2.178 = 1.476.
Check it on the calculator: switch to the value–frequency mode, enter the three values with their frequencies, and both standard deviations appear with the working shown.
Worked Example 3: Dice Rolls
A die is rolled 60 times, and the results are tallied in a frequency table — the classic textbook case, because the mean should come out near 3.5 for a fair die:
| Face (x) | f | f × x | f × x² |
|---|---|---|---|
| 1 | 8 | 8 | 8 |
| 2 | 11 | 22 | 44 |
| 3 | 9 | 27 | 81 |
| 4 | 12 | 48 | 192 |
| 5 | 10 | 50 | 250 |
| 6 | 10 | 60 | 360 |
| Total | 60 | 215 | 935 |
n = 60 and Σfx = 215, so the mean is x̄ = 215 ÷ 60 = 3.5833 — a little above 3.5, as you would expect from one particular set of 60 rolls.
The sum of squares is Σf(x − x̄)² = Σfx² − (Σfx)² ÷ n = 935 − 215² ÷ 60 = 935 − 770.4167 = 164.5833. For a sample, divide by 59: variance = 164.5833 ÷ 59 = 2.7895, so s = √2.7895 = 1.6702. Treating the 60 rolls as the whole group, the population standard deviation is σ = 1.656.
Notice how the table does the heavy lifting: expanding 60 rolls into a list and working out sixty squared distances by hand would take far longer and invite arithmetic slips. Run the dice rolls through the calculator to see the same table and both standard deviations.
Worked Example 4: Grades — Why Grouped Answers Are Estimates
Thirty-six exam scores are grouped into five mark bands:
| Class | f | Midpoint (m) | f × m | f × m² |
|---|---|---|---|---|
| 94–100 | 5 | 97 | 485 | 47,045 |
| 87–93 | 8 | 90 | 720 | 64,800 |
| 80–86 | 12 | 83 | 996 | 82,668 |
| 73–79 | 7 | 76 | 532 | 40,432 |
| 66–72 | 4 | 69 | 276 | 19,044 |
| Total | 36 | — | 3,009 | 253,989 |
n = 36, Σfm = 3,009 and Σfm² = 253,989, so the mean is x̄ = 3,009 ÷ 36 = 83.5833. The sum of squares is Σf(m − x̄)² = 253,989 − 3,009² ÷ 36 = 253,989 − 251,502.25 = 2,486.75. For a sample: variance = 2,486.75 ÷ 35 = 71.050, so s = √71.050 = 8.43. As a population figure the standard deviation is σ = 8.31.
But 8.43 is an estimate, not the exact standard deviation of the 36 grades. The five scores in the 94–100 band might be 94, 95, 97, 99 and 100, or 94, 94, 94, 94 and 100 — the table does not say. The calculation treats all five as if they were 97, the midpoint. Whenever the true values inside a class are spread out, the grouped calculation smooths them away, so the result is close to the true standard deviation but not equal to it. The wider the classes, the rougher the estimate: bands of 20 marks would hide far more variation than bands of 5. Verify the grades on the calculator — it flags that class-interval results are estimates for exactly this reason.
Sample vs Population: n−1 or n?
The only difference between the two standard deviations is the divisor. Use n when the table is the whole group you are describing, and n − 1 when the table is a sample drawn from a larger group:
- Population (σ): divide by n. Use it for a full class of grades, a complete set of recorded rolls, or any table that is the entire group of interest.
- Sample (s): divide by n − 1. Use it when the table is a sample — for example, the grades of 36 students picked from a school of 500 — and you want an unbiased estimate of the population value.
The sample version is always slightly larger, because it divides by the smaller number. For the examples in this guide, the two figures are:
| Example | Population σ | Sample s |
|---|---|---|
| Example 1 — class intervals | 7.681 | 7.881 |
| Example 2 — value–frequency | 1.400 | 1.476 |
| Example 3 — dice rolls | 1.656 | 1.670 |
| Example 4 — grades | 8.31 | 8.43 |
For exam or coursework data, the safe rule is to say which one you used: “sample standard deviation, s = 8.43” leaves no room for a marker to guess. One more check on a different class-interval problem — classes 3–5, 6–8, 9–11, 12–14, 15–17 and 18–20 with frequencies 2, 3, 5, 9, 13 and 5 — gives Σfx = 499, n = 37, a mean of about 13.486 and a population standard deviation of about 4.04.
The Same Calculation in Excel
Excel handles both forms of the table. For a value–frequency table with values in A2:A7 and frequencies in B2:B7:
- Mean: =SUMPRODUCT(A2:A7,B2:B7)/SUM(B2:B7)
- Sample standard deviation: =SQRT(SUMPRODUCT(B2:B7,(A2:A7-D2)^2)/(SUM(B2:B7)-1)) — with the mean in D2.
- Population standard deviation: =SQRT(SUMPRODUCT(B2:B7,(A2:A7-D2)^2)/SUM(B2:B7))
For a class-interval table, put the midpoints in the values column and use the same three formulas. The SUMPRODUCT approach avoids expanding the table: the expanded-list method — typing each value out as many times as its frequency and using =STDEV.S(A2:A61) — works, but for 60 dice rolls it means a 60-cell list where a two-column table does the same job. If you do expand the list, the standard deviation calculator takes the plain list and returns both the population and sample figures. For a plain list of ungrouped values, the site’s Statistics Calculator computes the standard deviation directly from the raw numbers.
Common Mistakes
- Using the class limits instead of the midpoints. In the class 94–100 the value is 97, not 94 and not 100. Using a limit in place of the midpoint skews both the mean and the sum of squares.
- Forgetting to weight by f. The plain average of the midpoints is wrong: in Example 1 the midpoints average to (5 + 15 + 25) ÷ 3 = 15, but the frequency-weighted mean is 16. Every value must be counted as many times as it occurs.
- Dividing by n for a sample. If the table is a sample, the divisor is n − 1. Using n gives the population figure, which understates the spread.
- Treating the grouped estimate as exact. A standard deviation from class intervals is an estimate because the values inside each class are unknown. Report it as an estimate and mind the class width.
- Expanding a long list by hand. Sixty dice rolls do not need sixty lines of working. Build the frequency table first, then work from the table — it is faster and far less error-prone.
Do you divide by n or n−1 for a frequency table?
It depends on what the table is. Divide by n − 1 when the frequency table is a sample from a larger group, giving the sample standard deviation s. Divide by n when the table is the whole group, giving the population standard deviation σ. In Example 1 the two divisors give 7.881 and 7.681 for the same data — so always say which one you used, and check which one a question or a calculator expects.
Why is the standard deviation from grouped data only an estimate?
Because a class interval hides the values inside it. In the grades example the five scores in the 94–100 band are unknown, so the calculation treats all five as 97, the midpoint. If the real scores were 94, 94, 95, 99 and 100, the true standard deviation of the 36 grades would differ slightly from the grouped estimate of 8.43. The estimate gets rougher as the classes get wider.
What is the midpoint of a class interval?
The midpoint is the average of the class’s lower and upper limits: (lower limit + upper limit) ÷ 2. For the class 10–20 the midpoint is 15, and for 94–100 it is 97. In the grouped formulas the midpoint stands in for every value in the class, so it is the x that goes into Σfx and Σfx². Do not use a class limit or the class width in its place.
FAQs
How do you find the standard deviation from a frequency table?
Build a table with columns for x, f, fx and fx². Add the frequencies to get n = Σf, work out the mean as Σfx ÷ n, find the sum of squares Σf(x − x̄)², then divide by n − 1 for a sample or by n for a population and take the square root. For class intervals, use the midpoint of each class as x.
What is the formula for standard deviation from a frequency table?
The sample standard deviation is s = √(Σf(x − x̄)² ÷ (n − 1)) and the population standard deviation is σ = √(Σf(x − x̄)² ÷ n), where x is a value or a class midpoint, f is its frequency and n = Σf. The shortcut form Σf(x − x̄)² = Σfx² − (Σfx)² ÷ n gives the same sum of squares.
How do you find the standard deviation of grouped data with class intervals?
Find the midpoint of each class, then build columns for f, the midpoint m, f·m and f·m². Add the frequencies to get n = Σf and work out the mean as Σf·m ÷ n. Find the sum of squares Σf(m − x̄)² — the shortcut form Σfm² − (Σfm)² ÷ n gives the same result. Divide by n − 1 for a sample or by n for a population, then take the square root.
Do you use n or n−1 when finding the standard deviation from a frequency table?
Use n − 1 when the frequency table is a sample from a larger population, and use n when the table is the whole population. The worked examples show both: the class-interval data, for instance, give a population standard deviation of 7.681 and a sample standard deviation of 7.881, because dividing by the smaller n − 1 gives the slightly larger figure.
What is the midpoint of a class interval?
The midpoint is the average of the class limits: m = (lower limit + upper limit) ÷ 2. For example, the class 0–10 has the midpoint 5, and the class 94–100 has the midpoint 97. The grouped calculation treats every value in the class as if it were the midpoint, which is why the result is an estimate.
Why is the standard deviation from grouped data an estimate?
Because the true values inside each class are unknown. The calculation treats every value in a class as the midpoint, so if the values are spread unevenly within a class the result differs from the standard deviation of the raw data. Wider classes make the estimate rougher; narrower classes bring it closer to the exact figure.
How do you calculate standard deviation from a frequency table in Excel?
Use STDEV.S on the expanded list of values for a sample, or STDEV.P for a population. If you only have the table, not the raw values, use the frequency-weighted form: =SQRT(SUMPRODUCT(B2:B7,(A2:A7-D2)^2)/(SUM(B2:B7)-1)) for a sample, with the values in A2:A7, the frequencies in B2:B7 and the mean in D2. Drop the −1 for the population version. The Excel section of this guide works through both forms.
Can you use a calculator to find the standard deviation from a frequency table?
Yes — use the Grouped Data Standard Deviation Calculator. Enter each value (or class midpoint) with its frequency and it returns the mean, the population and sample standard deviations, and the full working table, so you can check your hand calculation.
Conclusion
To find the standard deviation from a frequency table, build the table first, weight every value by its frequency, and remember that a class interval stands for its midpoint. Work out the mean as Σfx ÷ n, find the sum of squares, then divide by n − 1 for a sample or by n for a population and take the square root. The four worked examples above — class intervals (s = 7.881), a value–frequency table (s = 1.476), dice rolls (s = 1.6702) and grades (s = 8.43) — show the same method at work on different kinds of table, and you can check each one with the standard deviation from a frequency table calculator. For a plain list of values, the standard deviation calculator gives you both the population and sample figures in one step.
Grouped Data Standard Deviation Calculator
Enter values or class midpoints with their frequencies and get the mean, both standard deviations and the full working table.
ToolsTry Calculator →● LiveStandard Deviation Calculator
Mean, variance and standard deviation from your own data, ready for a z-score check.
ToolsTry Calculator →● LiveHow to Calculate Standard Deviation
The step-by-step guide to the standard deviation of a plain list of values, with worked examples and the formulas explained.
GuideRead Article →