Tools · Math & Statistics

Z-Score Calculator

Give a value, a mean and a standard deviation and get the z-score, the percentile, both tail probabilities and the two-tailed p-value. Or run it backwards: name a percentile and get the value that sits there.

Normal CDF to 7 decimal placesHow it worksInputs stay on this device
Your inputs

Score against a distribution

The same relationship, run either way. z = (x − μ) ÷ σ going one direction, x = μ + zσ coming back.

The single observation you are scoring — a test mark, a measurement, a lab result.

The average of the distribution you are comparing against — the class, the batch, the reference population.

The spread of that same distribution, in the same units as the mean. It has to be above zero.

Your inputs are calculated locally and are not stored.
Z-score1.25

85 is 10 from a mean of 75, which is 1.25 standard deviations. That puts it at the 89.4th percentile. The z-score is plain arithmetic and always holds; the percentile and the tail probabilities assume the data is roughly normal.

Value (x)
85
Distance from the mean (x − μ)
10
Percentile of this value
89.435
Left tail — P(X ≤ x)
0.8943502
Right tail — P(X ≥ x)
0.1056498
Two-tailed p-value
0.2112997
Chance of landing nearer the mean
0.7887003
What it is for

Comparing numbers that are not on the same scale

A student scores 90 on one test and 85 on another. Which was the better performance? The raw marks cannot answer it, because they come from different distributions — different means, different spreads, possibly different lengths.

Suppose the first test averaged 88 with a standard deviation of 4, and the second averaged 70 with a standard deviation of 6. The 90 is (90 − 88) ÷ 4 = +0.5 standard deviations above average, which is the 69.1st percentile. The 85 is (85 − 70) ÷ 6 = +2.5, which is the 99.4th percentile. The lower raw mark is the far stronger result, and only standardising reveals it.

This is the whole job of the z-score, and it is why the same arithmetic turns up under different names everywhere: a standard score in education, a T-score in bone-density scanning, a sigma level in manufacturing, a standardised residual in regression diagnostics. Subtract the mean, divide by the standard deviation, and units and scale both fall away.

Formula & methodology

One formula forwards, the same one backwards

z = (x − μ) ÷ σ  •  x = μ + zσ  •  Φ(z) = ½(1 + erf(z ÷ √2))
x
The value being scored
μ
The mean of the distribution it is being scored against
σ
The standard deviation of that same distribution
Φ(z)
The area under the standard normal curve to the left of z — the percentile, before multiplying by 100

Why the normal CDF has to be approximated

Φ(z) is an integral with no closed form: there is no finite expression in elementary functions that gives the area under a bell curve. Every normal table ever printed is a numerical approximation, and so is this. The one used here is Abramowitz & Stegun formula 7.1.26, a five-term series multiplied by a Gaussian, with a stated maximum absolute error of 1.5 × 10⁻⁷ on the error function across the whole real line. That carries through to roughly 7.5 × 10⁻⁸ on Φ, which is why the probabilities here stop at seven decimal places.

Why the inverse is bisection rather than a second formula

There are published approximations for Φ⁻¹ too, but using one would mean two independent error budgets that disagree with each other: feed a percentile in, get a z out, feed that z back in, and the percentile would not come back. Instead this runs the same CDF backwards by bisection over the interval [−8, +8], halving it eighty times. That is far past double precision, so the only error left is the CDF's own — and a percentile round-trips exactly to the digits shown.

Where 68-95-99.7 comes from

It is not a mnemonic bolted on afterwards; it is what this page computes at z = 1, 2 and 3. The area between −1 and +1 is 0.6827, between −2 and +2 it is 0.9545, and between −3 and +3 it is 0.9973. Set the mean to 0 and the standard deviation to 1 above and check all three. It also explains a detail that confuses people: hypothesis tests use 1.96 rather than 2 because 1.96 is where the central area is exactly 95%, while 2 gives 95.45%.

Worked example

85 on a test that averaged 75

The class mean is 75 and the standard deviation is 8. The mark is 85, so the distance from the mean is 85 − 75 = 10, and in units of spread that is 10 ÷ 8 = 1.25. That is the z-score: a quarter past one standard deviation above average.

Turning it into a probability: Φ(1.25) = 0.8943502. So about 89.4% of the class scores lower and 10.6% scores higher — the mark sits at the 89.4th percentile. Doubling the smaller tail gives a two-tailed p-value of 0.2113: if you picked a student at random, there is a 21% chance they land at least this far from the mean in one direction or the other. Which is a useful reminder that 1.25 standard deviations is a good mark, not a remarkable one.

Now run it backwards. Switch the calculator to “percentile” and ask for the 90th: Φ⁻¹(0.90) = 1.281552, so the mark you would need is 75 + 1.281552 × 8 = 85.252416. Only a quarter of a point above the 85, which is exactly what a z of 1.25 sitting at the 89.4th percentile implies.

One caveat worth stating out loud, because it applies to the whole example: the 1.25 is arithmetic and holds no matter what shape the marks take. The 89.4th percentile holds only if the marks are roughly normal. On a test where most of the class scored near the ceiling, the same z would sit somewhere else entirely.

Assumptions

