Home › Calculators › Grouped Data Calculator

Grouped Data Calculator

Enter a grouped frequency table, one class interval and its frequency per line, to estimate the mean, median, mode, quartiles, variance and standard deviation. You get every formula with your numbers, a calculation table with midpoints and cumulative frequencies, and a histogram.

Last updated:

One class per line: lower limit, upper limit and frequency, e.g. 10-19, 4 or 10 to 20: 4 or 10 20 4.

Variance and standard deviation
Enter your values to see the result.
Advertisement
Advertisement

How to use the Grouped Data Calculator

  1. Enter each class on its own line as lower limit, upper limit and frequency, such as 20-29, 9.
  2. Choose population or sample for the variance and standard deviation.
  3. Read the mean at the top and the median, mode and spread below.
  4. Follow the steps to see the median and mode formulas filled in.
  5. Check the calculation table and histogram, then copy the results or download the table as CSV.

Grouped data formulas

StatisticFormulaSymbols
Meanx̄ = Σfm ÷ Σfm = class midpoint, f = frequency
MedianL + ((n/2 − CF) ÷ f) × hL = lower boundary of the median class, CF = cumulative frequency before it, h = class width
ModeL + ((f₁ − f₀) ÷ (2f₁ − f₀ − f₂)) × hf₁ = modal class frequency, f₀ and f₂ = neighbors
Quartile QkL + ((k·n/4 − CF) ÷ f) × hsame as the median, with k = 1 or 3
Population varianceσ² = Σf(m − x̄)² ÷ n = Σfm² ÷ n − x̄²n = Σf
Sample variances² = Σf(m − x̄)² ÷ (n − 1)use when the table is a sample of a larger group

Worked example

Scores of 45 students are grouped as 10–19 (4), 20–29 (9), 30–39 (15), 40–49 (11) and 50–59 (6). The class boundaries are 9.5–19.5, 19.5–29.5 and so on, each 10 wide.

ClassMidpoint mfCumulative ff × m
10–1914.54458
20–2924.5913220.5
30–3934.51528517.5
40–4944.51139489.5
50–5954.5645327
Total451,612.5
  • Mean = 1,612.5 ÷ 45 ≈ 35.83
  • Median: n/2 = 22.5 lies in 30–39 (cumulative 13 before it), so 29.5 + ((22.5 − 13) ÷ 15) × 10 ≈ 35.83
  • Mode: the modal class is 30–39 with f₀ = 9 and f₂ = 11, so 29.5 + (6 ÷ 10) × 10 = 35.5

Tips

  • Open-ended classes such as "60 and over" have no midpoint. Close them with a sensible upper limit before calculating.
  • A mean well above the median suggests the data are skewed to the right; well below suggests a left skew.
  • Use the sample option when your table describes a sample, such as one class out of a whole school, and the population option for complete data.

Frequently asked questions

How do you find the mean of grouped data?

Find the midpoint m of each class, multiply it by the class frequency f, add up all the f × m values and divide by the total frequency: x̄ = Σfm ÷ Σf. It is an estimate, because every value in a class is treated as if it sat at the midpoint.

How do you find the median of grouped data?

Find n ÷ 2 and locate the class whose cumulative frequency first reaches it, the median class. Then use Median = L + ((n/2 − CF) ÷ f) × h, where L is the lower boundary of the median class, CF the cumulative frequency before it, f its frequency and h its width.

What is the formula for the mode of grouped data?

Mode = L + ((f₁ − f₀) ÷ (2f₁ − f₀ − f₂)) × h, where the modal class is the one with the highest frequency f₁, f₀ and f₂ are the frequencies of the classes before and after it, L is its lower boundary and h its width.

How do you calculate the standard deviation of grouped data?

Compute f(m − x̄)² for each class, add them up and divide by n for a population or n − 1 for a sample to get the variance, then take the square root. An equivalent shortcut for the population is σ² = Σfm² ÷ n − x̄².

What are class boundaries and why are they used?

When classes are written with gaps, such as 10–19 and 20–29, the true boundaries sit halfway across the gap at 9.5, 19.5, 29.5 and so on. The median, mode and quartile formulas use these boundaries so that the classes join with no gaps. Midpoints are the same either way.

Why is the grouped mean different from the mean of the raw data?

Grouping throws away the exact values and assumes each one lies at its class midpoint. The result is a close estimate, and it gets more accurate with narrower classes. If you have the raw numbers, a regular mean calculator gives the exact mean.

Can the classes have different widths?

Yes. The mean and standard deviation only need midpoints, and the median and quartiles use the width of the class they fall in. The mode formula uses the width of the modal class, though with very unequal widths the modal class is better judged by frequency density.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

