Mean, Median, Mode & Standard Deviation Calculator

Mean, median, mode, range, variance and standard deviation — every step shown, plus quartiles and Excel formulas.

100% in your browser — nothing uploaded

Mean, Median, Mode & Standard Deviation Calculator

Scan with a phone camera to open this page

sofritools.com/descriptive-statistics-calculator/

WhatsApp

Find the mean, median, mode, range and standard deviation — with every step shown

Decimals: use a period or a comma — 99.5 or 99,5. Accepts newline, comma, space, or tab separators.

—Count (n)
—Sum
—Mean
—Median
—Mode
—Min
—Max
—Range
—Variance (pop.)
—Variance (sample)
—Std Dev (pop.)
—Std Dev (sample)
—Mean absolute deviation
—Standard error
—Coeff. of variation
—Skewness
—Kurtosis (excess)
—Q1 (25th pctile)
—Q2 (median)
—Q3 (75th pctile)
—Interquartile range

Descriptive statistics in Excel and Google Sheets

Excel and Google Sheets have built-in functions for nearly every descriptive statistic. Put your data in the range A1:A100 (or whatever fits) and use the formulas below.

=COUNT(A1:A100)             Count
=SUM(A1:A100)               Sum
=AVERAGE(A1:A100)           Mean
=MEDIAN(A1:A100)            Median
=MODE.SNGL(A1:A100)         Mode (single)
=MODE.MULT(A1:A100)         Mode (all — array)
=MIN(A1:A100)               Min
=MAX(A1:A100)               Max
=MAX(A1:A100)-MIN(A1:A100)  Range

=AVEDEV(A1:A100)            Mean absolute deviation
=VAR.P(A1:A100)             Population variance (÷n)
=VAR.S(A1:A100)             Sample variance (÷(n−1))
=STDEV.P(A1:A100)           Population std dev
=STDEV.S(A1:A100)           Sample std dev

=QUARTILE.INC(A1:A100,1)    Q1 (25th percentile)
=QUARTILE.INC(A1:A100,2)    Q2 (median)
=QUARTILE.INC(A1:A100,3)    Q3 (75th percentile)

=SKEW(A1:A100)              Skewness (sample)
=KURT(A1:A100)              Kurtosis (excess, sample)
Formulas for A1:A100. In Sheets, KURT is the same; PERCENTILE.INC exists as PERCENTILE.

MODE.MULT returns a vertical array of all modes. In Excel, select several cells in a column, type the formula, and confirm with Ctrl+Shift+Enter (or just Enter in Microsoft 365 with dynamic arrays). In Google Sheets, MODE.MULT does not exist: use =UNIQUE(FILTER(A1:A100, COUNTIF(A1:A100, A1:A100)=MAX(COUNTIF(A1:A100, A1:A100)))).

Descriptive statistics in SQL (PostgreSQL)

PostgreSQL provides aggregate functions for the most common statistics. Given a table data with a numeric column value, this query returns all the indicators in a single row.

SELECT
    COUNT(value)                                    AS n,
    SUM(value)                                      AS total,
    AVG(value)                                      AS mean,
    PERCENTILE_CONT(0.5)  WITHIN GROUP (ORDER BY value) AS median,
    MODE()                WITHIN GROUP (ORDER BY value) AS mode,
    MIN(value)                                      AS min_val,
    MAX(value)                                      AS max_val,
    MAX(value) - MIN(value)                         AS range,
    VAR_POP(value)                                  AS var_pop,
    VAR_SAMP(value)                                 AS var_samp,
    STDDEV_POP(value)                               AS stddev_pop,
    STDDEV_SAMP(value)                              AS stddev_samp,
    STDDEV_SAMP(value) / SQRT(COUNT(value))         AS std_error,
    PERCENTILE_CONT(0.25) WITHIN GROUP (ORDER BY value) AS q1,
    PERCENTILE_CONT(0.75) WITHIN GROUP (ORDER BY value) AS q3
FROM data;
PostgreSQL 9.4+. PERCENTILE_CONT requires a WITHIN GROUP clause. For MySQL, use STDDEV_POP(), STDDEV_SAMP(), VARIANCE(), and VAR_SAMP(); percentiles need a window subquery.

PostgreSQL had no direct MODE() aggregate before version 9.4; since then use MODE() WITHIN GROUP (ORDER BY value). For mode in MySQL, group by value, count, and filter for the maximum.

How to find the mean, median, mode and standard deviation

Quick answer: the mean is the sum divided by how many values there are; the median is the middle value once the data is sorted (the average of the two middle values when the count is even); the mode is the value that appears most often; the range is max minus min; and the standard deviation is the square root of the average squared distance from the mean. Paste your numbers above and the step-by-step panel works each one out the way it is done on paper — the sum, the sorted list, the deviation table — so you can check homework line by line.

