Absolute Difference Calculator

Find how far apart two numbers are, |a − b|, or compare two lists pair by pair and get the mean absolute difference.

Compare
Signed difference a − b
−22.5
Signed difference b − a
22.5
Midpoint (a + b) ÷ 2
3.25
Percent difference
200%relative to the average of |a| and |b|
Change from a to b
281.25%
|−8 − 14.5|22.5

Show the work

  1. Subtract: a − b = −8 − 14.5 = −22.5.
  2. Take the absolute value: |−22.5| = 22.5. The order does not matter, because |b − a| = |22.5| = 22.5 as well.
−15−10−505101520distance 22.5a = −8b = 14.5

The absolute difference tells you how far apart two numbers are, no matter which one is bigger. It answers everyday questions like “how many degrees apart were the high and the low?” or “how far off was my estimate?” This calculator finds |a − b| for two numbers, shows the gap on a number line, and can also compare two lists value by value to give the mean absolute difference.

How to use the absolute difference calculator

  1. Choose Two numbers or Two lists, pair by pair.
  2. For two numbers, type a and b. Negatives, decimals and fractions are accepted.
  3. For two lists, paste the values separated by commas, spaces or new lines. Both lists need the same number of values; the first value of List A is paired with the first value of List B, and so on.
  4. Read the result on the tape. For a pair you also get the signed differences, the midpoint and the percent difference; for lists you get the sum, the mean, the largest and smallest gap, and a table of every pair.

Absolute difference formula

absolute difference = |a − b| = |b − a|

For two lists of n paired values:

mean absolute difference = ( |a₁ − b₁| + |a₂ − b₂| + … + |an − bn| ) ÷ n

Worked examples

Temperatures: a winter low of −8 °F and an afternoon high of 14.5 °F. The difference is |−8 − 14.5| = |−22.5| = 22.5 °F. On a number line the two points are 22.5 units apart, with the midpoint at 3.25.

Forecast accuracy: five daily sales forecasts of 10, 16, 12, 17 and 18 units against actual sales of 12, 15, 9, 20 and 18. The pair-by-pair gaps are 2, 1, 3, 3 and 0, which sum to 9, so the mean absolute difference is 9 ÷ 5 = 1.8 units per day.

Absolute, signed and relative differences

Measure Formula For a = −8, b = 14.5
Absolute difference |a − b| 22.5
Signed difference a − b −22.5
Percent difference |a − b| ÷ ((|a| + |b|)/2) × 100 200%
Percent change from a to b (b − a) ÷ |a| × 100 281.25%

Use the absolute difference when the units matter (“the parts differ by 0.2 mm”), the signed difference when direction matters (“the temperature rose”), and a relative measure when comparing gaps between values of very different sizes. A $5 difference is large for a $10 item and negligible for a $10,000 one. For relative comparisons see the percentage difference calculator and the percent error calculator.

Why use the mean absolute difference?

The mean absolute difference (or mean absolute error) treats every miss equally and stays in the original units, so “off by 1.8 units a day on average” is easy to explain. The calculator also reports the root-mean-square difference, which squares the gaps before averaging and therefore penalizes a few large misses more heavily. In the forecast example the root-mean-square difference is about 2.14, a little higher than 1.8 because of the two misses of 3.

Connections

  • The absolute difference between two numbers is the distance between them on the number line, the one-dimensional case of the distance formula.
  • The range of a data set is the absolute difference between its largest and smallest values.
  • |a − b| is always at least ||a| − |b||, a consequence of the triangle inequality.

For the absolute value of a single number or to solve equations such as |x − 3| = 5, use the absolute value calculator.

Frequently asked questions

What is the absolute difference between two numbers?

It is the size of the gap between them, ignoring which is larger: |a − b|. The absolute difference between −8 and 14.5 is |−8 − 14.5| = |−22.5| = 22.5. It is always zero or positive and does not depend on the order.

How is absolute difference different from percent difference?

Absolute difference is measured in the same units as the numbers, such as 3 degrees or $20. Percent difference divides that gap by the average of the two values, so it is a relative measure without units.

What is the mean absolute difference between two lists?

Pair the values up, take the absolute difference of each pair, and average those differences. When one list holds predictions and the other actual results, this is the mean absolute error (MAE), a common measure of forecast accuracy.

Why not just subtract?

Plain subtraction gives a signed difference, which depends on order: 5 − 9 = −4 but 9 − 5 = 4. When you only care how far apart the values are, the absolute difference gives the same answer either way.

Last reviewed October 2026 by the CalcFluent editorial team. How we check our calculators.