User manual · Graphing and data

Normal distribution function: PDF, CDF and z-scores

The normal distribution function explained: PDF and CDF formulas, z-scores, the 68-95-99.7 rule, a worked example, and normalpdf, normalcdf and invnorm.

By Hira Noor, mathematicianUpdated
Short answerThe normal distribution function is the bell-shaped probability density f(x)=1σ2πe−(x−μ)22σ2f(x) = \frac{1}{\sigma\sqrt{2\pi}}\,e^{-\frac{(x-\mu)^2}{2\sigma^2}}, where μ is the mean and σ the standard deviation. Its cumulative distribution function (CDF) gives the probability of a value at or below x. On ScientifiCalc, normalpdf(x, μ, σ) returns the density, normalcdf(lower, upper, μ, σ) the probability between two values and invnorm(p, μ, σ) the value for a given probability, in the same order as a TI-84.

Jump to: the formulas, PDF vs CDF, z-scores, the 68-95-99.7 rule, a worked example, calculator syntax, binomial, Poisson or summary statistics. To get an answer straight away, enter your mean, standard deviation and value in the normal distribution calculator; it shows the z-score, the shaded area and every step.

What is the normal distribution function?

The normal distribution, also called the Gaussian distribution, describes a continuous quantity whose values cluster around a mean and thin out symmetrically on both sides: heights, measurement errors and many test scores follow it closely. Two numbers fix the curve completely. The mean μ sets where the peak sits, and the standard deviation σ sets how wide the bell is. About two-thirds of the area lies within one standard deviation of the mean.

f(x)=1σ2πexp(−(x−μ)22σ2)f(x) = \frac{1}{\sigma\sqrt{2\pi}}\,\exp\!\left(-\frac{(x-\mu)^2}{2\sigma^2}\right)
The normal probability density function (PDF)
x
The value at which the curve is evaluated.
μ (mu)
The mean, which is also the median and the mode, because the curve is symmetric.
σ (sigma)
The standard deviation, greater than 0. The variance is σ².
e and π
The constants 2.718281828… and 3.141592654…

The density f(x) is the height of the curve, not a probability. For a continuous variable the probability of any single exact value is 0; probabilities are areas under the curve. The area to the left of x is the cumulative distribution function F(x), and the whole area is exactly 1.

F(x)=P(X≤x)=Φ(x−μσ),Φ(z)=12[1+erf(z2)]F(x) = P(X \le x) = \Phi\!\left(\frac{x-\mu}{\sigma}\right), \qquad \Phi(z) = \frac{1}{2}\left[1 + \operatorname{erf}\!\left(\frac{z}{\sqrt{2}}\right)\right]
The normal cumulative distribution function (CDF), written with the standard normal CDF Φ and the error function erf

The CDF has no formula in elementary functions, which is why printed z-tables exist. Calculators evaluate it through the error function, and so does this one: 0.5(1 + erf(1.5/sqrt(2))) and normalcdf(-inf, 1.5) both give 0.9331927987.

Normal distribution PDF vs CDF vs inverse CDF

Most mix-ups come from using the wrong one of three related functions. Each answers a different question about the same curve:

The three normal distribution functions, shown for μ = 70 and σ = 10
FunctionQuestion it answersScientifiCalc and TI-84Example
PDF, f(x)How high is the curve at x?normalpdf(x, μ, σ)normalpdf(85, 70, 10) = 0.01295175957
CDF, F(x)What fraction of values is at or below x?normalcdf(-inf, x, μ, σ)normalcdf(-inf, 85, 70, 10) = 0.9331927987
Inverse CDF, F⁻¹(p)Which value has a fraction p of values below it?invnorm(p, μ, σ)invnorm(0.9, 70, 10) = 82.81551566

A probability question ("what share scores above 85?") needs the CDF. A cutoff question ("what score is the 90th percentile?") needs the inverse CDF. The PDF on its own is mainly for drawing the curve and for likelihood calculations. In Excel and Google Sheets the same three functions are NORM.DIST(x, μ, σ, FALSE), NORM.DIST(x, μ, σ, TRUE) and NORM.INV(p, μ, σ).

