Percent Error Calculator
Find percent error from an experimental value and a theoretical value in one step. It covers the percent error formula, equation and definition, how to calculate percentage error, whether percent error can be negative and average percent error.
Example values are filled in. Replace them with your own.
Percent error
2%
Working
- Absolute value of 9.8 − 10 = 0.2
- 0.2 ÷ 10 = 0.02
- 0.02 × 100 = 2%
- Absolute error
- 0.2
Use the same unit for both values.
Percent error depends on the zero point of the scale. Convert degrees C or F to kelvin first.
Your measurement came out at 2.62 g/cm³ and the textbook says 2.70. Is that close enough? Percent error answers it in one number: how far your experimental value sits from the accepted one, as a share of the accepted one.
Enter both values below and the calculator returns the percent error with the working shown, in absolute form and with its sign. It handles negative results, decimals and scientific notation.
How percent error works
Quick answer: percent error is the absolute difference between the experimental and theoretical values, divided by the theoretical value, times 100. A measured 2.62 against an accepted 2.70 gives 2.96%.
What is percent error?
The percent error definition is how far an experimental (observed) value sits from a theoretical (true, accepted) value, as a percentage of the theoretical value. It is the standard accuracy check in chemistry and physics labs. Percentage error is the same calculation under another name, and the percent error equation is the formula below.
The percent error formula
percent error = abs(experimental - theoretical) / abs(theoretical) * 100%The signed version drops the outer absolute value on the numerator, so the sign tells you whether you measured high or low:
signed percent error = (experimental - theoretical) / abs(theoretical) * 100%How to find percent error, step by step
- Subtract the theoretical value from the experimental value.
- Take the absolute value of the result for the standard form, or keep the sign for the signed form.
- Divide by the absolute value of the theoretical value.
- Multiply by 100 and add the % sign.
Negative percent error
Percent error is negative only in the signed form, when the experimental value is below the theoretical one. Most textbooks and teachers expect the absolute form, so check which one your course uses.
Absolute error and relative error
Absolute error is the difference itself, in the original units. Here is how to calculate relative error: divide that difference by the theoretical value, before multiplying by 100. Percent error is relative error written as a percentage.
Rearranging the formula
To recover the experimental value from a known percent error, use: experimental = theoretical × (1 ± percent error ÷ 100). The plus applies when you measured high, the minus when you measured low.
What is a good percent error?
There is no universal cut-off. In school labs, under 5% is usually treated as good and 10% as acceptable, but the right target depends on your instrument and method. A large percent error often signals a systematic problem, such as a miscalibrated balance, because random scatter tends to average out over repeated readings.
Average percent error
To average several results, work out the percent error for each one, then add them and divide by how many there are. Errors of 2%, 4% and 6% average 4%. Use absolute values, because +4% and −4% would cancel to 0%.
Percent error examples
Example 1: density of aluminium
Given
Step 1
The difference is 0.08, and 0.08 ÷ 2.70 = 0.0296.
Answer
Example 2: acceleration due to gravity
Given
Step 1
The difference is 0.16, and 0.16 ÷ 9.81 = 0.0163.
Answer
Example 3: percent error in a chemistry yield
Given
Step 1
The difference is 1.3, and 1.3 ÷ 12.5 = 0.104.
Answer
Example 4: a ruler against a known length
Given
Step 1
The difference is 0.5, and 0.5 ÷ 50.0 = 0.01.
Answer
Example 5: negative percent error
Given
Answer
Percent error code
Both versions return the same results as the examples above (2.96, 1.63, 10.4, 1.0 and −6.67) and reject a zero theoretical value.
JavaScript
export function percentError(experimental, theoretical, { signed = false } = {}) { for (const [name, v] of [["experimental", experimental], ["theoretical", theoretical]]) { if (typeof v !== "number" || !Number.isFinite(v)) throw new TypeError(`${name} must be a finite number`); } if (theoretical === 0) throw new RangeError("Percent error is undefined when the theoretical value is 0"); const diff = experimental - theoretical; return ((signed ? diff : Math.abs(diff)) / Math.abs(theoretical)) * 100;}export function parseInput(raw) { let s = String(raw).trim(); // 1,200 is a thousands separator; 12,50 and 0,500 use the comma as a decimal point if (/^[+-]?[1-9]\d{0,2}(,\d{3})+(\.\d+)?$/.test(s)) s = s.replace(/,/g, ""); else s = s.replace(",", "."); return /^[+-]?(\d+\.?\d*|\.\d+)(e[+-]?\d+)?$/i.test(s) ? Number(s) : NaN;}Python
import mathdef percent_error(experimental, theoretical, signed=False): for name, v in (("experimental", experimental), ("theoretical", theoretical)): if isinstance(v, bool) or not isinstance(v, (int, float)) or not math.isfinite(v): raise ValueError(f"{name} must be a finite number") if theoretical == 0: raise ZeroDivisionError("percent error is undefined when the theoretical value is 0") diff = experimental - theoretical if not signed: diff = abs(diff) return diff / abs(theoretical) * 100print(round(percent_error(2.62, 2.70), 2)) # 2.96Privacy and input safety
The calculation runs in your browser. The two values you enter are not sent to a server or stored.
- Inputs are read as numbers only. Text, empty fields and values such as NaN or Infinity are rejected with a message, never evaluated as code.
- A comma followed by exactly three digits is read as a thousands separator, so 1,200 is 1200. Any other comma is a decimal point, so 12,50 is 12.50, and a number starting with 0, such as 0,500, is read as a decimal. Mixed formats such as 1.234,5 and ambiguous entries such as 1,2,3 are refused instead of guessed. Spaces, including no-break spaces, between digit groups are ignored.
Common percent error mistakes
| Mistake | What goes wrong | What the calculator does |
|---|---|---|
| Dividing by the experimental value | Gives a different, wrong percentage (Example 1 would show 3.05%) | Always divides by the theoretical value |
| Swapping the two inputs | The absolute form changes only through the denominator; the signed form also flips sign | Labels both fields and shows the working |
| Forgetting to multiply by 100 | Result looks like 0.0296 instead of 2.96% | Returns a percentage |
| Rounding mid-calculation | Small drift in the last digit | Rounds only the final result, to four decimal places with trailing zeros removed (a tiny error shows more places, not 0) |
| Theoretical value of 0 | Division by zero | Shows "undefined" with the reason |
| Using temperatures in °C | Percent error depends on the zero point of the scale | Warns for °C or °F; use kelvin |
| Mixing units | 2.62 g/cm³ against 2700 kg/m³ gives 99.9% instead of 2.96% | Reminds you to use the same unit |
| Confusing it with percent difference | Percent error has a true value; percent difference compares two equal measurements | Links to the percent difference calculator |
Percent error vs percent difference vs percent change
| Measure | Formula | Use it when | Needs a true value |
|---|---|---|---|
| Percent error | abs(experimental − theoretical) ÷ abs(theoretical) × 100 | Checking a measurement against an accepted value | Yes |
| Percent difference | abs(a − b) ÷ ((a + b) ÷ 2) × 100 | Comparing two values of equal standing | No |
| Percent change | (new − old) ÷ abs(old) × 100 | Tracking a value from an earlier to a later point | No, but it has a direction in time |
| Relative error | abs(experimental − theoretical) ÷ abs(theoretical) | Same as percent error, left as a fraction | Yes |
Margin of error and standard error are statistical measures of sampling uncertainty. They do not compare one measurement with a known value, so they are not interchangeable with percent error.