~/tools/percentage-difference $ run calculator --percent-diff
Percentage Difference Calculator
Compare two independent values (no chronological before/after) using their average as the base.
The percentage difference calculator compares two numbers by dividing their absolute difference by their mathematical average, multiplying the quotient by 100.
40%
Step-by-step: (|10 - 15| / ((10 + 15) / 2)) × 100 = (5 / 12.5) × 100 = 40%
💡 HOW IT DIFFERS: Difference vs. Change
This page calculates Percentage Difference, which treats both numbers with equal importance.
If you compared $10 and $15, the percentage difference is 40% because:
|10 - 15| / 12.5 = 5 / 12.5 = 40%.
If you calculated Percentage Change going from $10 to $15, the increase is 50% (because the starting $10 is the denominator). If you calculated change going from $15 down to $10, it is a -33.33% decrease. Use this Difference calculator when comparing prices between two competitor brands!
// How to Calculate Percentage Difference
Percentage difference comparisons are applied when analyzing two items side-by-side where there is no logical "old" or "new" value. Examples include comparing the prices of similar goods at different supermarkets, or the scores of two separate classes.
Mathematical Formula:
% Difference = (|A - B| / ((A + B) / 2)) × 100
Worked Example: Comparing 10 and 15
Suppose you want to find the percentage difference between 10 and 15.
1. Calculate their absolute difference: |10 - 15| = 5.
2. Calculate their average: (10 + 15) / 2 = 12.5.
3. Divide the difference by the average: 5 / 12.5 = 0.40.
4. Multiply by 100 to get a percentage: 0.40 × 100 = 40%.
Therefore, the percentage difference between 10 and 15 is 40%.
// Frequently Asked Questions
▸Why can percentage difference not be negative?
Because of the absolute value brackets (|A - B|) in the numerator. It only measures the numerical difference between the values, ignoring the direction of change.
▸What happens if one of the values is negative?
The calculator applies standard math rules. For example, comparing 10 and -10: Difference is |10 - (-10)| = 20. The average is (10 + -10)/2 = 0. Since the average is 0, a division-by-zero error is triggered gracefully.
▸Is percentage difference symmetric?
Yes. Comparing A to B yields the exact same percentage difference as comparing B to A. This is not true for percentage change calculations.
▸When should I use percentage change instead?
Use percentage change when one number chronologically precedes another, representing a starting point, or when there is a clear direction of growth or shrinkage.