CalcUnit Logo

How to Calculate Absolute Difference

Find the absolute difference between two numbers.

The Formula

|a - b|

The absolute difference formula uses the mathematical relationship: |a - b|. Each variable in the formula represents a measurable quantity that affects the final result.

What Each Variable Means

Every value in the absolute difference formula, what it measures, and the value used in the worked example on this page:

VariableTypeExample value
Value AInput (you provide)15
Value BInput (you provide)9
|A - B|Result (calculated)—
Relative Difference (%)Result (calculated)—
A : B ratio (simplified)Result (calculated)—

Step-by-Step Method

  1. 1Write down the values you know: Value A, Value B.
  2. 2Substitute your known values into the formula: |a - b|.
  3. 3Work through the arithmetic in the standard order of operations — parentheses first, then exponents, then multiplication and division, then addition and subtraction.
  4. 4Check that your result carries the correct unit and falls in a reasonable range for the problem.
  5. 5Verify your answer with the interactive Absolute Difference Calculator — it solves the same formula instantly.

Worked Example

Take a concrete case: value a = 8, with the other inputs at the typical values from the variables table above. Substituting into the formula gives |a - b| = 1.0000, relative difference (%) = 11.7647, a : b ratio (simplified) = 8.0000. These numbers are solved by the same engine that powers the Absolute Difference calculator, so you can reproduce them exactly by entering the same inputs there.

Value A|A - B|Relative Difference (%)A : B ratio (simplified)
45.000076.92314.0000
81.000011.76478.0000
101.000010.526310.0000
2011.000075.862120.0000
3021.0000107.692310.0000
4031.0000126.530640.0000
5041.0000138.983150.0000
6051.0000147.826120.0000

How each result changes as value a changes, holding the other inputs constant.

Practice Problems

1. 15 and 9: Plug in Value A 15, Value B 9. What is the answer?

Answer: Entering Value A 15, Value B 9 gives |A - B| 6.0000, Relative Difference (%) 50.0000, A : B ratio (simplified) 5.0000.

2. Given Value A 125, Value B 75, what does it come out to?

Answer: The calculator returns |A - B| 50.0000, Relative Difference (%) 50.0000, A : B ratio (simplified) 5.0000 for Value A 125, Value B 75.

Frequently Asked Questions

What is the formula for absolute difference?

The formula is: |a - b|. Find the absolute difference between two numbers.

What values do I need to calculate absolute difference?

You need value a, value b. The calculator produces |a - b|, relative difference (%), a : b ratio (simplified) from those inputs.

What is the absolute difference when value a is 8?

With value a = 8, the result is |a - b| = 1.0000, relative difference (%) = 11.7647, a : b ratio (simplified) = 8.0000. This is worked through in full in the example on this page.

Related Topics

absolute differencemath

Use the Interactive Calculator

Skip the manual math — get instant results with our free Absolute Difference calculator.

Open Calculator

Related Calculators