Standard normal distribution and z-scores

The standard normal distribution is the special case μ = 0 and σ = 1, usually written Z. Any normal value converts to it with the z-score, the number of standard deviations the value lies from the mean:

z=x−μσz = \frac{x - \mu}{\sigma}
The z-score (standard score)

A score of 85 with μ = 70 and σ = 10 has z = 1.5, so P(X ≤ 85) = Φ(1.5). The table below gives Φ(z) for the values used most often; the z-score and normal distribution calculator prints the full z-table from 0.00 to 3.09.

Standard normal CDF values Φ(z) = P(Z ≤ z)
zΦ(z)Where it is usedType
00.5The mean splits the area in halfnormalcdf(-inf, 0)
10.8413447461One standard deviation above the meannormalcdf(-inf, 1)
1.6450.9500150945One-sided 95% and two-sided 90% critical valuenormalcdf(-inf, 1.645)
1.960.9750021049Two-sided 95% confidence intervalsnormalcdf(-inf, 1.96)
20.9772498681Two standard deviations above the meannormalcdf(-inf, 2)
2.5760.9950024677Two-sided 99% confidence intervalsnormalcdf(-inf, 2.576)
30.998650102Three standard deviations above the meannormalcdf(-inf, 3)

For negative z, use the symmetry of the curve: Φ(−z) = 1 − Φ(z), so Φ(−1) = 0.1586552539.

The 68-95-99.7 rule

The empirical rule summarizes the normal distribution function in three numbers: about 68% of values lie within one standard deviation of the mean, about 95% within two and about 99.7% within three. The exact areas come straight from the CDF:

Standard normal curve with the middle 68% shaded
−4−3−2−101234z (standard deviations from the mean)−2σ+2σ
The shaded area between z = −1 and z = 1 is 0.6826894921 of the total. The dashed lines at ±2σ enclose 0.9544997361.
Exact areas behind the 68-95-99.7 rule
RangeInsideOutside (both tails)Type
μ ± 1σ0.6826894921 (68.27%)0.3173105079normalcdf(-1, 1)
μ ± 2σ0.9544997361 (95.45%)0.0455002639normalcdf(-2, 2)
μ ± 3σ0.9973002039 (99.73%)0.002699796063normalcdf(-3, 3)

The rule never reaches 100%, because the normal curve approaches zero without ever touching it: some area always remains beyond any finite distance from the mean. Note also that 95% corresponds to ±1.96σ, not ±2σ, which is why confidence intervals use 1.96.

Worked example: exam scores

Exam scores are normally distributed with mean μ = 70 and standard deviation σ = 10. Find the height of the curve at 85, the share of students scoring 85 or less, the share scoring above 85 and the 90th percentile.

  1. Standardize

    z = (85 − 70) / 10 = 1.5, so 85 is one and a half standard deviations above the mean.

  2. Evaluate the PDF

    The front factor is 1102π\frac{1}{10\sqrt{2\pi}} = 0.03989422804 and the exponential is e−1.52/2=e−1.125e^{-1.5^2/2} = e^{-1.125} = 0.3246524674. Their product is f(85) = 0.01295175957, which normalpdf(85, 70, 10) confirms.

  3. Evaluate the CDF

    P(X ≤ 85) = Φ(1.5) = 0.9331927987. About 93.3% of students score 85 or less: normalcdf(-inf, 85, 70, 10).

  4. Take the complement

    P(X > 85) = 1 − 0.9331927987 = 0.06680720127, about 6.7%: normalcdf(85, inf, 70, 10).

  5. Invert for the percentile

    The 90th percentile is invnorm(0.9, 70, 10) = 82.81551566. Check: z = 1.281551566, and 70 + 1.281551566 × 10 = 82.81551566.

Exam scores, μ = 70 and σ = 10, area above 85 shaded
30405060708090100110Scorex = 85
The shaded right tail is P(X > 85) = 0.06680720127. Open this example in the normal distribution calculator to see the working.

The calculator below opens on the same example. Change the mean, the standard deviation or the question to see the z-score, the shaded area and each step of the working.

Try

