Skip to main content
calclumo

Percentages & Everyday Math

Statistics Calculator

Standard deviation, variance, mean, median, mode, quartiles, z-scores, and confidence intervals.

Paste a list of numbers to get standard deviation, variance, mean, median, mode, quartiles, and a confidence interval.

Result

Enter your numbers and press Calculate to see the result.

Calculating…

Standard deviation, step by step

Standard deviation measures how far values sit from the mean on average. It is the square root of the variance, and the variance is the mean of the squared distances:

StepWhat you do
1Find the mean
2Subtract the mean from each value
3Square each difference
4Add the squares together
5Divide by n − 1 for a sample, or n for a population
6Take the square root

s = √( Σ(x − x̄)² ÷ (n − 1) ) · σ = √( Σ(x − μ)² ÷ n )

Squaring in step 3 is doing real work: it removes the sign so distances above and below the mean do not cancel, and it weights large deviations far more heavily than small ones. That is why a single outlier moves the standard deviation so much.

Sample or population — the n − 1 question

Dividing by n − 1 instead of n is Bessel's correction, and it exists because a sample's own mean is always closer to the sample than the true population mean is. Without the correction, sample variance systematically underestimates the population variance.

UseDivisorWhen
Sample (s)n − 1Your data is a subset you are generalising from — the usual case
Population (σ)nYou have every member of the group, e.g. all 30 students in one class

The gap matters at small n and vanishes at large n. With 5 values the two differ by about 12%; with 500 the difference is under 0.1%. When in doubt, use the sample formula — it is the conservative choice and what statistical software defaults to.

Worked example

For the values 12, 15, 15, 18, 21, 24, 27, 30 — mean 20.25:

Valuex − x̄(x − x̄)²
12−8.2568.06
15−5.2527.56
15−5.2527.56
18−2.255.06
210.750.56
243.7514.06
276.7545.56
309.7595.06
Sum of squares283.50

Sample variance is 283.50 ÷ 7 = 40.50, so s = 6.36. Population variance would be 283.50 ÷ 8 = 35.44, giving σ = 5.95.

Mean, median, and mode

MeasureWhat it isBest when
MeanSum ÷ countData is roughly symmetric with no extreme values
MedianThe middle value once sortedData is skewed or has outliers
ModeThe most frequent valueCategorical data, or finding the most common case

The classic illustration is income. One billionaire in a room of a hundred people moves the mean enormously and the median not at all — which is exactly why income statistics are reported as medians.

A dataset can have no mode, one mode, or several. If every value appears once there is no mode, and reporting one anyway is a common mistake in coursework.

Z-scores

z = (x − mean) ÷ standard deviation

A z-score says how many standard deviations a value sits from the mean, which makes values from different scales directly comparable. A z of +2 means two standard deviations above the mean, whatever the units were.

Z-scorePercentileMeaning
−2.02.3%Well below average
−1.015.9%Below average
050%Exactly average
+1.084.1%Above average
+1.9697.5%The 95% two-sided cutoff
+2.097.7%Well above average

In a normal distribution the 68–95–99.7 rule holds: roughly 68% of values fall within one standard deviation of the mean, 95% within two, and 99.7% within three. This only applies to normally distributed data — for a skewed dataset the proportions can be quite different.

Confidence intervals

CI = mean ± z × (standard deviation ÷ √n)

The term after the ± is the margin of error, built from the standard error — the standard deviation divided by the square root of the sample size.

Confidence levelz value
80%1.282
90%1.645
95%1.960
98%2.326
99%2.576

Because n is under a square root, quadrupling the sample only halves the margin of error. That is why polls tend to stop around 1,000 respondents — the next improvement costs four times as much.

A 95% interval does not mean "95% probability the true mean is in this range". It means that if you repeated the sampling many times, 95% of the intervals produced would contain the true mean. The distinction is pedantic in conversation and important in a statistics exam.

In Excel and Google Sheets

GoalFormula
Sample standard deviation=STDEV.S(A1:A20)
Population standard deviation=STDEV.P(A1:A20)
Sample variance=VAR.S(A1:A20)
Mean / median / mode=AVERAGE(), =MEDIAN(), =MODE.SNGL()
Quartiles=QUARTILE.INC(A1:A20, 1)
Z-score=STANDARDIZE(x, mean, sd)
Margin of error=CONFIDENCE.NORM(0.05, sd, n)

The older =STDEV() and =STDEVP() still work but are ambiguous about which basis they use. Prefer the explicit .S and .P forms.

For a plain mean, median, and range without the dispersion measures, the average calculator is quicker. To express a difference between two figures as a percentage, use the percentage change calculator.

Statistics Calculator — frequently asked questions

Should I divide by n or n-1?

Use n-1 when your data is a sample you are generalising from, which is the usual case. Use n only when you have every member of the group. The correction exists because a sample mean sits closer to its own data than the true population mean does.

How do I calculate standard deviation by hand?

Find the mean, subtract it from each value, square the differences, add them up, divide by n-1 for a sample, then take the square root.

What is the difference between variance and standard deviation?

Standard deviation is the square root of the variance. Variance is in squared units, which makes it hard to interpret; taking the root puts the figure back into the same units as your data.

What does a z-score of 2 mean?

The value sits two standard deviations above the mean, which puts it around the 97.7th percentile in a normal distribution. Z-scores let you compare values measured on completely different scales.

What is the formula for a confidence interval?

Mean plus or minus z times the standard error, where the standard error is the standard deviation divided by the square root of n. For 95% confidence, z is 1.96.

Which Excel function should I use for standard deviation?

STDEV.S for a sample and STDEV.P for a population. The older STDEV and STDEVP still work but are ambiguous about which basis they use.

Related calculators