Mean Median Mode CalculatorFind the mean, median, mode, range, min, max, sum and count of a list of numbers.Standard Deviation CalculatorStandard deviation, variance, mean, median, mode and quartiles.Frequency Table GeneratorMake a frequency, relative and cumulative frequency table from numbers or categories.Variance CalculatorSample and population variance and standard deviation with a step-by-step deviations table.Weighted Average CalculatorCalculate a weighted mean from values and weights, step by step.Average CalculatorMean, weighted average, median, sum, min and max of any list.A/B Test Significance CalculatorCheck if your A/B test result is statistically significant.Z-Score CalculatorZ-score from a value, mean and SD, plus percentile and p-value; or the value from z.Probability CalculatorFind and, or, not, conditional and at-least-once probabilities from P(A) and P(B).Permutation and Combination CalculatorCalculate nPr and nCr, with or without repetition, as exact big numbers.Confidence Interval CalculatorConfidence interval and margin of error for a mean or a proportion, with steps.Sample Size CalculatorHow many survey responses you need for a given confidence level and margin of error.Percentile CalculatorValue at any percentile, percentile rank of a score, quartiles, IQR and outliers.Correlation Coefficient CalculatorPearson r and Spearman rank correlation with significance and interpretation.Average Order Value CalculatorAverage order value from revenue and orders, plus the revenue impact of raising AOV.Binomial Distribution CalculatorBinomial probabilities P(X = k), at most, at least or between, with mean, variance and chart.Normal Distribution CalculatorNormal probabilities P(X < x), between two values and inverse percentiles, on a shaded bell curve.Poisson Distribution CalculatorPoisson probabilities for a rate λ: exactly k, at most, at least or between, with a chart.T-Test CalculatorOne-sample, two-sample (Welch/pooled) and paired t-tests with p-value and CI.Chi-Square CalculatorChi-square goodness-of-fit and independence tests with p-value and expected counts.P-Value CalculatorOne- or two-tailed p-values from z, t, chi-square or F statistics, with critical values.Five Number Summary CalculatorMin, Q1, median, Q3, max, IQR and fences of a data set, with a box plot.Outlier CalculatorFind outliers with 1.5×/3× IQR fences, z-scores or modified z-scores; get the cleaned data.Geometric Mean CalculatorGeometric, harmonic, arithmetic and quadratic means compared, or average growth from % changes.Expected Value CalculatorExpected value, variance and standard deviation from outcomes and their probabilities.One-Way ANOVA CalculatorOne-way ANOVA for 2-10 groups: SS, df, MS, F statistic, p-value, effect size and full table.Bayes Theorem CalculatorPosterior P(A|B) from P(A), P(B|A) and P(B|not A), with a probability tree and table.Box Plot MakerPaste data to draw box-and-whisker plots with quartiles, IQR and outliers. Download PNG or SVG.Coefficient of Variation CalculatorCV % from a dataset (sample or population) with mean, SD and a two-dataset comparison.Critical Value CalculatorCritical values of z, t, chi-square and F for any alpha, tails and degrees of freedom.Dice Probability CalculatorOdds of rolling a sum (exactly, at least, at most) with any dice, plus the full distribution.Effect Size Calculator (Cohen's d)Cohen's d, Hedges' g and Glass's delta from two means, SDs and sample sizes, with CI.Histogram MakerPaste numbers, choose bins and get a histogram, frequency table and PNG download.Margin of Error CalculatorSurvey margin of error from sample size, confidence and proportion, with population correction.Moving Average CalculatorSimple, exponential and weighted moving averages of a data series, with table and line chart.Odds Ratio and Relative Risk CalculatorOdds ratio, relative risk, risk difference, 95% CIs and p-values from a 2x2 table.Standard Error CalculatorStandard error of the mean from data or SD and n, plus SE of a proportion, with CIs.Descriptive Statistics CalculatorPaste data and get mean, median, mode, quartiles, SD, skewness, kurtosis and a histogram.Permutations GeneratorList all permutations of letters, words or items, with k-permutations and repeats, and export them.Statistical Power CalculatorPower or required sample size for t-tests, proportions and correlations, with a power curve.T Distribution CalculatorStudent's t probabilities and critical values for any df, with the area shaded on the curve.T-Table (Student's t Distribution)Interactive t-table: critical t-values for any df and α, p-values, and a printable full table.Z-Test CalculatorOne-sample, two-sample and proportion z-tests with z, p-value, decision and shaded curve.Shannon Entropy CalculatorEntropy of text, data or probabilities in bits, nats or hartleys with a frequency table.Empirical Rule Calculator68-95-99.7 rule ranges from a mean and standard deviation, with a shaded bell curve.Z-Table (Standard Normal Table)Interactive z-table: find the area for any z-score, or the z-score for a probability.Average Rate of Change CalculatorAverage rate of change of f(x), two points or a data table over [a, b], with the secant line.Binomial Expansion CalculatorExpand (a + b)^n with the binomial theorem: every term, Pascal coefficients and any specific term.Combinations GeneratorList every k-combination of your items, with or without repetition, and copy or export them.Covariance CalculatorSample and population covariance of paired X and Y data, with a step table and scatter plot.Inverse Normal Distribution CalculatorinvNorm: find the x or z value for a left, right, central or two-tail area, with a shaded curve.
See all 52 Statistics & Probability Calculators →