Error Function Calculator
Calculate erf(x), erfc(x), and the inverse error function for any real input.
The error function underpins the normal CDF and Gaussian diffusion equations.
The error function is defined as erf(x) = (2/√π) · ∫₀ˣ e^(−t²) dt. The name comes from its original use in describing error distributions in physical measurements (J.W.L. Glaisher, late 19th century), but it now appears all over mathematics, physics, and statistics, anywhere a Gaussian gets integrated.
Key values to keep in mind: erf(0) = 0, erf(∞) = 1, and erf(−x) = −erf(x). The function is odd and approaches ±1 very fast: by x = 2 it’s already erf(2) ≈ 0.9953.
The complementary form is erfc(x) = 1 − erf(x), and that identity is exact. Calculating it that way is not. By x = 4, erf(x) and 1 are neighbouring numbers in floating point, so subtracting them leaves almost nothing behind, and erfc(5) works out as zero instead of 1.54×10⁻¹². Anything living in the tail has to compute erfc on its own terms, which is what this page does.
Why it matters: the normal CDF connection. The error function and the standard normal CDF are the same function in different clothing. If Z is a standard normal variable,
P(Z ≤ z) = ½ × (1 + erf(z / √2)).
That means every normal-distribution probability, from every Z-table entry to every p-value to every confidence-interval bound, can be written in terms of erf. The two formalisms exist because statisticians and physicists adopted slightly different conventions in the 1800s and never reconciled them.
Worked example, quality control. A factory makes bolts whose diameters are normally distributed around the spec. What fraction land within ±1 standard deviation of the mean? Plug z = 1 into the relation: P(−1 ≤ Z ≤ 1) = erf(1/√2) = erf(0.7071) ≈ 0.6827. That’s the famous “68%” of the 68-95-99.7 rule, falling out directly from the error function.
Worked example, heat conduction and diffusion. Consider a long bar initially at temperature T₀, with one end suddenly held at T₁. The temperature at distance x from the heated end after time t follows
T(x, t) = T₀ + (T₁ − T₀) · erfc(x / (2√(D·t)))
where D is thermal diffusivity. The same erfc shape governs ion diffusion in semiconductors, drug diffusion across membranes, contaminant spread in groundwater, and dopant profiles in transistor manufacturing. A semiconductor with diffusion length L = 0.5 µm and a question about how much dopant gets past 1 µm: erfc(1 / (2 · 0.5)) = erfc(1.0) = 1 − 0.8427 ≈ 15.7% of atoms.
The inverse, erfinv(y). Solving erf(x) = y for x produces the quantile function, used for sampling from a normal distribution, computing critical values, and any “given the probability, what is the threshold?” question.
About the numerics. erf and erfc here are the two halves of the incomplete gamma function evaluated at a = ½: erf(x) = P(½, x²) and erfc(x) = Q(½, x²). A power series covers the region near zero and a continued fraction takes over in the tail, which keeps the relative error near 10⁻¹⁰ everywhere. Relative is the word that matters. The familiar Abramowitz & Stegun rational fit (formula 7.1.26) is quoted as accurate to 1.5×10⁻⁷ absolute, which sounds fine until you ask it for erfc(5): the true answer is 1.54×10⁻¹², a hundred thousand times smaller than the error bar, so the fit returns noise or zero. Anything doing reliability tails or deep diffusion profiles needs the erfc branch computed on its own rather than as 1 − erf.
A quick sanity check you can run in your head: erf(1/√2) = 0.6827, erf(2/√2) = 0.9545, erf(3/√2) = 0.9973. Those are the 68-95-99.7 figures, and if a library disagrees with them at the fourth decimal it is not computing erf properly.
How we build and check this calculator
This calculator runs entirely in your browser, so the numbers you enter stay on your device. The math behind it is written by hand and tested against worked examples and standard references before the page goes live.
SuperGlobalCalculator is independently built and maintained. See how we build and verify our calculators.
More Math Calculators
- Extended Euclidean Algorithm Calculator
- F Distribution Calculator
- F-Test Calculator
- Five Number Summary Calculator
- Frequency Distribution Calculator
- Gamma Function Calculator
- Geometric Distribution Calculator
- Golden Rectangle Calculator
- Gradient Calculator
- Hypergeometric Distribution Calculator
- Hypothesis Test Calculator
- Implicit Differentiation Calculator