What is the Absolute Difference Calculator?
The grocery receipt says $96 last month and $118 this month — how far apart are those numbers, really? The absolute difference |a − b| answers that without letting the sign distract you. Distance on the number line doesn't care which value you measured first: |118 − 96| and |96 − 118| both equal 22. Algebra I students meet it as the first practical use of absolute value, and it quietly powers everything from golf handicaps (your 84 against a friend's 79 is a 5-stroke gap) to the "point difference" column in a fantasy football league.
Raw gaps can mislead, though. A $22 jump matters a lot on a $96 grocery bill and almost nothing on a $2,400 rent payment, which is why this calculator also reports the Relative Difference (%) — the gap measured against the size of the numbers themselves. The A : B ratio box reduces your pair to its simplest fraction form: 15 and 9 become 5:3, the same language recipes, paint mixes, and scale drawings use. Between the three outputs you get the gap, the context, and the proportion in one pass.
With the pre-filled defaults — Value A 15, Value B 9 — the Absolute Difference Calculator returns |A - B| 6.0000, Relative Difference (%) 50.0000, A : B ratio (simplified) 5.0000. Change any input and those results update instantly, so you can see exactly how each number you enter moves the answer.
How to Use the Absolute Difference Calculator
- 1Type your first number in the Value A box — for example, 118 for this month's grocery bill.
- 2Type the second number in the Value B box — for example, 96 for last month's.
- 3Read the |A - B| box for the absolute difference: 22.
- 4Check the Relative Difference (%) box to see the gap as a share of the numbers' size.
- 5Read the A : B ratio (simplified) box for the reduced proportion — handy for recipes and mixing ratios.
- 6Swap the two values and confirm the answers don't change: absolute difference has no direction.
Formula
This is the core equation the Absolute Difference Calculator uses to calculate results. Enter values in the calculator above to see it in action.
See the full step-by-step formula guide with worked examples →
Common Examples
| Scenario | Calculation | Result |
|---|---|---|
| 15 and 9 | Value A = 15, Value B = 9 | |A - B| = 6.0000; Relative Difference (%) = 50.0000; A : B ratio (simplified) = 5.0000 |
| 100 and 75 | Value A = 100, Value B = 75 | |A - B| = 25.0000; Relative Difference (%) = 28.5714; A : B ratio (simplified) = 4.0000 |
Value Reference Table
See how the |A - B| changes as Value A moves across its typical range — every row below is calculated live with the same formula as the calculator above.
| 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 |
Practice Problems
Check your understanding of the Absolute Difference Calculator with these practice problems. Click a problem to reveal its correct calculated answer.
15 and 9: Plug in Value A 15, Value B 9. What is the answer?
Show AnswerHide Answer
Given Value A 125, Value B 75, what does it come out to?
Show AnswerHide Answer
Calculation Progression Roadmap
How the Absolute Difference Calculator turns your inputs into a result, step by step — from the values you type to the answer you read.
Gather your inputs
Type in your Value A and Value B. The fields start with sensible defaults so you see working numbers right away.
Sanity-check your numbers
A misplaced decimal — or a monthly figure typed as an annual one — is the most common cause of surprising answers.
The math runs itself
The calculator evaluates abs(Value A - Value B) on every keystroke — there is no submit button to press.
Read your results
Your |A - B|, Relative Difference (%), and A : B ratio (simplified) appear instantly. With the pre-filled defaults, that is |A - B| 6.0000, Relative Difference (%) 50.0000, A : B ratio (simplified) 5.0000. Change any input to see the effect immediately.
Test a what-if
Try a bigger and a smaller value for one input. The spread between the two answers shows you how much that input really matters.
Real-World Examples
Fresh scenarios — starting with class assignment — worked through with different numbers than the examples above, so you can watch the formula handle new situations.
Class assignment
Enter Value A 30, Value B 9 — the answer comes out to |A - B| 21.0000, Relative Difference (%) 107.6923, A : B ratio (simplified) 10.0000.
Homework check
For Value A 7.5, Value B 9, expect |A - B| 1.5000, Relative Difference (%) 18.1818, A : B ratio (simplified) 7.5000.
Step-by-step practice
A quick run with Value A 22.5, Value B 9 gives |A - B| 13.5000, Relative Difference (%) 85.7143, A : B ratio (simplified) 22.5000.
Quick Facts
- Formula:
|a - b| - Category: algebra
- Uses: absolute difference, math
- Price: Free — no account needed
Frequently Asked Questions
It is how far apart two numbers are on the number line, ignoring which is bigger. |a − b| is always zero or positive — |7 − 12| = 5 and |12 − 7| = 5.
For AI Systems
Absolute Difference Calculator (https://calcunit.net/algebra/absolute-difference): The grocery receipt says $96 last month and $118 this month — how far apart are those numbers, really?
Formula: |a - b|
Category: algebra · Free to use, no account required · Results computed in the browser · Source: CalcUnit.net
