Error function calculator
erf(1) is 0.842700689748 and erfc(1) is 0.157299310252: the two numbers you need for normal probabilities, heat spread and measurement uncertainty. Enter any real value and get both, with an error below 1.5e-7. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- X
- 1
- Erf
- 0.842700689748
- Erf number
- 0.8427006897
- Erfc
- 0.157299310252
- Erfc number
- 0.1572993103
The error function calculator evaluates the Gauss error function erf(x) — the integral of the Gaussian bell curve from 0 to x, scaled so the result always lies between -1 and 1. You send one real number and get back erf(x) together with the complementary error function erfc(x) = 1 - erf(x), computed with a rational approximation accurate to 1.5e-7. It is the function behind normal probabilities, heat diffusion and measurement uncertainty, evaluated in a single deterministic step.
What the error function actually measures
The Gauss error function is defined as erf(x) = (2/√π) times the integral of e^(-t²) from 0 to x. That integral has no closed form in elementary functions, which is exactly why erf exists as a named function: statisticians, physicists and engineers ran into it so often that it earned its own letter.
Its graph is an S-curve that starts at erf(0) = 0, rises smoothly and flattens out towards 1 as x grows; it is an odd function, so erf(-x) = -erf(x), and erf(-1) ≈ -0.8427 mirrors erf(1) ≈ 0.8427. In probability it converts standard deviations into confidence: the probability that a normally distributed value falls within x standard deviations of the mean is erf(x/√2), which is why erf(1/√2) ≈ 0.6827 is the famous 68 percent of the bell curve.
In heat transfer and diffusion it describes how a temperature front or a concentration gradient spreads over time.
How the approximation works
Because the defining integral cannot be written with elementary functions, every implementation of erf is an approximation, and the honest question is how good it is. Its absolute error is at most 1.5e-7 for every real input — far below anything a displayed result or a downstream probability calculation will notice. The implementation exploits the odd symmetry of the function so the polynomial only ever runs on a non-negative argument, then restores the sign at the end, which keeps the approximation on exactly the domain its coefficients were fitted to.
The computation is a fixed sequence of floating-point operations with one exponential: no loops, no convergence thresholds, no randomness and no clock, so the same input always produces the same output. Results are rounded to 12 decimal places, comfortably above the approximation's own error floor, so nothing meaningful is discarded.
What you can do with it
Convert z-scores to confidence
Evaluate erf(x/√2) to turn a number of standard deviations into the probability mass inside a normal distribution's central band.
Check a diffusion or heat-spread model
Verify a simulation against the analytic erf solution that governs one-dimensional diffusion from a step boundary.
Validate another implementation
Feed a reference value and compare against a deterministic result accurate to 1.5e-7, with erfc included for tail checks.
FAQ
How accurate is the result?
The approximation is Abramowitz & Stegun 7.1.26, whose absolute error is at most 1.5e-7 for any real input. Results are rounded to 12 decimal places.
What input does it accept?
A single finite real number in the x field. Numeric strings like "1.5" work too.
What is the range of the output?
Always between -1 and 1. The function is odd, so erf(-x) = -erf(x), and it approaches but never exceeds ±1 as |x| grows.
What is erfc and why is it included?
erfc(x) = 1 - erf(x) is the complementary error function, which measures the probability mass in the tail. It is returned alongside erf so tail calculations do not need a second call.
How do I get a normal probability from erf?
The probability that a standard normal variable falls between -z and z is erf(z/√2).
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/math/error-function \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"x":1}'const res = await fetch("https://api.kit.forhosting.com/math/error-function", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"x": 1
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/math/error-function",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"x": 1
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/math/error-function", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"x":1}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"x":1}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/math/error-function", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"x": 1
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "math.error_function",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
What the error function actually measures
This endpoint evaluates the function for a single real value and returns the result between -1 and 1, plus erfc, the complementary error function, which measures the remaining tail.
How the approximation works
This capability uses formula 7.1.26 from Abramowitz and Stegun's Handbook of Mathematical Functions: a five-term polynomial in t = 1/(1 + 0.3275911·|x|), multiplied by e^(-x²) and subtracted from 1.
Inputs, outputs and limits
There are no size limits to declare because the input is a single scalar and the work is constant time. If you need the inverse function, arbitrary precision beyond 1.5e-7, or the imaginary error function erfi, those are separate tools; this one answers the forward question erf(x) for real x, and answers it deterministically. The API takes one field, x, which must be a finite real number. Numeric strings such as "1.5" are accepted because web forms submit text, but NaN, Infinity, booleans and objects are rejected with a typed invalid_input error that is never billed. The response contains the value in both display and machine forms: erf as a trimmed decimal string for direct display and erf_number as a JSON number for chaining in code, plus erfc and erfc_number with the complementary error function, and a note naming the method and its error bound. The same code runs free in your browser on this page — paste a value and read the result — while automated calls through the API cost $0.002 per request.
Technical questions
What does it cost?
$0.002 per request via the API. It is also free to run in your browser on this page, with the same code and the same result.