Statistics & Standard Deviation Calculator

Calculate sample SD (s), population SD (σ), variance, mean, median, IQR, and Z-score with a frequency histogram.

Sample Mean (x̄) & Sample Standard Deviation (s) x̄ = 24.2222 • s = 9.2436 n = 9 observations • Median = 22 • Population σ = 8.715
Median & IQR (Q3 − Q1) 22 (IQR: 11)
Sample Variance (s²) 85.4444
Min / Max (Range) 12 to 41 (29)
Inputs
Try:
Enter at least 2 numeric observations separated by commas or spaces.
Computes how many sample standard deviations x is from the mean.
Results & Graph
Sample Mean (x̄) & Sample Standard Deviation (s)
x̄ = 24.2222 • s = 9.2436
n = 9 observations • Median = 22 • Population σ = 8.715
Median & IQR (Q3 − Q1)
22 (IQR: 11)
Sample Variance (s²)
85.4444
Min / Max (Range)
12 to 41 (29)
Z-Score for x = 29
0.517 σ

Dataset Frequency Histogram (5 Equal-Width Bins)

Distribution of 9 observations from 12 to 41
Graph 1 • Sorted Dataset Observations vs. Sample Mean (x̄) n = 9 observations
0 0.8 1.5 2.3 3 12–17.817.8–23.623.6–29.429.4–35.235.2–41
Graph 2 • Normal Distribution Bell Curve (x̄ ± 1s, ±2s, ±3s) 68.2% within ±1s, 95.4% within ±2s, 99.7% within ±3s
Mean x̄ = 24.22 (s = 9.24) −1s (15.0) x̄ (24.2) +1s (33.5) −2s (5.7) +2s (42.7)
Graph 3 • 5-Number Summary Box-and-Whisker Plot (Min, Q1, Median, Q3, Max) Visualizes median, quartile spread (IQR), and skewness
Min: 12 Q1: 18 Median: 22 Q3: 29 Max: 41 Interquartile Range (IQR = Q3 − Q1) = 11.00 • Range = 29.00
Summary: Dataset of 9 values has mean 24.22, median 22, and sample SD 9.24.
Summary: Across n = 9 values (sum = 218), the arithmetic mean is 24.2222 and the median is 22. The sample standard deviation is s = 9.2436 (population σ = 8.715), and the interquartile range (Q3 − Q1) is 11.
Interactive chart & math engine powered by CalculatorGraph

Formula: Sample (Bessel-Corrected) vs. Population Standard Deviation

x̄ = 1n n∑i=1 xi,   s = n∑i=1 (xi − x̄)2n − 1,   σ = n∑i=1 (xi − x̄)2n,   Z = x − x̄s
x̄ = (1/n) Σ x_i; s = √[ (1/(n−1)) Σ (x_i − x̄)² ]; σ = √[ (1/n) Σ (x_i − x̄)² ]; Z = (x − x̄) / s
  • n: Number of observations in the dataset
  • s: Unbiased sample standard deviation using Bessel’s correction (n − 1)
  • σ: Population standard deviation using denominator n

Rounding: Summary statistics round to 4 decimal places.

Worked example: 9-Observation Dataset: 12, 15, 18, 22, 22, 25, 29, 34, 41

Compute mean, median, sample SD, and population SD for the 9 values.

  1. Sum = 218 → Mean x̄ = 218 ÷ 9 = 24.2222.
  2. Sorted middle (5th) observation → Median = 22.
  3. Sum of squared deviations Σ(x_i − x̄)² = 683.5556.
  4. Sample SD s = √(683.5556 ÷ 8) = 9.2436; Population SD σ = √(683.5556 ÷ 9) = 8.7150.
Result: Mean = 24.2222, Median = 22, Sample SD (s) = 9.2436, Population SD (σ) = 8.7150.

Frequently Asked Questions

When should I use Sample Standard Deviation (s) vs. Population Standard Deviation (σ)?

Use Sample SD (s, dividing by n − 1) whenever your numbers represent a sample drawn from a larger population (the standard in scientific research and quality control). Use Population SD (σ, dividing by n) only when your dataset contains every member of the entire population.

Why does my textbook answer for the default list differ from the tool?

Check the divisor first. The headline s divides by n minus 1, giving 9.2436, while dividing by n gives 8.715. Then check rounding: the tool keeps four decimal places, so a hand calculation that rounds the mean to 24.2 early will drift slightly. Quartiles can also differ by method. Squaring the deviations from 24.2222 and adding them, then dividing by 8, should give 85.4444.

Can I paste numbers with thousands separators?

Not safely. Commas are treated as separators, so a value written with a thousands comma is broken into two separate numbers. The tool will not warn you; the count and every statistic will simply be wrong. Strip the formatting first, or copy the raw values from a spreadsheet column, where each number arrives on its own line with no commas.

