Percentage difference calculator

How far apart two numbers are, as a percentage, when neither of them came first. It is a different number from the percentage change, and this shows you both — because over fourteen thousand pairs tested, the two formulas agree on just two kinds of case, and both are the tidy ones people check calculators with. Nothing you type here leaves your browser — it is worked out on your own device, so there is nothing to send and nothing to log.

Two formulas, two answers, one name

Percentage difference compares two numbers neither of which came first. Percentage change measures a move from one to the other. They are asked for interchangeably and they are not the same:

difference = |a − b| ÷ ((|a| + |b|) ÷ 2) × 100

change = (b − a) ÷ |a| × 100

40 and 60, difference40%
40 to 60, change50%
60 to 40, change−33.33%

Difference is symmetric: swap the two numbers and it cannot change. Change is not, and that is the whole distinction. If the question has a before and an after, you want change. If it has two measurements of the same kind of thing — two quotes, two readings, two results — you want difference.

Where the two agree, and why that is a trap

Every pair of whole numbers from −60 to 60 was tested against both formulas — 14,520 pairs, once the undefined ones are dropped. They agree on 180, and those 180 fall into exactly two families:

The same number twice120 pairs, both formulas give 0%
A negative and its exact opposite60 pairs, −7 and 7, both give 200%

There is no third family. Three hundred thousand random pairs were swept looking for one and none turned up. Change the second number by any amount and the two formulas part.

Which means every case that cannot tell the formulas apart is one somebody would naturally reach for to check a percentage calculator: the same number in both boxes, or a tidy sign flip. Both give the right answer under the wrong formula.

The textbook denominator divides by zero

Every source writes the denominator as (a + b) ÷ 2 — the plain mean of the two numbers. That is fine while both are positive. Give it −10 and 10 and their mean is zero, so the formula divides by zero for two numbers that are plainly 200% apart in size.

This page divides by the mean of their sizes, (|a| + |b|) ÷ 2, which is defined everywhere except two zeros and agrees with the textbook wherever the textbook is defined. When your numbers make the textbook version fail, the reading says so rather than quietly using a different formula.

Where to go next