ThisCalculator

Statistics

Calculate Accuracy Between Two Numbers: Formula and Examples

Updated · Standard formula, shown below

Percentage accuracy 95.00 %
Absolute error
5.00
Result
Reference value
100
You entered
Measured value
95
You entered

Calculate Accuracy Between Two Numbers: Formula and Examples

To calculate accuracy between two numbers, compare the measured or estimated value with the accepted reference value: percentage accuracy is 100% minus the absolute percentage error. Enter the reference value and the value being checked; the calculator returns percentage accuracy and the absolute error, using the same units as your inputs.

Formula

Percentage accuracy, under the common relative-error convention, is calculated as:

Accuracy (%) = 100 × [1 − |measured value − reference value| ÷ |reference value|]

  • Reference value (ref) is the accepted or target number.
  • Measured value (val) is the number being evaluated.
  • Absolute error is |val − ref|, the nonnegative difference between the two values, in the same unit as the inputs.

The calculator also reports absolute error separately. Percentage accuracy is meaningful only when the reference value is not zero. If the reference is zero, the formula would divide by zero, so use the absolute error or another comparison measure instead. The formula can produce a negative percentage when the error is larger than the reference’s magnitude; that is a mathematical result, not a percentage that should automatically be capped at zero.

Worked Example

With the calculator’s defaults, the reference value is 100 and the measured value is 95. Both are unitless example numbers; in a real comparison, they should represent the same quantity in matching units.

  1. Find the absolute difference: |95 − 100| = 5.
  2. Divide the difference by the absolute reference: 5 ÷ 100 = 0.05.
  3. Subtract that relative error from 1 and convert to a percentage: 100 × (1 − 0.05) = 95.00%.
  4. The absolute error is 5 in the input unit.

Thus, for these inputs, the calculator reports 95.00% accuracy and an absolute error of 5. The result says that the measured value differs from the reference by 5% of the reference’s magnitude.

What the Accuracy Result Means

Accuracy describes how close a result is to a reference, but people use the word in more than one way. The percentage above is a convenient transformation of relative error: an exact match gives 100%, and a difference equal to 1% of the reference gives 99%. It is not a universal measure that applies identically to every field or task.

For instance, if a reference distance is 200 meters and a reading is 196 meters, the absolute error is 4 meters and the relative error is 4 ÷ 200 = 2%. Under this convention, percentage accuracy is 98%. The same calculation works in feet if both values are expressed in feet. Converting both numbers to another shared unit does not change the percentage accuracy.

Accuracy is also different from precision. Accuracy concerns closeness to the accepted value; precision concerns the repeatability or spread of repeated measurements. A set of readings can be tightly clustered but consistently offset from the reference, making it precise but inaccurate. Conversely, readings may average close to the reference while varying considerably from one trial to another.

When to Use This Calculation

Use the formula when there is one meaningful reference value and you want to describe a measured, predicted, or reported value’s relative difference from it. It can help compare errors across quantities with different scales, provided the reference values are nonzero and the comparison is appropriate.

  • Measurements: Compare a reading with a known reference, keeping units consistent.
  • Estimates: Compare an estimate with an observed or accepted value after that value is available.
  • Model results: Summarize the relative error for one prediction, while recognizing that one case does not establish overall model performance.

For a collection of measurements or predictions, calculate an appropriate summary across all cases rather than treating one example as proof of general accuracy. Depending on the purpose, useful summaries may include mean absolute error, root mean square error, or mean absolute percentage error. Each summarizes a set differently and has its own limitations; for example, percentage-based measures become problematic when reference values are zero or close to zero.

Common Mistakes and Limitations

  • Reversing the comparison: Put the accepted reference in the denominator. Using the measured value instead answers a different question and can give a different percentage.
  • Mixing units: Do not subtract 2 meters from 200 centimeters directly. Convert one value so both use the same unit first.
  • Ignoring the sign: Absolute error uses absolute value, so it describes the size of the difference. If direction matters, also report signed error, measured value minus reference value.
  • Using a zero reference: Relative error and this percentage-accuracy formula are undefined at zero. Report absolute error or choose a comparison method suited to the data.
  • Overinterpreting decimals: A result such as 98.73% is only as credible as the inputs and reference. Rounding the display does not make the underlying measurement more certain.

The result can also be misleading when the reference is extremely small: even a small absolute difference can become a very large relative error. In such cases, provide the absolute error alongside the percentage, as this calculator does, and explain the scale of the quantity. The formula itself does not account for measurement uncertainty, tolerance limits, data quality, or the practical importance of an error.

Frequently Asked Questions

How do I calculate accuracy as a percentage?
Subtract the reference from the measured value, take the absolute difference, divide by the absolute reference, and multiply the resulting relative error by 100. Subtract that percentage error from 100% to get accuracy under the convention used here.

What is the difference between accuracy and error?
Error is the difference between a measured value and its reference. Absolute error gives the difference’s size; relative error expresses that size as a fraction of the reference. The percentage-accuracy formula converts relative error into a value where a perfect match is 100%.

Can accuracy be more than 100%?
Not with this formula when the reference is nonzero: absolute relative error is zero or greater, so the calculated accuracy is 100% or less. Other methods sometimes label different scores as “accuracy,” so check how a particular score is defined.

What if the reference number is zero?
You cannot use this relative-accuracy formula because it divides by the reference. Report the absolute difference instead, or select a measure designed for the particular comparison.

Should I use absolute error or percentage accuracy?
Use absolute error when the difference in the quantity’s own units is most useful. Percentage accuracy helps put relative differences in context across scales, but can mislead when the reference is near zero. Reporting both often provides a clearer picture.

Related

Formula used
in ref | Reference value | - | 100 | 0
in val | Measured value | - | 95 | 0
out accuracy | Percentage accuracy | % | 100 * (1 - abs(val - ref) / abs(ref)) | 2
out error | Absolute error | - | abs(val - ref) | 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.