Frequency Table & Grouped Data Calculator
Build a frequency distribution table and get the grouped mean, median, mode and standard deviation — every step shown.
Computed in your browser — nothing is sentMake a frequency distribution table and find the mean, median and mode of grouped data
| Class | Class boundaries | Midpoint (x) | f | Cum. f | Rel. f | % | x·f |
|---|
Step by step
How grouped data is summarized
Quick answer: to group data, pick the number of classes (Sturges’ rule: k = 1 + 3.322 · log₁₀ n), divide the range by k to get the class width, count how many values fall in each class, and use each class midpoint as its representative. The grouped mean is Σ(midpoint × frequency) ÷ n; the median and mode come from formulas that locate them inside their class. Paste raw data above to build the table automatically, or type in a table your teacher already grouped, and every step is worked out below it.
The table shows each class with its limits and its class boundaries (the real limits, halfway between one class and the next), the midpoint, the frequency, the cumulative frequency, the relative frequency and the percentage — ready to copy into Excel or Word. Textbooks round Sturges’ rule and the class width differently, so you can set the number of classes, the width and the starting point yourself to match yours. Grouped results are approximations that assume values are spread evenly inside each class; with the original list, the mean and standard deviation calculator gives the exact values. Everything runs in your browser.
Grouped data formulas
| Measure | Formula | Where |
|---|---|---|
| Number of classes (Sturges) | k = 1 + 3.322 · log₁₀ n | n = number of values |
| Class width | h = R ÷ k, rounded up | R = max − min |
| Midpoint | x = (lower + upper) ÷ 2 | one per class |
| Mean | x̄ = Σ(x · f) ÷ n | f = class frequency |
| Median | L + ((n/2 − F) ÷ f) · h | L = lower boundary of the median class, F = cumulative frequency before it |
| Mode | L + (d₁ ÷ (d₁ + d₂)) · h | d₁ = f − previous f, d₂ = f − next f, for the modal class |
| Variance | s² = Σ f(x − x̄)² ÷ (n − 1) · σ² = … ÷ n | sample · population |
| n | 1 + 3.322 · log₁₀ n | Rounded | Rounded up |
|---|---|---|---|
| 10 | 4.32 | 4 | 5 |
| 20 | 5.32 | 5 | 6 |
| 30 | 5.91 | 6 | 6 |
| 40 | 6.32 | 6 | 7 |
| 50 | 6.64 | 7 | 7 |
| 100 | 7.64 | 8 | 8 |
| 200 | 8.64 | 9 | 9 |
| 500 | 9.97 | 10 | 10 |
| 1000 | 10.97 | 11 | 11 |
Worked example: 30 test scores
- n = 30, min 45, max 98, so R = 53. Sturges: k = 1 + 3.322 · log₁₀ 30 = 5.91 → 6 classes. Width: 53 ÷ 6 = 8.83 → 9.
- Classes from 45: 45–53, 54–62, 63–71, 72–80, 81–89, 90–98, with frequencies 2, 2, 6, 9, 7, 4.
- Mean: Σ(x · f) = 2271, so x̄ = 2271 ÷ 30 = 75.7.
- Median: n ÷ 2 = 15 falls in 72–80 (cumulative 10 → 19): 71.5 + ((15 − 10) ÷ 9) · 9 = 76.5.
- Mode: modal class 72–80 (f = 9), d₁ = 9 − 6 = 3, d₂ = 9 − 7 = 2: 71.5 + (3 ÷ 5) · 9 = 76.9.
- Variance: Σ f(x − x̄)² = 4452.3, so s² = 4452.3 ÷ 29 = 153.53 and s = 12.39 (sample); σ² = 148.41 and σ = 12.18 (population).
| Class | Boundaries | Midpoint (x) | f | Cum. f | x · f |
|---|---|---|---|---|---|
| 45–53 | 44.5–53.5 | 49 | 2 | 2 | 98 |
| 54–62 | 53.5–62.5 | 58 | 2 | 4 | 116 |
| 63–71 | 62.5–71.5 | 67 | 6 | 10 | 402 |
| 72–80 | 71.5–80.5 | 76 | 9 | 19 | 684 |
| 81–89 | 80.5–89.5 | 85 | 7 | 26 | 595 |
| 90–98 | 89.5–98.5 | 94 | 4 | 30 | 376 |
| Σ | 30 | 2271 |
Common mistakes
| Mistake | Why it is wrong | Instead |
|---|---|---|
| Using class limits in the median formula | The formula needs the lower boundary (71.5), not the limit (72). | Use the boundary, halfway to the previous class. |
| Width = upper − lower limit | 80 − 72 = 8 undercounts; classes are 9 wide. | Width is the distance between boundaries (or between lower limits). |
| F = cumulative frequency of the median class | F must be the cumulative frequency before it. | Take the previous row’s cumulative frequency. |
| Mode = midpoint of the modal class | The midpoint ignores the neighboring classes. | Use L + (d₁ ÷ (d₁ + d₂)) · h. |
| Rounding the width down | The last class ends before the maximum. | Round the width up so every value fits. |
FAQ
How many classes should a frequency table have?
Sturges’ rule is the usual starting point: k = 1 + 3.322 · log₁₀ n. For 30 values that is 5.91, so 6 classes; for 100 values, 8. Some textbooks round up instead of to the nearest whole number — set the number of classes yourself to match yours. Between 5 and 15 classes is typical.
What are class boundaries?
The points halfway between one class and the next: for the classes 45–53 and 54–62, the boundary is 53.5. They close the gaps between classes so every value belongs to exactly one, and they are what the median and mode formulas use. The class width is the difference between boundaries — 9 here, not 53 − 45 = 8.
How do you find the median of grouped data?
Find n ÷ 2, locate the first class whose cumulative frequency reaches it, and apply Median = L + ((n/2 − F) ÷ f) · h, where L is that class’s lower boundary, F the cumulative frequency before it, f its frequency and h the width. In the example: 71.5 + ((15 − 10) ÷ 9) · 9 = 76.5.