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 erfc(x) = 1 − erf(x) is easier to compute accurately for large x, where erf is so close to 1 that direct subtraction loses precision.
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 — every Z-table entry, every p-value, 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. This calculator uses the Abramowitz & Stegun rational approximation (formula 7.1.26), which keeps the maximum absolute error below 1.5×10⁻⁷ across the entire real line. That’s good enough for essentially any practical statistical or engineering calculation. For symbolic work or higher-precision needs, software like Mathematica or SciPy uses series expansions and continued fractions to push further.
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.