Percentage error

Calculate percentage error with clear inputs and assumptions.

Calculate percentage error with clear inputs and assumptions.

Both dots and commas are accepted as decimal separators.

Your inputs stay in your browser. Displayed results are rounded to a maximum of 12 significant digits.

Method and assumptions

Method version 1.0.0 · Updated

Calculate

Formula: Calculate percentage error with clear inputs and assumptions.

Calculate percentage error with clear inputs and assumptions.

expected
Reference value (> 0)
actual
Measured value

Results are estimates where noted and depend on the entered assumptions.

Calculate with code

These short examples use the same inputs and core calculation as this tool. Adapt validation and formatting to your application.

JavaScript
const measured = 9.5, expected = 10;
console.log(Math.abs(measured - expected) / Math.abs(expected) * 100); // 5%
TypeScript
const measured = 9.5, expected = 10;
console.log(Math.abs(measured - expected) / Math.abs(expected) * 100); // 5%
Python
measured, expected = 9.5, 10
print(abs(measured - expected) / abs(expected) * 100)  # 5.0
Java
double measured = 9.5, expected = 10;
System.out.println(Math.abs(measured - expected) / Math.abs(expected) * 100); // 5.0
C#
double measured = 9.5, expected = 10;
Console.WriteLine(Math.Abs(measured - expected) / Math.Abs(expected) * 100); // 5