Percentages & Everyday Math
Average & Standard Deviation Calculator
Average, median, mode, and sum of a list, plus standard deviation, variance, quartiles, and z-scores.
Result
Example with the values filled in above
Standard deviation (sample)
6.4
Mean 20.3 · Median 19.5 · 8 values
Variance 40.5 · Range 18 · 95% CI: 15.8 to 24.7
| Count | 8 | Number of values entered |
|---|---|---|
| Sum | 162 | Total of all values |
| Mean | 20.3 | Sum divided by count |
| Median | 19.5 | Middle value once sorted |
| Mode | 15 | Appears 2 times |
| Range | 18 | 12 to 30 |
| Variance (sample, n−1) | 40.5 | Divided by 7 |
| Standard deviation (sample) | 6.4 | Square root of the variance |
Change any value and press Calculate for your own result.
Calculating…
Add this calculator to your website
Free to embed on any site, blog, or course page. Paste this where you want it to appear — it adjusts to the width of your column and needs no sign-up.
Share of normally distributed values within 1, 2 and 3 standard deviations
Show the numbers
| Band | Share of values |
|---|---|
| Within 1 SD | 68.27% |
| Within 2 SD | 95.45% |
| Within 3 SD | 99.73% |
How to calculate an average
The average — more precisely the mean — is the sum of all your numbers divided by how many there are. Paste the list above and the summary table gives the mean together with the median, mode, sum, count, and range; the standard deviation tells you how well that one number represents the rest.
mean = (x₁ + x₂ + … + xₙ) ÷ n
For the numbers 12, 15, 20, 7, 9, 18:
- Sum: 12 + 15 + 20 + 7 + 9 + 18 = 81, count 6
- Mean: 81 ÷ 6 = 13.5
- Sorted: 7, 9, 12, 15, 18, 20 → median = (12 + 15) ÷ 2 = 13.5
- Range: 20 − 7 = 13
Two lists can share an average and look nothing alike: 13, 14, 13, 14 and 1, 26, 2, 25 both average 13.5. The first has a standard deviation under 1, the second over 13 — which is why an average on its own is half an answer. Separate values with commas, spaces, or new lines, or paste a spreadsheet column straight in.
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:
| Step | What you do |
|---|---|
| 1 | Find the mean |
| 2 | Subtract the mean from each value |
| 3 | Square each difference |
| 4 | Add the squares together |
| 5 | Divide by n − 1 for a sample, or n for a population |
| 6 | Take 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.
| Use | Divisor | When |
|---|---|---|
| Sample (s) | n − 1 | Your data is a subset you are generalising from — the usual case |
| Population (σ) | n | You 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:
| Value | x − x̄ | (x − x̄)² |
|---|---|---|
| 12 | −8.25 | 68.06 |
| 15 | −5.25 | 27.56 |
| 15 | −5.25 | 27.56 |
| 18 | −2.25 | 5.06 |
| 21 | 0.75 | 0.56 |
| 24 | 3.75 | 14.06 |
| 27 | 6.75 | 45.56 |
| 30 | 9.75 | 95.06 |
| Sum of squares | 283.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
| Measure | What it is | Best when |
|---|---|---|
| Mean | Sum ÷ count | Data is roughly symmetric with no extreme values |
| Median | The middle value once sorted | Data is skewed or has outliers |
| Mode | The most frequent value | Categorical 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-score | Percentile | Meaning |
|---|---|---|
| −2.0 | 2.3% | Well below average |
| −1.0 | 15.9% | Below average |
| 0 | 50% | Exactly average |
| +1.0 | 84.1% | Above average |
| +1.96 | 97.5% | The 95% two-sided cutoff |
| +2.0 | 97.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 level | z 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
| Goal | Formula |
|---|---|
| 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.
To express a difference between two figures as a percentage, use the percentage change calculator. For a grade average weighted by credit hours, the GPA calculator does the weighting for you.
Average & Standard Deviation Calculator — frequently asked questions
How do I calculate the average of a list of numbers?
Add all the numbers together, then divide by how many there are. For 12, 15, 20, 7, 9, and 18, the sum is 81 and the count is 6, so the average (mean) is 81 ÷ 6 = 13.5.
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.