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:
| Variable | Type | Example value |
|---|---|---|
| Value A | Input (you provide) | 15 |
| Value B | Input (you provide) | 9 |
| |A - B| | Result (calculated) | — |
| Relative Difference (%) | Result (calculated) | — |
| A : B ratio (simplified) | Result (calculated) | — |
Step-by-Step Method
- 1Write down the values you know: Value A, Value B.
- 2Substitute your known values into the formula: |a - b|.
- 3Work through the arithmetic in the standard order of operations — parentheses first, then exponents, then multiplication and division, then addition and subtraction.
- 4Check that your result carries the correct unit and falls in a reasonable range for the problem.
- 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) |
|---|---|---|---|
| 4 | 5.0000 | 76.9231 | 4.0000 |
| 8 | 1.0000 | 11.7647 | 8.0000 |
| 10 | 1.0000 | 10.5263 | 10.0000 |
| 20 | 11.0000 | 75.8621 | 20.0000 |
| 30 | 21.0000 | 107.6923 | 10.0000 |
| 40 | 31.0000 | 126.5306 | 40.0000 |
| 50 | 41.0000 | 138.9831 | 50.0000 |
| 60 | 51.0000 | 147.8261 | 20.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
Use the Interactive Calculator
Skip the manual math — get instant results with our free Absolute Difference calculator.
