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 sent

Frequency Table & Grouped Data Calculator

Scan with a phone camera to open this page

sofritools.com/frequency-table-calculator/

WhatsApp

Make a frequency distribution table and find the mean, median and mode of grouped data

—Total count (n)
—Classes (k)
—Class width (h)
—Mean
—Median
—Mode
—Q1
—Q3
—Variance (sample)
—Std dev (sample)
—Variance (population)
—Std dev (population)
ClassClass boundariesMidpoint (x)fCum. fRel. f%x·f

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

MeasureFormulaWhere
Number of classes (Sturges)k = 1 + 3.322 · log₁₀ nn = number of values
Class widthh = R ÷ k, rounded upR = max − min
Midpointx = (lower + upper) ÷ 2one per class
Meanx̄ = Σ(x · f) ÷ nf = class frequency
MedianL + ((n/2 − F) ÷ f) · hL = lower boundary of the median class, F = cumulative frequency before it
ModeL + (d₁ ÷ (d₁ + d₂)) · hd₁ = f − previous f, d₂ = f − next f, for the modal class
Variances² = Σ f(x − x̄)² ÷ (n − 1) · σ² = … ÷ nsample · population
n1 + 3.322 · log₁₀ nRoundedRounded up
104.3245
205.3256
305.9166
406.3267
506.6477
1007.6488
2008.6499
5009.971010
100010.971111

Worked example: 30 test scores

  1. 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.
  2. Classes from 45: 45–53, 54–62, 63–71, 72–80, 81–89, 90–98, with frequencies 2, 2, 6, 9, 7, 4.
  3. Mean: Σ(x · f) = 2271, so x̄ = 2271 ÷ 30 = 75.7.
  4. Median: n ÷ 2 = 15 falls in 72–80 (cumulative 10 → 19): 71.5 + ((15 − 10) ÷ 9) · 9 = 76.5.
  5. Mode: modal class 72–80 (f = 9), d₁ = 9 − 6 = 3, d₂ = 9 − 7 = 2: 71.5 + (3 ÷ 5) · 9 = 76.9.
  6. Variance: Σ f(x − x̄)² = 4452.3, so s² = 4452.3 ÷ 29 = 153.53 and s = 12.39 (sample); σ² = 148.41 and σ = 12.18 (population).
ClassBoundariesMidpoint (x)fCum. fx · f
45–5344.5–53.5492298
54–6253.5–62.55824116
63–7162.5–71.567610402
72–8071.5–80.576919684
81–8980.5–89.585726595
90–9889.5–98.594430376
Σ302271

Common mistakes

MistakeWhy it is wrongInstead
Using class limits in the median formulaThe formula needs the lower boundary (71.5), not the limit (72).Use the boundary, halfway to the previous class.
Width = upper − lower limit80 − 72 = 8 undercounts; classes are 9 wide.Width is the distance between boundaries (or between lower limits).
F = cumulative frequency of the median classF must be the cumulative frequency before it.Take the previous row’s cumulative frequency.
Mode = midpoint of the modal classThe midpoint ignores the neighboring classes.Use L + (d₁ ÷ (d₁ + d₂)) · h.
Rounding the width downThe 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.

Related tools