ForHosting KIT · Math

Relative error calculator

A reading of 105 against a true value of 100 misses by 5, a relative error of 0.05 or 5%. Enter the measured and the true value to get the absolute relative error as a fraction or a percentage, for calibration, homework or tolerances. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Measured
105
True value
100
You get
Value
0.05
Signed error
5
Absolute error
5
Relative error
0.05

Relative error measures how far a measured value sits from the true value, as a fraction of that true value. This relative error calculator subtracts the true value from the measured value, takes the absolute value of that difference, and divides by the absolute value of the true value. The result is a non-negative unitless number: zero only when the two figures match exactly.

What absolute relative error measures and how it differs from percent change and MSE

Relative error answers a comparison question that absolute error cannot: how large is the miss relative to the size of the thing being measured. Algebraically the absolute error is the absolute value of measured minus true, and the relative error is that absolute error divided by the absolute value of the true value. The result is a non-negative unitless fraction.

A measured reading of one hundred five against a true value of one hundred is an absolute miss of five and a relative error of five hundredths, or five percent. The same absolute miss of five against a true value of one thousand is only five thousandths, so relative error is the quantity people want when they compare instruments, rounding schemes, or numerical methods across different scales.

Negative true values are legal: the denominator uses the absolute value, so a measured minus nine point five against a true minus ten still yields five hundredths.

Where a relative error calculator earns its keep

Laboratories and instrument shops reduce a single reading against a certified standard to a relative miss when they calibrate a balance, a voltmeter, a thermometer, or a survey tape. Numerical-methods courses ask for the relative error of an approximation against a known closed form, and teachers need a deterministic oracle that refuses a zero true value instead of printing Infinity in a grading script.

Manufacturing and quality teams compare a measured dimension to a drawing nominal and want the miss as a fraction of the nominal, not only as millimetres, so a one-millimetre miss on a ten-millimetre part is not confused with a one-millimetre miss on a metre-long part. Failed validation does not consume balance.

Lab calibration against a standard

Score one instrument reading against a certified true value and report the absolute relative error as a fraction or a percent.

Homework and numerical-methods keys

Check an approximation against a known closed form with a deterministic oracle that rejects a zero true value.

Manufacturing tolerance as a fraction of nominal

Compare a measured dimension to the drawing nominal so a miss is expressed relative to the size of the part.

What does the relative error calculator cost?

It is free in your browser on this page.

What happens if the true value is zero?

Relative error divides by the true value, so a zero denominator is undefined and no Infinity is returned.

Is the result signed or absolute?

The primary result is the absolute relative error, always non-negative.

How do I get the result as a percentage?

The fraction and the percent are both returned in every successful response.

How is this different from percentage change or mean squared error?

Percentage change is a signed movement from an old value to a new value. Mean squared error averages squared residuals across two series. This page scores one measured reading against a known true value.

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.

POSThttps://api.kit.forhosting.com/stat/relative-error

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.

curl -X POST https://api.kit.forhosting.com/stat/relative-error \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"measured":105,"true_value":100}'
{
  "measured": 105,
  "true_value": 100
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "stat.relative_error",
  "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.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Set as_percent to true to receive the same quantity as a percentage. A true value of zero makes the ratio undefined, so that case fails with invalid_input instead of Infinity.

What absolute relative error measures and how it differs from percent change and MSE

This page always reports the absolute relative error: over-estimates and under-estimates do not cancel and the sign of the residual is not the primary result, although the payload still echoes the signed difference so you can see the direction. That is different from signed percentage change, which asks how much a quantity moved from an old observation to a new one and keeps the sign of the movement. It is also different from mean squared error, which averages squared residuals across a whole paired series rather than scoring a single reading against a known truth. A true value of zero makes the ratio undefined, because there is no scale to divide by; the calculator rejects that case with invalid_input rather than returning Infinity or NaN.

Input contract, the algorithm, and how the percent option is applied

POST a JSON body with two required finite numbers: measured, the experimental or observed reading, and true_value, the accepted, theoretical, or exact figure. Each field may arrive as a JSON number or as a numeric string. Common aliases are accepted when the canonical name is omitted: measured_value, experimental, observed, approx, or approximation for measured; true, accepted, theoretical, exact, or actual for true_value. The optional as_percent flag defaults to false. Missing fields, empty strings, non-numeric text, NaN, and Infinity fail with invalid_input naming the field and are not billed. A zero true_value is rejected because the formula divides by that value; those failures are not billed either. Computation is a single deterministic pass: signed error is measured minus true_value, absolute error is the absolute value of that difference, relative error is absolute error divided by the absolute value of true_value, and the percent form is that fraction times one hundred. The payload always returns both the unitless fraction and the percent so a reviewer can check the arithmetic, and it also returns value as the primary result selected by as_percent. When as_percent is false, value equals relative_error and the formula string is the fraction identity. When as_percent is true, value equals relative_error_percent and the formula string includes the multiply-by-one-hundred. Example: measured one hundred five and true_value one hundred yields relative_error zero point zero five and relative_error_percent five. Example: measured nine point eight and true_value ten with as_percent true yields value two.

Where a relative error calculator earns its keep

Scientists reporting a computed constant against a published accepted value use the same identity, and they need both the fraction and the percent on one payload so a paper, a notebook, and a dashboard never disagree. Keep the two numbers finite and the true value non-zero, pin relative_error and relative_error_percent in tests, and you get a reproducible miss-versus-truth figure for labs, homework, and edge workers without standing up a computer-algebra stack of your own.

Read the full KIT documentation →