What this calculator assumes

  • The z-score assumes nothing. It is a distance divided by a spread, and it is valid on any data at all.
  • Every probability on this page — the percentile, both tails, the two-tailed p-value — assumes the underlying data is approximately normal. On skewed or heavy-tailed data they are wrong, sometimes badly.
  • The mean and standard deviation you enter are treated as the population values, known exactly. If you estimated them from a small sample, the t-distribution is the correct curve and these tails are too thin.
  • Nothing here corrects for discreteness. Scoring a whole-number count against a continuous curve normally wants a continuity correction, which this tool does not apply.
  • Probabilities are accurate to about 7.5 × 10⁻⁸ in absolute terms, not relative terms. Far out in the tails the figures lose their meaning, which is why the percentile input stops at 0.001 and 99.999.
  • This scores one value against one distribution. It is not a two-sample test, a proportion test, or a test for a difference between groups.

If you need the standard deviation itself, the standard deviation calculator takes a list of numbers and gives you σ on either divisor — which is the figure this page asks you to supply.

Common questions

Z-score FAQ

What does a z-score actually tell you?

How unusual a value is, in units of the spread of its own distribution. A z of 0 is exactly average; +1 is one standard deviation above the mean; −2 is two below. The point is that it strips out the units and the scale, so numbers from completely different distributions become comparable. A 90 on a test that averaged 88 with a standard deviation of 4 is a z of +0.5 — the 69th percentile. An 85 on a test that averaged 70 with a standard deviation of 6 is a z of +2.5 — the 99th percentile. The 85 is by far the better result, and only the z-score shows it.

Where does the 68-95-99.7 rule come from?

It is not a rule of thumb somebody chose; it is the area under the normal curve at z = 1, 2 and 3, and this calculator computes it. Set the mean to 0 and the standard deviation to 1, then enter 1, 2 and 3 in turn and read the 'chance of landing nearer the mean' figure: 0.6827, 0.9545 and 0.9973. Rounded for teaching, that is 68%, 95% and 99.7%. The often-quoted 95% figure is really 95.45%, which is why statistical tests use z = 1.96 rather than 2 — that is the value that gives exactly 95%.

Do the probabilities work if my data is not a bell curve?

No, and this is the caveat almost nobody states. The z-score itself is fine on any data at all — it is a distance divided by a spread, and it makes no claim about shape. The percentile and the tail probabilities are different: every one of them comes from the normal curve. On skewed data the same z means something else entirely. A z of +2 is around the 97.7th percentile on a symmetric distribution, but on a heavily right-skewed one — incomes, insurance claims, session lengths — it can sit much lower, because the long tail drags the mean up and inflates the standard deviation. Plot a histogram before you quote a tail probability.

What can I say if the data is definitely not normal?

Chebyshev's inequality, which holds for any distribution with a finite variance: at least 1 − 1/k² of the values lie within k standard deviations of the mean. At k = 2 that promises at least 75%, against the normal curve's 95.45%. It is much weaker, but it is true regardless of shape, so it is the honest fallback when you cannot justify normality.

What is the difference between a z-score and a t-score?

A z-score assumes you know the population standard deviation. In practice you usually estimate it from a sample, which adds uncertainty the z ignores — and the smaller the sample, the more it ignores. The t-distribution accounts for it by having fatter tails, so the same test statistic gives a larger p-value. The two converge as the sample grows; past roughly 30 observations the difference is negligible. With a small sample and an estimated standard deviation, use the t.

Why is my two-tailed p-value exactly double the right tail?

Because the normal curve is symmetric, so the area beyond +z equals the area below −z. A two-tailed test asks 'how likely is a value at least this far from the mean, in either direction', which is both of those areas added together — hence 2 × (1 − Φ(|z|)). A one-tailed test asks about one direction only and uses the single tail. Which one you should use is decided before you see the data, not after.

How accurate are the probabilities on this page?

Φ(z) has no closed form, so it has to be approximated. This uses Abramowitz & Stegun formula 7.1.26, whose maximum absolute error is 1.5 × 10⁻⁷ on the error function and about 7.5 × 10⁻⁸ on Φ. That is why probabilities are shown to seven decimal places and no further — more digits would be printing the approximation's own noise. Note that the accuracy is absolute rather than relative, so a tail probability of 10⁻⁵ carries roughly a part-in-a-hundred error and anything further out stops meaning much. The percentile input is capped at 0.001 and 99.999 for that reason.

Primary sources

Sources and review notes

  1. NIST/SEMATECH e-Handbook of Statistical Methods §1.3.6.6.1 — the normal distribution, its cumulative distribution function and the standard normal transformation
  2. NIST/SEMATECH e-Handbook of Statistical Methods — the full handbook, jointly produced by NIST and SEMATECH
  3. Abramowitz & Stegun, Handbook of Mathematical Functions, formula 7.1.26 — the error-function approximation used here, with its stated 1.5 × 10⁻⁷ error bound

The formulas are definitional and have no data behind them to go stale. What can go wrong is the numerics, so the engine behind this page is a pure function under unit test — including cases that pin the 68-95-99.7 figures to seven decimal places and one that feeds a percentile in and checks the value comes back out.