Absolute and Relative Error Calculator: Formulas and Examples
- Relative error
- Result
- Percentage error
- %
- Result
- Reference value
- 100
- You entered
An absolute and relative error calculator compares a measured or estimated value with a reference value, then reports the difference and its size relative to the reference. Enter the reference value and the approximate value to get absolute error, relative error, and percentage error.
Formula
Absolute error is the magnitude of the difference between the approximate value and the reference value. Relative error is absolute error divided by the magnitude of the reference value. Percentage error is relative error multiplied by 100.
- Absolute error: Eabs = |a − r|
- Relative error: Erel = |a − r| / |r|
- Percentage error: E% = 100 × Erel
Here, r is the reference or accepted value and a is the approximate, measured, or calculated value. Both must use the same units. Absolute error has the same unit as the values being compared; relative error is dimensionless, and percentage error is expressed as a percent. The calculator uses the magnitude of the reference value in the denominator so that the relative error is nonnegative.
Worked Example
Using the calculator’s defaults, the reference value is 100 and the approximate value is 98. These values can represent any quantity, provided they share a unit.
- Subtract the reference from the approximate value: 98 − 100 = −2.
- Take the absolute value: |−2| = 2. The absolute error is 2.
- Divide by the magnitude of the reference: 2 / |100| = 0.02. The relative error is 0.0200, or 2% as a proportion.
- Convert the proportion to a percentage: 100 × 0.02 = 2.00%.
The approximate value is 2 units below the reference, but the absolute error reports the size of the difference without its direction. To show direction, use the signed difference, a − r = −2.
When to Use Each Error Measure
Absolute error is useful when the size of a discrepancy in the original unit matters. If a distance measurement differs from a reference by 0.4 metres, the absolute error is 0.4 m. In US customary units, the same idea applies to inches, feet, or miles. Convert both values to the same unit before comparing them; do not subtract metres from feet or kilograms from pounds.
Relative error helps compare discrepancies across values of different scales. An error of 1 unit is substantial when the reference is 2, but small when the reference is 10,000. Percentage error expresses that relative difference in a familiar form. For example, a measurement of 49 against a reference of 50 has an absolute error of 1 and a percentage error of 2%.
- Use absolute error to report a difference in the original measurement unit.
- Use relative error to judge the discrepancy in proportion to a nonzero reference.
- Use percentage error when a proportional result is easier to communicate as a percent.
How to Read the Result
The calculator displays absolute error as a nonnegative magnitude. It does not tell you whether the approximation is too high or too low. Check the signed difference, a − r, for direction: a positive value means the approximation is above the reference, and a negative value means it is below.
A relative error of 0.02 means the absolute difference is 2% of the reference magnitude. It is not itself 0.02%; multiply by 100 to express it as a percentage. A result of 0 means the two values match exactly at the precision entered. A small percentage does not automatically mean a result is accurate enough for a particular task; acceptable tolerance depends on the purpose and measurement method.
Common Mistakes and Limitations
- Using mismatched units: Convert measurements to a common unit before calculation. This applies whether you use metric units such as millimetres and metres or customary units such as inches and feet.
- Dividing by the approximate value: The standard relative-error formula uses the reference value in the denominator, not the approximation.
- Forgetting the percentage conversion: Relative error is a ratio. Multiply it by 100 to get a percentage.
- Rounding too early: Keep the original values through the calculation, then round the displayed result to an appropriate number of decimal places.
- Using a zero reference: Relative and percentage error are undefined when the reference is zero because division by zero is not defined. Absolute error can still be calculated.
Relative error can also be misleading when the reference is very close to zero: even a small absolute difference can produce a very large ratio. In that situation, report the absolute error and explain the scale or tolerance that matters. The standard formula also treats the reference as the comparison baseline; if neither value is a known standard, choosing a denominator is a matter of convention and should be stated.
Frequently Asked Questions
What is the difference between absolute error and relative error?
Absolute error is the magnitude of the difference between two values, in their original units. Relative error divides that difference by the magnitude of the reference, making it a unitless proportion.
How do I calculate percentage error?
Calculate |approximate − reference| / |reference|, then multiply by 100. For a reference of 50 and an approximation of 49, the result is 2%.
Can relative error be greater than 1?
Yes. It exceeds 1 when the absolute difference is larger than the reference magnitude. As a percentage, that is greater than 100%.
What happens if the reference value is zero?
Absolute error remains calculable, but relative and percentage error are undefined because their formula divides by the reference magnitude. Do not treat the calculator’s result as a finite percentage in this case.
Does absolute error show whether a result is high or low?
No. Absolute error is nonnegative and shows only the size of the difference. Use the signed difference, approximate minus reference, to see whether the approximation is above or below.
Related
Formula used
in r | Reference value | - | 100 | 0 in a | Approximate value | - | 98 | 0 out ae | Absolute error | - | abs(a - r) | 2 out re | Relative error | - | abs(a - r) / abs(r) | 4 out pe | Percentage error | % | 100 * abs(a - r) / abs(r) | 2
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.