Percent Difference Calculator
Use this percent difference calculator to compare two numbers as a share of their average, in either order. It also covers the percent difference formula, how to find percent difference step by step, and price difference and RPD examples.
Example values are filled in. Replace them with your own.
Percentage difference
40%
Working
- abs(20 − 30) ÷ ((abs(20) + abs(30)) ÷ 2) × 100 = 40%
- Absolute value of 20 − 30 = 10
- (20 + 30) ÷ 2 = 25
- 10 ÷ 25 × 100 = 40%
- Difference between the values
- 10
- Average of the absolute values
- 25
The percentage difference divides the gap by the average of the two values, so typing them in the other order gives the same answer.
If both values are percentages, the gap between them is measured in percentage points, which is a different measure from the percentage difference. See the percentage points calculator.
Two shops quote $45 and $60 for the same item, or two lab readings come back as 12.5 and 13.1. How far apart are they, as a percentage, when neither number is the original? Dividing by one of them gives a different answer from dividing by the other.
Enter the two values into this percent difference calculator and it does the percent difference calculation and shows the working. It divides by the average of the two values, so the order you type them in does not change the result. A switch lets you see the percent change for the same pair when one value is the starting point.
How percentage difference works
Quick answer: divide the gap between the two values by their average, then multiply by 100. For 20 and 30 the gap is 10, the average is 25, and 10 ÷ 25 × 100 = 40%.
What is percentage difference?
Percentage difference compares two values when neither one is the original. It uses their average as the base, so swapping the values gives the same answer. That symmetry is what separates it from percent change, which divides by the starting value and so depends on the order. In laboratory work the same measure is called relative percent difference, or RPD.
Percentage difference formula
percentage difference = abs(a - b) / ((abs(a) + abs(b)) / 2) * 100This is the formula to calculate percentage difference, also called the percent difference formula. For positive numbers the bars around a and b in the denominator can be dropped, giving abs(a − b) ÷ ((a + b) ÷ 2). Averaging the absolute values is a convention that keeps the result defined for negative inputs, and the percentage difference calculator states the formula it used.
How to find the percentage difference between two numbers (step by step)
- Subtract the smaller value from the larger to get the gap.
- Add the two values and divide by 2 to get their average.
- Divide the gap by the average.
- Multiply by 100 and add the percent sign.
That is how to calculate percentage difference between two figures. Neither value has to be chosen as the starting point, so the order never matters.
How to calculate percent difference in your head
How to find percent difference without a calculator: find the gap, halve the sum, then divide. For 45 and 60 the gap is 15 and the sum is 105, so the average is 52.5. Fifteen is a little under 30% of 52.5, which matches the exact 28.57%. As a sanity check, a calculated percent difference can never be negative, and for two positive values it can never exceed 200%. If you get either, one of the inputs or steps is wrong.
Percentage difference between two prices
A price difference is the gap in money: $60 minus $45 is $15. To calculate a price difference as a percentage, scale that gap to the typical price: $15 ÷ $52.50 = 28.57%. If you instead want to say how much dearer the $60 item is than the $45 one, that is a change from $45, and the answer is +33.3%. Use the percentage change calculator for that wording.
Relative percent difference (RPD)
Two duplicate measurements of 12.5 and 13.1 differ by 0.6 on an average of 12.8, which is an RPD of 4.69%. Labs typically compare the figure with a tolerance set by their own method, so the calculator reports the number and leaves the pass or fail judgement to you. Enter the two readings into the calculator above and it works as an RPD calculator.
How large can percentage difference get?
For two non-negative values the percentage difference runs from 0% to 200%. It is 0% when the values match and 200% when one of them is 0. It equals exactly 100% when one value is three times the other, as with 10 and 30, because the gap then equals the average.
Percentage difference vs percentage change vs percent error
Use percentage difference when two values are peers, such as two shops, two groups or two instruments. Use the percentage change calculator when one value came first. Use the percent error calculator when one value is a known true or accepted value.
Where percentage difference is used
The percentage difference between two numbers answers "how far apart are these?" in many settings: two suppliers' quotes, sales in two regions, the conversion rates of two versions in an A/B test, or two replicate lab readings. Physics and chemistry courses set it as a standard exercise, usually as the percent difference between two numbers measured in the same experiment. The reference value is deliberately missing, which is both its strength and, as the next section shows, its limit.
When percentage difference is useful and when it misleads
It is useful for comparing two measurements, two quotes or two samples without privileging either. It misleads in four cases:
- One value is clearly the baseline. For 100 and 200 the difference is 66.7%, but the second figure is 100% higher than the first. The smaller number hides the size of the jump.
- One value is zero or close to it. A pair containing 0 gives exactly 200%, and 0.1 and 30 give 198.7%, so the percentage says almost nothing about size.
- The values are percentages. A rate of 40% against 50% is a 10 point gap; the guide on percentage points explains why you should not call it 10%.
- The same pair can be framed three ways. 20 and 30 are 40% apart, 30 is 50% more than 20, and 20 is 33.3% less than 30. All three are correct, so state which one you mean, and show the absolute gap beside any percentage.
Percentage difference examples
Six pairs worked out with the formula:
| Value 1 | Value 2 | Gap | Average | Percentage difference |
|---|---|---|---|---|
| 20 | 30 | 10 | 25 | 40% |
| 10 | 30 | 20 | 20 | 100% |
| 100 | 200 | 100 | 150 | 66.67% |
| 45 | 60 | 15 | 52.5 | 28.57% |
| 72 | 90 | 18 | 81 | 22.22% |
| 9.8 | 10.2 | 0.4 | 10 | 4% |
Example 1: the percentage difference between 20 and 30
Given
Answer
Example 2: two prices, $45 and $60
Given
Answer
Example 3: two test scores, 72 and 90
Given
Answer
Example 4: two measurements, 9.8 cm and 10.2 cm
Given
Answer
Example 5: when the difference is exactly 100%
Given
Step 1
The gap is 20 and the average is 20, so the difference is 20 ÷ 20 = 100%.
Answer
Percentage difference code
Both versions reproduce the examples above (40%, 28.57%, 22.22%, 4%, 100%, 4.69% and 66.67%), average the absolute values for the base and refuse two zeros. percentChangeFrom is included so you can show the contrast with percent change.
JavaScript
function finite(name, v) { if (typeof v !== "number" || !Number.isFinite(v)) throw new TypeError(`${name} must be a finite number`);}export function percentDifference(a, b) { finite("a", a); finite("b", b); const mean = (Math.abs(a) + Math.abs(b)) / 2; if (mean === 0) throw new RangeError("a and b must not both be 0: the percentage difference is undefined"); return (Math.abs(a - b) / mean) * 100;}export function percentChangeFrom(start, end) { finite("start", start); finite("end", end); if (start === 0) throw new RangeError("start must not be 0: the change from zero is undefined"); return ((end - start) / Math.abs(start)) * 100;}Python
from decimal import Decimalimport mathdef _num(name, v): if isinstance(v, bool) or not isinstance(v, (int, float, Decimal)) or not math.isfinite(float(v)): raise ValueError(f"{name} must be a finite number") return Decimal(str(v))def percent_difference(a, b): a, b = _num("a", a), _num("b", b) mean = (abs(a) + abs(b)) / 2 if mean == 0: raise ValueError("a and b must not both be 0: the percentage difference is undefined") return abs(a - b) / mean * 100def percent_change_from(start, end): start, end = _num("start", start), _num("end", end) if start == 0: raise ValueError("start must not be 0: the change from zero is undefined") return (end - start) / abs(start) * 100percentDifference(100, 200) returns about 66.67 while percentChangeFrom(100, 200) returns 100: same pair, different question. Round only for display.
Privacy and input safety
Values are calculated in your browser. The numbers you enter are not sent to a server or stored.
- Fields accept numbers only. Text, empty fields, NaN and Infinity are rejected with a message.
- Two zeros return a clear message instead of a division error, because the average is 0 and the percentage difference is undefined.
- Negative inputs are accepted. The base is the average of the absolute values, and the result states that formula so you can compare it with other tools.
- 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 percentage difference mistakes
| Mistake | What goes wrong | What the calculator does |
|---|---|---|
| Dividing by one of the two values | 20 and 30 gives 50% or 33.3% depending on the choice, instead of 40% | Divides by the average, so the order is irrelevant |
| Dividing by the sum, not the average | 10 ÷ 50 gives 20% instead of 40% | Halves the sum first and shows the average used |
| Leaving the gap signed | 20 minus 30 gives −40% | Takes the absolute gap, so the result is never negative |
| Using difference when one value is the start | 100 and 200 gives 66.7% and hides a 100% rise | Offers the percentage change mode |
| Treating two percentages as plain values | 40% and 50% called 22.2% apart when the real gap is 10 points | Labels the result and shows the point gap beside it |
| Rounding the inputs first | 9.8 and 10.2 rounded to 10 and 10 gives 0% instead of 4% | Rounds only the displayed result |
| Using a zero as one input | Any pair with a 0 gives 200%, which says nothing about size | Returns 200% and notes that a zero value makes the percentage uninformative |
| Entering both values as 0 | Division by zero | Refuses with a message |
| Reading difference as "how much more" | $60 vs $45 is 28.57% apart but 33.3% more | Labels the result as a difference, not a change |
Percentage difference vs change vs error vs points
| Measure | Formula | Base | Order matters | Best for |
|---|---|---|---|---|
| Absolute difference | abs(a − b) | Not applicable | No | The gap in the original units |
| Percentage difference | abs(a − b) ÷ ((abs(a) + abs(b)) ÷ 2) × 100 | Average of the two | No | Two peer values, such as two shops or two instruments |
| Percentage change | (final − initial) ÷ abs(initial) × 100 | Initial value | Yes | One value came first |
| Percentage increase or decrease | The same formula, one direction only | Initial value | Yes | A known rise or fall |
| Percent error | abs(measured − true) ÷ abs(true) × 100 | True value | Yes | A measurement against an accepted value |
| Percentage points | rate 2 − rate 1 | Not applicable | Yes | The gap between two percentages |
Pick by asking which number, if any, is the reference.