Skip to content
Math

Error Function Calculator (erf, erfc, Inverse)

Enter any real number x to compute erf(x) and erfc(x) in one click. Switch to inverse mode and enter a probability p between -1 and 1 to find the x that gives erf(x) = p. The scaled complementary error function erfcx(x) is also provided for large-argument work. A live curve marks your input on the error function plot, and the steps panel shows exactly how the result is obtained.

Your details

Forward mode: enter x, get erf(x) and erfc(x). Inverse mode: enter a probability p, get the x for which erf(x) = p.
The argument of the error function. Any real number.
erf(x)
0.842701

Probability that a standard normal variable lies within [-x, x] (scaled by 2/sqrt(pi))

erfc(x)0.157299
erfcx(x)0.427584
erf⁻¹(p)-
erfc⁻¹(p)-
0.84270180.0% below · x
-10.52-303
x
  • erf(x)
  • erfc(x)

erf(1) = 0.842701, erfc(1) = 0.157299

  • erf(1) = 0.842701: approximately 84.27% of the standard normal distribution's probability mass lies within the symmetric interval [-|x|, |x|] times sqrt(2).
  • erfc(1) = 0.157299: this is the probability remaining in the two tails beyond that interval.

Next stepIn statistics, erf(x / sqrt(2)) equals the probability that a standard normal variable falls in the interval [-x, x]. At x = 1, that probability is 68.27%.

Formula

erf(x)=2π0xet2dt,erfc(x)=1erf(x),erfcx(x)=ex2erfc(x)\mathrm{erf}(x) = \frac{2}{\sqrt{\pi}} \int_0^x e^{-t^2}\,dt, \quad \mathrm{erfc}(x) = 1 - \mathrm{erf}(x), \quad \mathrm{erfcx}(x) = e^{x^2}\,\mathrm{erfc}(x)

Worked example

For x = 1: erf(1) = (2/sqrt(pi)) * integral from 0 to 1 of exp(-t^2) dt = 0.842701. erfc(1) = 1 - 0.842701 = 0.157299. erfcx(1) = e^1 * 0.157299 = 2.71828 * 0.157299 = 0.427584. Inverse check: erf^-1(0.842701) = 1.000000.

What is the error function?

The error function erf(x) is a special mathematical function defined as erf(x) = (2 / sqrt(pi)) * integral from 0 to x of exp(-t^2) dt. It appears throughout probability theory, statistics, and physics because it describes the cumulative probability of the Gaussian (normal) distribution up to a scaled argument. The factor 2/sqrt(pi) normalises the function so that it approaches 1 as x approaches positive infinity. Because the integrand exp(-t^2) has no elementary antiderivative, erf is computed numerically using polynomial or continued-fraction approximations. It is an odd function: erf(-x) = -erf(x), and it is bounded between -1 and 1 for all real x.

Complementary and scaled complementary error functions

The complementary error function erfc(x) = 1 - erf(x) gives the tail probability, which is often more useful than erf(x) itself when x is large and erf(x) is very close to 1. For large x, direct computation of 1 - erf(x) loses significant digits because two nearly equal numbers are subtracted. The scaled complementary error function erfcx(x) = exp(x^2) * erfc(x) avoids this underflow problem: it stays of order 1/(x * sqrt(pi)) as x grows, and multiplying by exp(-x^2) at the end recovers erfc(x) in a numerically stable way. erfcx is widely used in signal-processing, heat-transfer, and quantum-chemistry codes where erfc(x) would underflow to zero.

Inverse error function and how to use it

The inverse error function erf^-1(p) finds the argument x such that erf(x) = p, for any p strictly between -1 and 1. Its complement erfc^-1(p) = erf^-1(1 - p) finds x such that erfc(x) = p, for p in (0, 2). These inverses appear whenever a probability is known and the underlying variable must be recovered: in normal-distribution quantile calculations (the probit function equals sqrt(2) * erf^-1(2p - 1)), in Value-at-Risk calculations in finance, and in designing communication systems to a specified bit-error rate. To use inverse mode on this calculator, select "Inverse erf / erfc" and enter the probability p.

Relationship to the normal distribution

If Z is a standard normal variable (mean 0, variance 1), then P(-a <= Z <= a) = erf(a / sqrt(2)). Equivalently, the standard-normal CDF Phi(x) = (1 + erf(x / sqrt(2))) / 2, and the quantile function (probit) is sqrt(2) * erf^-1(2p - 1). This connection means erf tables were historically used to look up normal probabilities before computers, and the two functions are interchangeable through a simple rescaling. For a normal variable with mean mu and standard deviation sigma, P(mu - k*sigma <= X <= mu + k*sigma) = erf(k / sqrt(2)): the familiar 68-95-99.7 rule corresponds to k = 1, 2, 3, giving erf(0.707) = 0.6827, erf(1.414) = 0.9545, and erf(2.121) = 0.9973.