Paste or type a list of numbers and get a full descriptive statistics summary: count, sum, mean, median, mode, range, minimum, maximum, mean absolute deviation, population and sample variance, population and sample standard deviation, standard error, coefficient of variation, skewness, kurtosis, and the five-number summary (Q1, Q2, Q3, IQR). You can also upload a CSV file with a single column of numbers.

Every calculation runs locally in your browser — your data never leaves your device. The tool includes ready-to-use Excel and Google Sheets formulas (AVERAGE, MEDIAN, STDEV.S, STDEV.P, QUARTILE.INC) and SQL equivalents (AVG, STDDEV_POP, PERCENTILE_CONT) so you can reproduce the same results in your own workflow.

The formulas

MeasureFormulaWhat it tells you
Mean (x̄)Σx ÷ nThe balance point of the data
MedianThe middle value of the sorted data; the average of the two middle values if n is evenThe center, not pulled by outliers
ModeThe most frequent value — there can be none, or severalThe most typical value
Rangemax − minThe total spread
Mean absolute deviationΣ|x − x̄| ÷ nThe average distance from the mean
Varianceσ² = Σ(x − x̄)² ÷ n (population) · s² = Σ(x − x̄)² ÷ (n − 1) (sample)Spread, in squared units
Standard deviationσ = √σ² · s = √s²Spread, in the data’s own units

Worked example, step by step

  1. Data: 12, 15, 18, 22, 25, 28, 30, 30, 35, 40 (n = 10).
  2. Mean: 255 ÷ 10 = 25.5.
  3. Median: n is even, so average the 5th and 6th values: (25 + 28) ÷ 2 = 26.5.
  4. Mode: 30, the only value that appears twice. Range: 40 − 12 = 28.
  5. Deviations from 25.5 (table below): their absolute values add up to 71 and their squares to 708.5.
  6. Mean absolute deviation: 71 ÷ 10 = 7.1.
  7. Variance: 708.5 ÷ 10 = 70.85 (population) or 708.5 ÷ 9 = 78.72 (sample).
  8. Standard deviation: √70.85 = 8.42 (population) or √78.72 = 8.87 (sample).
xx − x̄|x − x̄|(x − x̄)²
12−13.513.5182.25
15−10.510.5110.25
18−7.57.556.25
22−3.53.512.25
25−0.50.50.25
282.52.56.25
304.54.520.25
304.54.520.25
359.59.590.25
4014.514.5210.25
Σ071708.5

Common mistakes

MistakeWhy it is wrongInstead
Dividing by n for a sampleIt understates the spread of the wider population.Divide by n − 1 (Excel STDEV.S) unless the data is the whole group.
Finding the median without sortingThe middle of an unsorted list is just a random value.Sort first, then take position (n + 1) ÷ 2.
Picking one middle value when n is evenAn even count has two middle values.Average them: (25 + 28) ÷ 2 = 26.5.
Rounding the mean before the deviationsSmall rounding errors add up across every squared deviation.Keep full precision until the final answer.
Reporting the variance as the spreadVariance is in squared units (points², cm²).Report the standard deviation, which is in the original units.
Saying the mode is 0 when nothing repeats“No mode” and “mode = 0” are different answers.If no value repeats, the data has no mode.

Reference tables

FAQ

What is the difference between population and sample standard deviation?

Population standard deviation (σ) divides by N and assumes you have every value in the group. Sample standard deviation (s) divides by N−1 and corrects for the fact that a sample underestimates spread. Use sample when your data is a subset of a larger group — which is almost always the case.

What do skewness and kurtosis tell me?

Skewness measures asymmetry: positive means a right tail, negative means a left tail, zero means symmetric. Kurtosis measures tail heaviness: a value above 3 (excess above 0) means heavier tails than a normal distribution, below means lighter. Together they tell you whether the mean and standard deviation are good summaries or whether outliers dominate.

Can I use this with data from a spreadsheet?

Yes. Copy a column from Excel or Google Sheets, paste it into the input box, and the calculator parses one number per line. You can also upload a CSV file directly.

How do you find the standard deviation step by step?

1) Find the mean. 2) Subtract the mean from each value. 3) Square each difference. 4) Add up the squares. 5) Divide by n for a population or by n − 1 for a sample — that is the variance. 6) Take the square root. For 12, 15, 18, 22, 25, 28, 30, 30, 35, 40: mean 25.5, sum of squares 708.5, sample variance 78.72, sample standard deviation 8.87.

How do you find the median with an even number of values?

Sort the values and average the two in the middle. For 3, 4, 5, 6, 7, 8 the middle pair is 5 and 6, so the median is 5.5. With an odd count there is a single middle value.

What is the mean absolute deviation?

The average distance of the values from the mean, ignoring direction: add up |x − mean| and divide by n. For the example above it is 71 ÷ 10 = 7.1. It is easier to interpret than the standard deviation, which weights large deviations more heavily. In Excel it is AVEDEV.

Related tools