Skip to main content

Example values are filled in. Replace them with your own.

Percentage difference

40%

Working

  1. abs(20 − 30) ÷ ((abs(20) + abs(30)) ÷ 2) × 100 = 40%
  2. Absolute value of 20 − 30 = 10
  3. (20 + 30) ÷ 2 = 25
  4. 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) * 100

This 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)

  1. Subtract the smaller value from the larger to get the gap.
  2. Add the two values and divide by 2 to get their average.
  3. Divide the gap by the average.
  4. 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:

Percentage difference examples
Value 1Value 2GapAveragePercentage difference
2030102540%
10302020100%
10020010015066.67%
45601552.528.57%
7290188122.22%
9.810.20.4104%

Example 1: the percentage difference between 20 and 30

Given

The gap is 10 and the average is (20 + 30) ÷ 2 = 25.

Answer

Then 10 ÷ 25 = 0.40, so the percentage difference is 40%. Typing 30 and 20 gives the same 40%.

Example 2: two prices, $45 and $60

Given

The gap is $15 and the average price is $52.50.

Answer

Then 15 ÷ 52.5 = 0.2857, which is 28.57%. Neither shop is the baseline, so the average is a fair reference.

Example 3: two test scores, 72 and 90

Given

The gap is 18 and the average is 81.

Answer

Then 18 ÷ 81 = 0.2222, a 22.22% difference. If 72 was last term's score and 90 this term's, use percent change instead, which gives +25%.

Example 4: two measurements, 9.8 cm and 10.2 cm

Given

The gap is 0.4 cm and the average is 10 cm, so the difference is 0.4 ÷ 10 = 4%.

Answer

A round average makes this one easy to check in your head.

Example 5: when the difference is exactly 100%

Given

Take 10 and 30.
  1. Step 1

    The gap is 20 and the average is 20, so the difference is 20 ÷ 20 = 100%.

Answer

This happens whenever one value is three times the other.

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

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

Python
from decimal import Decimalimport math​​def _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 * 100​​def 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) * 100

percentDifference(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

Common percentage difference mistakes
MistakeWhat goes wrongWhat the calculator does
Dividing by one of the two values20 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 average10 ÷ 50 gives 20% instead of 40%Halves the sum first and shows the average used
Leaving the gap signed20 minus 30 gives −40%Takes the absolute gap, so the result is never negative
Using difference when one value is the start100 and 200 gives 66.7% and hides a 100% riseOffers the percentage change mode
Treating two percentages as plain values40% and 50% called 22.2% apart when the real gap is 10 pointsLabels the result and shows the point gap beside it
Rounding the inputs first9.8 and 10.2 rounded to 10 and 10 gives 0% instead of 4%Rounds only the displayed result
Using a zero as one inputAny pair with a 0 gives 200%, which says nothing about sizeReturns 200% and notes that a zero value makes the percentage uninformative
Entering both values as 0Division by zeroRefuses with a message
Reading difference as "how much more"$60 vs $45 is 28.57% apart but 33.3% moreLabels the result as a difference, not a change

Percentage difference vs change vs error vs points

Percentage difference vs change vs error vs points
MeasureFormulaBaseOrder mattersBest for
Absolute differenceabs(a − b)Not applicableNoThe gap in the original units
Percentage differenceabs(a − b) ÷ ((abs(a) + abs(b)) ÷ 2) × 100Average of the twoNoTwo peer values, such as two shops or two instruments
Percentage change(final − initial) ÷ abs(initial) × 100Initial valueYesOne value came first
Percentage increase or decreaseThe same formula, one direction onlyInitial valueYesA known rise or fall
Percent errorabs(measured − true) ÷ abs(true) × 100True valueYesA measurement against an accepted value
Percentage pointsrate 2 − rate 1Not applicableYesThe gap between two percentages

Pick by asking which number, if any, is the reference.

Frequently asked questions

How do I find percent difference?

Divide the gap between the two values by their average and multiply by 100. For 20 and 30 the gap is 10 and the average is 25, so the percent difference is 40%. It is the same whichever value you put first.

How do I calculate the percentage difference between two figures?

Use the same formula on any pair of figures. For sales figures of 1,200 and 1,500 the gap is 300, the average is 1,350 and 300 ÷ 1,350 × 100 = 22.22%.

How do you calculate difference in percentage between two numbers?

Take the absolute gap between them, divide by their average and multiply by 100. For 45 and 60 that is 15 ÷ 52.5 × 100 = 28.57%.

How do I calculate increase percentage between two numbers?

If one number is clearly the starting value, use percentage change, not percentage difference: divide the gap by the starting value. From 20 to 30 that is +50%, while the percentage difference between the same two numbers is 40%.

How do I calculate the difference of percentages?

When both values are percentages, the plain gap is in percentage points: 40% and 50% are 10 points apart. The percentage difference between them is 10 ÷ 45 × 100 = 22.22%, a different quantity.

How do I find the percentage between two numbers?

The phrase covers three tasks. For the share one number makes of another, divide it by the other: 20 is 66.67% of 30. For the symmetric gap, use percentage difference: 40%. For a move from one to the other, use percentage change: +50% from 20 to 30.

What is the percentage difference between two numbers?

It is the gap between the numbers as a percentage of their average. It has no direction, so it suits comparing two values when neither is the reference.