Applications in science and engineering

The error function appears in solutions to the heat equation and diffusion problems wherever the initial condition is a step function: the concentration or temperature profile at time t is a shifted erfc. In communications engineering, the bit-error probability of binary signalling over an additive white Gaussian noise channel is (1/2) * erfc(sqrt(SNR)), so erfc and Q-function tables are identical up to a factor of 2. In semiconductor physics, dopant profiles after diffusion are described by erfc. In statistics, erf is used in computing tail probabilities for normal, chi-squared, and t-distributions. In finance, the Black-Scholes option pricing formula uses the normal CDF, which is an erf in disguise.

Error function table: erf(x) and erfc(x)

xerf(x)erfc(x)
001
0.10.1124630.887537
0.20.2227030.777297
0.30.3286270.671373
0.40.4283920.571608
0.50.52050.4795
0.60.6038560.396144
0.70.6778010.322199
0.80.7421010.257899
0.90.7969080.203092
10.8427010.157299
1.10.8802050.119795
1.20.9103140.089686
1.30.9340080.065992
1.40.9522850.047715
1.50.9661050.033895
1.60.9763480.023652
1.70.983790.01621
1.80.9890910.010909
1.90.992790.00721
20.9953220.004678
2.50.9995930.000407
30.9999780.000022

Standard values for non-negative x. Because erf is odd, erf(-x) = -erf(x) and erfc(-x) = 2 - erfc(x).

Frequently asked questions

What is the difference between erf and erfc?

erf(x) is the error function, a cumulative integral from 0 to x of the Gaussian kernel. erfc(x) = 1 - erf(x) is the complementary error function, giving the remaining area. For positive x, erf grows from 0 to 1 and erfc falls from 1 to 0. When x is large, erfc is preferred in computation because it avoids subtracting two nearly equal numbers.

What is erfcx and why is it useful?

erfcx(x) = exp(x^2) * erfc(x) is the scaled complementary error function. For large x, erfc(x) can underflow to exactly 0 in double-precision arithmetic (around x = 27), but erfcx remains around 1 / (x * sqrt(pi)), a perfectly representable number. If you then need erfc(x) back, you compute exp(-x^2) * erfcx(x), which is more accurate than evaluating erfc directly.

How is the error function related to the normal distribution?

If X is a standard normal variable, then P(|X| <= x * sqrt(2)) = erf(x). Equivalently, the standard-normal CDF Phi(x) = (1 + erf(x / sqrt(2))) / 2. So erf and the normal CDF are the same function, just with a factor of sqrt(2) scaling the argument and the output rescaled from (-1, 1) to (0, 1).

What is the inverse error function used for?

The inverse error function erf^-1(p) finds x such that erf(x) = p. It is used to compute normal-distribution quantiles (the probit function is sqrt(2) * erf^-1(2p - 1)), to design communication systems to a target bit-error rate, to invert diffusion-profile measurements, and in Monte Carlo simulations that need to sample from a Gaussian by inverting the CDF.

Is erf(0) = 0 and erf(infinity) = 1?

Yes. The integral from 0 to 0 is zero, so erf(0) = 0. As x approaches positive infinity, the integral from 0 to x of exp(-t^2) dt converges to sqrt(pi)/2, and the factor 2/sqrt(pi) scales this to exactly 1. So erf is bounded between -1 and 1 for all real x, with erf(-infinity) = -1.

Can erf be computed with a simple formula?

There is no closed-form antiderivative for exp(-t^2), so erf cannot be expressed in elementary functions. In practice it is approximated to high precision using rational polynomials (such as the Abramowitz and Stegun 7.1.26 approximation used in this calculator, which has a maximum error below 1.5 x 10^-7), continued fractions, or Taylor series. For very small x, erf(x) is well approximated by (2/sqrt(pi)) * x.

Why does erf give a value between -1 and 1?

Because it is an integral of a non-negative function (exp(-t^2) >= 0), erf is monotonically increasing. Starting from 0 at x = 0, it rises to 1 as x grows (the full integral of exp(-t^2) from 0 to infinity is sqrt(pi)/2, and the 2/sqrt(pi) prefactor cancels it). For negative x, erf is odd, so erf(-x) = -erf(x), giving the range (-1, 1). The endpoints -1 and 1 are only reached at plus or minus infinity.

Sources

Written by Dr. Rajiv Menon, PhD Applied Mathematician · Bengaluru, India

Applied mathematician bridging algebraic theory and computational tools for students, engineers, and everyday problem-solvers.

Search 3,500+ calculators

Loading search…