What is the smallest dataset the tool accepts?

Two numbers. With only one, the sample variance would divide by zero, so the tool refuses and asks for at least two. With two values the results are valid but rough: 10 and 20 give a mean of 15, s of 7.0711 and sigma of 5. Very small samples give standard deviations that can change a lot with each new value.

Does the Z-score assume my data is normally distributed?

The calculation itself does not. It only measures how many sample standard deviations a value sits from the mean, which is 0.517 for 29 in the default list. The assumption arrives when you turn a Z-score into a probability or a percentile, since that step uses the normal curve. For skewed or tiny datasets, treat the Z-score as a distance, not a probability.

Is a value with a Z-score above 2 an outlier?

It is far from the mean, but whether it counts as an outlier depends on the rule you follow. In the default list, 44 scores 2.14. Some people flag anything beyond 2, others beyond 3, and many prefer an IQR fence because the mean and s are themselves pulled toward extreme values. Look at the data and its source before discarding anything.

Why is there no mode in the results?

The tool reports mean, median, quartiles, range and spread, but it does not count repeated values. For the default list the only value that appears twice is 22, so the mode is 22, which matches the median by coincidence. For a long list, sort it in a spreadsheet and count repeats, or use a frequency table.

How should I report the results in a lab write-up?

State n, the mean and s together, for example mean 24.2222 with s 9.2436 and n of 9, then round to a sensible number of figures for your measurements. Say that s uses n minus 1. If the data is skewed or has an outlier, add the median and IQR, since readers can then see how much the extremes shift the picture.

What does the sample variance tell me that s does not?

The same spread, in squared units. For the default list it is 85.4444, which is 9.2436 squared. Variance is what you add when combining independent sources of variation and what many statistical tests work with. Standard deviation is easier to read because it is in the original units, so a spread of about 9 sits beside values of 12 to 41.

Why do the histogram bins have odd edges like 17.8?

The tool divides the range into five equal widths starting at the minimum. The default range is 29, so each bin is 5.8 wide, starting at 12 and giving edges at 17.8, 23.6 and so on. The edges are not rounded to tidy numbers. Changing the smallest or largest value changes the width of every bin.

Can I mix negative numbers and decimals?

Yes. A list such as 1.5, 2.25, minus 3 and 10 gives a mean of 2.6875 and s of 5.3982. Type negatives with a normal minus sign directly before the digit. Avoid symbols such as percent signs or currency marks, since any non-numeric character makes the input fail and the tool asks for valid numbers again.

Does the order I type the numbers in change anything?

No. The tool sorts a copy of the list for the median, quartiles, minimum, maximum and histogram, and the mean and standard deviation do not depend on order. Pasting 41, 12, 34 and the rest in any arrangement returns the same 24.2222 and 9.2436. Order only matters if your numbers form a time series, and this page does not analyse trends.

Nine numbers, two standard deviations

The sample list loaded on arrival is 12, 15, 18, 22, 22, 25, 29, 34, 41, with 29 as the value to test. For that list the tool reports a mean of 24.2222 and a sample standard deviation of s = 9.2436. Alongside them sit n = 9, a median of 22 and a population standard deviation of 8.715.

The supporting lines add a sample variance of 85.4444, a minimum of 12 and maximum of 41 with a range of 29, an interquartile range of 11, and a Z-score of 0.517 for the value 29. Below those, a histogram splits the data into five bins of equal width.

Two standard deviations appear because there are two honest answers to the question of how spread out these nine numbers are. One treats them as the whole group you care about. The other treats them as a sample from something larger and corrects for that. The headline uses the sample version, which is the safer default for most real data.

Working s and sigma by hand

A short list makes the arithmetic easy to follow. Take 2, 4, 4, 4, 5, 5, 7, 9. The sum is 40 and n is 8, so the mean is 5. Subtract 5 from each value to get the deviations: minus 3, minus 1, minus 1, minus 1, 0, 0, 2 and 4. Square them and you get 9, 1, 1, 1, 0, 0, 4 and 16, which add to 32.

For the population figure divide 32 by n, which gives 4, and take the square root: sigma is 2. For the sample figure divide 32 by n minus 1, which is 7, and get 4.5714. Its square root is 2.1381. Run this list through the tool and it shows exactly those values: s = 2.1381, sample variance 4.5714, population sigma 2.

The default list works the same way. Its sample variance is 85.4444, so the sum of squared deviations is eight times that. The square root of 85.4444 is 9.2436. To get the population variance, multiply the sample variance by 8 and divide by 9, which gives about 75.95, whose square root is the 8.715 shown in the result. The ratio between the two standard deviations is always the square root of n over n minus 1, so it shrinks as the list gets longer.

Why n minus 1, and when sigma is the right choice