The population mean. Use 0 with σ = 1 for the standard normal.

Must be greater than 0.

More options Sample size n

For the mean of a sample of n values (x̄): the calculator uses the standard error σ/√n in place of σ.

Result

P(X > 85): 0.06680720127

P(X > 85)

0.06680720127

6.6807201%

z-score (x − μ)/σ
1.5
As a percentage
6.6807201%
Complement P(X < 85)
0.9331927987
Density f(85)Height of the curve at x (not a probability)
0.01295175957
How often
About 1 in 15

6.68072% of values from this distribution are above 85. The value 85 is 1.5 standard deviations above the mean.

For a continuous distribution, P(X < x) and P(X ≤ x) are equal: the probability of any single exact value is 0.

Normal curve (μ = 70, σ = 10): shaded area = 0.06681
30405060708090100110xμ = 70x = 85
Step-by-step working (2 steps)
  1. Standardize

    Convert x to a z-score: how many standard deviations it lies from the mean.

    z=x−μσ=85−7010=1.5z = \frac{x - \mu}{\sigma} = \frac{85 - 70}{10} = 1.5
  2. Area to the right

    By symmetry the right tail equals Φ(−z), which keeps full precision for small tails.

    P(X>x)=1−Φ(z)=Φ(−z)=0.06680720127P(X > x) = 1 - \Phi(z) = \Phi(-z) = 0.06680720127

This is the z-score and normal distribution calculator, started with this page’s next example. Its own page adds more presets, the formulas and worked examples.

normalpdf, normalcdf and invnorm on the calculator

In the scientific calculator, the three normal distribution functions take the mean and standard deviation as optional last arguments. Leave them out for the standard normal.

Normal distribution functions (μ = 0 and σ = 1 when omitted)
FunctionGives
normalpdf(x, μ, σ)The probability density at x (the height of the bell curve).
normalcdf(lower, upper, μ, σ)The probability of a value between lower and upper. Use -inf or inf for an open bound.
invnorm(p, μ, σ)The value with a left-tail area of p (the inverse of the cumulative distribution).
Normal distribution examples
QuestionTypeResult
Area within 1.96 standard deviationsnormalcdf(-1.96, 1.96)0.9500042097
P(Z < 1.5)normalcdf(-inf, 1.5)0.9331927987
Exam scores with μ = 70, σ = 10: P(60 < X < 80)normalcdf(60, 80, 70, 10)0.6826894921
Critical value for a 95% two-sided intervalinvnorm(0.975)1.959963985
90th percentile when μ = 100, σ = 15invnorm(0.9, 100, 15)119.2232735
Peak height of the standard normal curvenormalpdf(0)0.3989422804

invnorm always works from the left tail. For a right-tail area p, use invnorm(1 - p, μ, σ); for the middle 95%, the bounds are invnorm(0.025, μ, σ) and invnorm(0.975, μ, σ).

When the normal distribution applies

The central limit theorem explains why the normal curve turns up so often: the sum or mean of many independent random effects is approximately normal, whatever the shape of each effect. That makes the normal distribution a good model for sample means and measurement errors, and the basis of z-tests and confidence intervals.

It is a poor model for data that are bounded at zero and skewed, such as incomes, waiting times or reaction times, and for counts. Check a histogram before relying on it. Skewed positive data are often closer to normal after taking logarithms, and counts follow the two other probability distribution functions below, binomial and Poisson.

Binomial distribution function

binompdf(n, p, k) is the probability of exactly k successes in n independent trials, each with success probability p. binomcdf(n, p, k) is the probability of at most k successes. The mean is np and the standard deviation is √(np(1 − p)). Other questions follow from these two functions:

Binomial probabilities for n = 20 trials with p = 0.3
QuestionTypeResult
P(X = 6)binompdf(20, 0.3, 6)0.1916389828
P(X ≤ 6)binomcdf(20, 0.3, 6)0.6080098122
P(X ≥ 7), that is 1 − P(X ≤ 6)1 - binomcdf(20, 0.3, 6)0.3919901878

