CALCULATORCASTLE

Statistics Calculator

Compute mean, median, mode, range, and more statistical measures.

About

Statistics Calculator

Paste a list of numbers and this returns the whole standard summary at once: count, sum, mean, median, mode, largest and smallest, range, geometric mean, and both the population and sample forms of variance and standard deviation. The step-by-step panel shows how each one was reached rather than only the answer.

The two questions every summary answers

A list of numbers is hard to hold in your head, so statistics compresses it into two things: where the values sit, and how spread out they are. Mean, median and mode answer the first. Range, variance and standard deviation answer the second. A summary that gives you only one of the two is telling you half the story, which is why the calculator reports both.

Two sets can share a mean and be nothing alike. 22, 22, 22, 22 and 2, 10, 38, 38 both average 22, but the first has a standard deviation of 0 and the second is scattered across 36 units. The mean alone cannot tell them apart.

Mean, median and mode

The mean is the total divided by how many values there are. It uses every number, which makes it sensitive to extremes. One unusual value drags it: nine people earning 30,000 and one earning 5 million gives a mean of about 527,000, which describes nobody in the room.

x¯=1ni=1nxi

The median is the middle value once the list is sorted. With an even count there is no single middle, so it is the mean of the two middle values. It ignores how far away the extremes are, which is exactly why it survives them. In the salary example the median stays at 30,000.

The mode is the value that appears most often. It is the only one of the three that works on things you cannot average, such as shirt sizes or survey answers. A set can have two modes, or several, or none at all when every value appears the same number of times.

Which one to use depends on the shape of the data. For a roughly symmetric set the three land close together. For a skewed one such as income, house prices or waiting times, the median is the honest summary and the mean is the one that flatters.

Range, variance and standard deviation

The range is the largest value minus the smallest. It is quick and it uses only two numbers, so a single outlier defines it completely.

Variance uses all of them. Take each value's distance from the mean, square those distances, and average them. The squaring does two jobs: it makes every term positive, so distances above and below the mean cannot cancel to zero, and it weights large departures more heavily than small ones.

σ2=1Ni=1N(xiμ)2

That squaring leaves variance in the wrong units. If your data is in centimetres, the variance is in square centimetres, which means nothing physically. Taking the square root fixes it, and the result is the standard deviation, back in the original units and readable as a typical distance from the mean.

σ=1Ni=1N(xiμ)2

Why there are two standard deviations

The calculator prints standard deviation and sample standard deviation as separate rows, and the difference is one character in the formula. Population divides the squared deviations by N. Sample divides by n − 1, and switches the population mean μ for the sample mean x̄.

s=1n1i=1n(xix¯)2

The reason is that a sample's own mean is calculated from the sample itself, so the values sit closer to it than they do to the true mean of the population behind them. Dividing by n would therefore understate the real spread every time. Subtracting one, known as Bessel's correction, compensates for it.

The gap matters most on small sets and fades on large ones. On the eight values loaded above, the population figure is 11.51 and the sample figure is 12.30, roughly 7% apart. At n = 100 the difference is about half a percent, and at n = 1,000 it is negligible.

Which to use is a question about your data, not about your preference. Use the population form when your numbers are the entire group you care about, such as the marks of every student in a class you are describing. Use the sample form when they are a subset you are using to reason about something larger. Most real work is the second case, which is why statistical software defaults to it.

Geometric mean

The geometric mean multiplies all the values together and takes the nth root, where n is how many there are.

GM=(i=1nxi)1/n=x1x2xnn

It exists because the ordinary mean is wrong for anything that compounds or for anything measured on different scales. Take an investment that gains 50% one year and loses 50% the next. The arithmetic mean of +50% and −50% is 0%, suggesting you broke even. In reality 100 becomes 150 and then 75, a loss of a quarter. The geometric mean of the growth factors 1.5 and 0.5 is about 0.866, correctly reporting roughly a 13.4% loss a year.

The scale problem is the same idea. Rate a car for fuel economy out of 5 and for safety out of 100, and an arithmetic average lets the safety score dominate, because a one-point move there is worth far less proportionally than a one-point move out of 5. The geometric mean treats a given percentage change in either as equal.

Two constraints come with it. Every value has to be above zero, since one zero collapses the product and a negative makes the root undefined, and the calculator leaves the row blank when a set does not qualify. It is also always less than or equal to the arithmetic mean, with equality only when every value is identical. On the loaded set the geometric mean is 17.12 against an arithmetic mean of 22.25.

What a summary hides

Anscombe's quartet is four sets of eleven points, published by the statistician Francis Anscombe in 1973, that share the same mean, the same variance, the same correlation and the same fitted line. Plotted, they look nothing alike: one is a clean linear trend, one is a curve, one is a straight line dragged by a single outlier, and one is a vertical stack plus one distant point. The numbers agree and the pictures disagree.

Summary statistics compress, and compression discards. Read them alongside the sorted data, which is why the sorted list sits under the results table, and plot the values whenever you can.

Reading your result

Start with the count, since it is the first thing that goes wrong. If it does not match how many values you meant to paste, something was dropped by a stray character before any other figure is worth reading.

Then compare the mean against the median. Close together suggests a fairly symmetric set. Far apart means the data is skewed, and the direction tells you which way: a mean above the median points to a long tail of high values, and below it points to a tail of low ones.

Read the standard deviation next to the mean rather than on its own. A standard deviation of 12 is enormous around a mean of 20 and trivial around a mean of 20,000. Dividing one by the other gives the coefficient of variation, which is what makes spread comparable across sets of different sizes. On the loaded data that is 12.30 ÷ 22.25, or about 55%, which is a very scattered set.

If you need a fuller breakdown of one measure, the Standard Deviation Calculator and the Mean, Median, Mode, Range Calculator cover those on their own.

Common questions

Frequently asked questions

Population standard deviation divides the squared deviations by n; the sample version divides by n minus 1. A sample sits closer to its own mean than to the true population mean, so dividing by n would understate the spread. Use the sample form whenever your numbers are a subset of something larger.

Use the median when the data is skewed or has outliers, because it ignores how far away the extremes sit. Nine salaries of 30,000 plus one of 5 million give a mean near 527,000 and a median of 30,000, and only the median describes anyone actually in the room.

Squaring each distance from the mean makes every term positive, so values above and below the mean cannot cancel to zero, and it weights large departures more heavily. The side effect is that variance carries squared units, which is why taking the square root to get the standard deviation puts the answer back into the original units.

Rates of change and values measured on different scales. An investment up 50% then down 50% has an arithmetic mean of 0% but has really lost a quarter of its value; the geometric mean of the factors 1.5 and 0.5 correctly reports about a 13.4% loss a year.

Yes. If every value appears the same number of times there is no single most common value, so the set has no mode. A set can also have two or more modes when several values tie for the highest count, and the calculator lists all of them.

It needs every value to be above zero. One zero collapses the product to zero, and a negative value makes the nth root undefined for even roots. The calculator leaves the row blank rather than printing a meaningless figure.

It is neither good nor bad on its own, only large or small relative to the mean. A standard deviation of 12 is huge around a mean of 20 and trivial around a mean of 20,000. Dividing the standard deviation by the mean gives the coefficient of variation, which makes the comparison fair.

Paste the values separated by commas, spaces or new lines, so a column copied straight out of a spreadsheet works without editing. Check the count in the results first: if it does not match how many values you pasted, a stray character has broken one of them.