The deviations are measured from the mean of the same numbers, and that mean sits as close to the data as any single value can. So the squared deviations come out a little smaller than they would be if you had measured from the true mean of the wider population. Dividing by n minus 1 instead of n nudges the variance back up to compensate. This is Bessel's correction.

With nine values the correction is noticeable: 9.2436 against 8.715, about six percent apart. With two values it is large. For the list 10, 20 the tool reports s = 7.0711 and sigma = 5, because the sample formula divides by 1 and the population formula by 2.

Use sigma when the list is complete, such as the marks of every student in one class when you only care about that class, or the daily output of a machine over every day it has run. Use s when the numbers stand in for something bigger: a batch of measurements from a process, a survey of some customers, a handful of trial runs. If you are not sure, s is the more cautious figure because it never comes out smaller.

Median and quartiles by linear interpolation

The median is the middle value of the sorted list. With nine values it is the fifth, which is 22. With an even count it is the average of the two middle values, so 1, 2, 3, 4 gives 2.5.

Quartiles use the linear interpolation method. The tool sorts the list, finds position (n minus 1) times 0.25 counting from zero, and interpolates between the neighbouring values when that position is not a whole number. For the default nine values the positions are exactly 2 and 6, so Q1 is the third value, 18, and Q3 is the seventh, 29. The gap between them is the IQR of 11.

Other textbooks and software use different quartile rules, and on small lists they disagree. For 1, 2, 3, 4 this tool gives Q1 of 1.75 and Q3 of 3.25, so an IQR of 1.5. A method that takes the median of each half would give 1.5 and 3.5 instead, an IQR of 2. Neither is wrong. If you are matching a set answer from a course, check which method the course uses before comparing.

What one outlier does to the mean, s and IQR

Add a single large value, 90, to the default list and run it again. The mean jumps from 24.2222 to 30.8. The sample standard deviation more than doubles, from 9.2436 to 22.5527. The median moves only from 22 to 23.5, and the IQR from 11 to 13.75.

That contrast is the main reason the page reports both kinds of summary. The mean and standard deviation use every value and weigh distant points heavily, because deviations are squared. The median and IQR depend only on order, so one wild point barely shifts them.

When the two families disagree sharply, look at the histogram and the range before choosing which to report. A range of 12 to 90 next to an IQR of 13.75 says most of the data is bunched and something sits far out. That might be a real observation or a typing error, and only you can tell which.

Removing a value works the same way in reverse. Drop 41 from the default list and the eight remaining numbers give a mean of 22.125 and s of 7.2395, while the median stays at 22. The IQR narrows from 11 to 8.75. If a single deletion moves s that much, the dataset is small enough that any one point matters, and it is worth saying so when you report the figures. A sentence such as 'with the largest value excluded, s falls to 7.2395' tells a reader more than either number alone.

The Z-score box and what its sigma label means

The second input is a single value to compare with the list. The tool subtracts the mean and divides by the sample standard deviation. For 29 that gives (29 minus 24.2222) divided by 9.2436, which is 0.517. Try 17 and the answer is minus 0.781; try 44 and it is 2.14.

The result is shown with a sigma symbol, but the divisor is s, not the population sigma. If you want a Z-score against the population figure, divide the same difference by 8.715 yourself. For 29 that gives about 0.548 instead of 0.517.

The test value does not have to be in the list, and it does not change any other statistic. If every value in the list is identical, s is 0 and the tool reports a Z-score of 0 rather than dividing by zero. Treat that as no information, not as a sign that your value is typical.

Reading the five-bin histogram

The chart cuts the range from minimum to maximum into five equal slices. For the default list the range is 29, so each bin is 5.8 wide. The counts are 2 values in the first bin, 3 in the second, 2 in the third, then 1 and 1. The middle-heavy shape with a longer right tail matches the mean sitting above the median.

Five bins is a fixed choice. With a long list it can hide detail, and with a short one a single value can make a bin look important. The bin edges also depend on the exact minimum and maximum, so adding one point at either end redraws every bin. Read the chart as a rough shape check, not as a fitted distribution.

There is no mode in the output. For the default list the only repeated value is 22, which you can see by eye, but for longer lists you would need to count repeats yourself or use a tool that reports them.

Pasting data without losing values

The input splits on commas, spaces, semicolons and line breaks, and ignores empty gaps between separators. A column pasted from a spreadsheet works, as does a sentence-style list with semicolons. Decimals and negative numbers are read normally.

The trap is the thousands separator. A number written as one thousand with a comma after the 1 is read as two values, 1 and 0, because the comma counts as a separator. The count goes up, the mean collapses and no warning appears. Remove thousands commas before pasting, or paste a column with no formatting.

Anything that is not a plain number, such as a unit, a percent sign or a word, makes the whole input fail with a request for at least two valid numbers. That is stricter than silently skipping the bad entry, and it is useful: the tool will not quietly drop a value you meant to include. Summary figures are rounded to four decimal places, and the minimum, maximum and range to two.