In the same way, P(X < k) is binomcdf(n, p, k - 1), and P(a ≤ X ≤ b) is binomcdf(n, p, b) - binomcdf(n, p, a - 1). The binomial distribution calculator answers the same questions through a form and draws the bar chart.

Poisson distribution function

poissonpdf(λ, k) is the probability of exactly k events when the average number of events is λ, and poissoncdf(λ, k) the probability of at most k. If a help desk receives on average 4 calls an hour, the chance of no calls in an hour is poissonpdf(4, 0) = 0.01831563889, the chance of at most 6 calls is poissoncdf(4, 6) = 0.8893260216, and the chance of more than 6 is 1 - poissoncdf(4, 6) = 0.1106739784. The Poisson distribution calculator shows the same results with the formula.

Summary statistics functions

The mean and standard deviation that a normal model needs can be computed in the same calculator. List the values as arguments separated by commas (or by semicolons when the decimal separator is set to comma). The table uses the data set 12, 15, 11, 18, 14.

Statistics functions applied to 12, 15, 11, 18, 14
FunctionComputesResult
mean(…)Arithmetic mean (aliases avg, average)14
median(…)Middle value after sorting14
stdev(…)Sample standard deviation, dividing by n − 12.738612788
stdevp(…)Population standard deviation, dividing by n2.449489743
variance(…)Sample variance, dividing by n − 17.5
variancep(…)Population variance, dividing by n6
min(…) and max(…)Smallest and largest value11 and 18
total(…)Sum of the values70

The sample versions need at least two values. Functions can be combined: the z-score of 18 in this data set is (18 - mean(12, 15, 11, 18, 14)) / stdev(12, 15, 11, 18, 14) = 1.460593487. To avoid typing a long list twice, use a custom function or store results in variables.

Sample or population?

Use the sample functions (stdev, variance) when your numbers are a sample drawn from a larger group and you want to estimate the spread of that group. Dividing by n − 1 instead of n corrects the tendency of a sample to underestimate the spread. Use the population functions (stdevp, variancep) only when the data include every member of the group you are describing, such as the scores of everyone in one class.

Dedicated statistics calculators

For more than a handful of values, the statistics calculator and the standard deviation calculator take a whole data set at once and explain the formulas behind each result. Paste or type the values separated by commas, spaces, semicolons or line breaks; a column copied from a spreadsheet works as it is. Use a decimal point in data lists, because commas separate values there, and leave out thousands separators. For paired data, the regression calculator finds the line of best fit.

Accuracy

The distribution functions are built on special functions (the error function, the incomplete gamma and beta functions) computed to about 14 significant digits, and invnorm is refined with Halley’s method against the exact cumulative distribution. Results are shown to 10 significant digits. The methodology page lists every method.

Frequently asked questions

What is the normal distribution function?

It is the bell-curve probability density f(x) = e^(−(x − μ)²/(2σ²)) / (σ√(2π)), set by the mean μ and the standard deviation σ. Its cumulative form, the CDF, gives the probability of a value at or below x.

What is the difference between normalpdf and normalcdf?

normalpdf returns the height of the curve at one point, which is a density and not a probability. normalcdf returns the area between two bounds, which is the probability of a value in that range. For probability questions, use normalcdf.

Why is the 68-95-99.7 rule not 100%?

The normal curve never touches zero, so a small area always lies beyond three standard deviations: 0.002699796063 of the total, about 1 value in 370.

Why does normalcdf need two bounds?

It returns the area between them. For a one-sided probability, use -inf or inf as the other bound, for example normalcdf(-inf, 1.5) for P(Z < 1.5).

In what order do the binomial arguments go?

n, then p, then k, as on TI-83 and TI-84 calculators: binompdf(10, 0.5, 3) is the probability of exactly 3 heads in 10 fair coin tosses, 0.1171875.

Should I use stdev or stdevp?

Use stdev for a sample from a larger population, which is the usual case in experiments and surveys. Use stdevp only when your data cover the entire population.

Tools on this page

Scientific Calculator

Type or tap expressions with exact fractions, memory, variables, constants and complex mode.

Statistics Calculator

Mean, median, mode, five-number summary, IQR, outliers and SD with steps, a histogram and a box plot.