Math Runs locally Ready to use Built-in examples No tracking

Percent Error Calculator

Enter the observed (measured) value and the theoretical (true) value to get absolute error, signed error, relative error and percent error; both denominator conventions are shown.

Lab reports, machined parts and instrument calibration all have to answer "how accurate was the measurement?" — "a bit off" is not an answer, because you need a percentage to compare against a tolerance. Enter the measured and true values and you get the absolute deviation and the relative percentage together, ready to check against a homework answer.

Mind the denominator: the standard definition divides by the true value (measured 10.2 against true 10.0 → 2% error), but some fields (financial forecasts, sales estimates) divide by the measured value — that is how MAPE works. The same data gives different numbers under the two conventions, so state which one you used; this tool lists both.

How to use

  1. Enter the measured (observed) value and the true (theoretical) value.
  2. Read the absolute error, the signed error and the percent error.
  3. Compare the two denominator conventions — the standard one divides by the true value.
  4. Copy the result and note the denominator convention in your report to avoid ambiguity.

How it works

How to calculate percent error

Three steps: take the absolute error |E − T|, divide by the denominator to get the relative error, then multiply by 100% to express it as a percentage. With a measurement of 2.5 against a true value of 2.4: the absolute error is 0.1, the relative error is 0.1 ÷ 2.4 ≈ 0.0417, so the percent error is about 4.17%. The formula takes an absolute value, so the result is always positive; whether the measurement reads high or low comes from the signed error E − T (positive here, so the measurement is high).

True value or measured value as the denominator?

Textbooks and most lab reports divide by the true value (|E − T| ÷ |T|), because the true value is the shared reference. Some reports divide by the measured value instead; that denominator changes with every measurement and is usually slightly smaller than the true-value version. Same example: 4.17% under the true-value convention, 0.1 ÷ 2.5 = 4% under the measured-value one. This tool lists both, so just state which you used.

The same absolute error is not the same error

The absolute error carries units and cannot be compared across magnitudes: a difference of 1 is a 10% error when the true value is 10, but only 0.01% when it is 10,000. Also, when the true value is 0 the standard formula divides by zero and the percent error is undefined — only the absolute error is meaningful then.

Calculation basis: percent error = |E − T| ÷ |T| × 100% (the standard convention), with the alternative denominator |E − T| ÷ |E| shown alongside. Direction comes from the signed error E − T, and when the true value is 0 the standard formula is undefined. Raw values keep double-precision accuracy; display is rounded to 6 significant digits.

Code example

JavaScript Two choices of denominator

function percentError(observed, trueValue) {
  const absErr = Math.abs(observed - trueValue);
  return {
    absErr,
    signedErr: observed - trueValue,
    pctTrue: absErr / Math.abs(trueValue) * 100,   // standard convention
    pctObs: absErr / Math.abs(observed) * 100      // MAPE convention
  };
}

percentError(10.2, 10.0);   // pctTrue: 2, pctObs: 1.96

Python The same formulas in Python

def percent_error(observed, true_value):
    abs_err = abs(observed - true_value)
    return {"pct_true": abs_err / abs(true_value) * 100,
            "pct_obs": abs_err / abs(observed) * 100}

percent_error(10.2, 10.0)   # {"pct_true": 2.0, "pct_obs": 1.96}

FAQ

What is the percent error formula?

Percent error = |E − T| ÷ |T| × 100%, where E is the measured (observed) value and T the true (theoretical) value. For a measurement of 9.8 against a true value of 10: |9.8 − 10| ÷ 10 × 100% = 2%. The outer absolute value means the result is never negative.

What is the difference between percent error and relative error?

A factor of 100: relative error is a decimal (0.02), percent error is a percentage (2%). People use the two loosely in speech, but be consistent in a report. This tool outputs both, so you do not have to convert by hand.

Why use the true value rather than the measured value as the denominator?

The true value is a fixed reference, so measurements taken against the same true value stay comparable. The measured value fluctuates from run to run, so using it as the denominator removes that common basis. Some lab reports still use the measured value, so this tool computes and shows both conventions.

What counts as an acceptable error?

There is no universal threshold — it depends on the field and the instrument. Teaching labs often accept within 5%, while precision measurement and engineering calibration often require 1% or even 0.1%. Check your field's standards or the instrument datasheet rather than applying a single number everywhere.

Can it tell whether the measurement is high or low?

Yes. The percent error formula takes an absolute value and shows magnitude only; this tool also reports the signed error E − T, which is positive when the measurement is high, negative when it is low, and exactly 0 for a perfect match (measured 100, true 100). That direction matters when you keep calibration records.

How is it calculated when the measured value is 0?

As long as the true value is not 0 the standard formula still works: measured 0 against true 5 gives |0 − 5| ÷ 5 = 100%. Using the measured value as the denominator is undefined at 0, so the tool suggests switching conventions or simply reading the absolute error of 5.

Can percent error be negative?

By the formula (with its absolute value) it cannot. Some software prints a negative value to indicate an under-measurement; that is just a different sign convention and does not change the magnitude. This tool always reports a positive value and gives the direction separately.

Why does the same absolute error give very different percent errors?

Because percent error is relative: an absolute error of 1 is 10% against a true value of 10, 1% against 100 and only 0.01% against 10,000. When comparing the accuracy of quantities at different scales, look at percent error rather than absolute error alone.