CalcUnit Logo

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

  1. 1Type your first number in the Value A box — for example, 118 for this month's grocery bill.
  2. 2Type the second number in the Value B box — for example, 96 for last month's.
  3. 3Read the |A - B| box for the absolute difference: 22.
  4. 4Check the Relative Difference (%) box to see the gap as a share of the numbers' size.
  5. 5Read the A : B ratio (simplified) box for the reduced proportion — handy for recipes and mixing ratios.
  6. 6Swap the two values and confirm the answers don't change: absolute difference has no direction.

Formula

|a - b|

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

ScenarioCalculationResult
15 and 9Value A = 15, Value B = 9|A - B| = 6.0000; Relative Difference (%) = 50.0000; A : B ratio (simplified) = 5.0000
100 and 75Value 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)
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

Practice Problems

Check your understanding of the Absolute Difference Calculator with these practice problems. Click a problem to reveal its correct calculated answer.

Q1

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

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

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

Show 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.

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.

01

Gather your inputs

Type in your Value A and Value B. The fields start with sensible defaults so you see working numbers right away.

02

Sanity-check your numbers

A misplaced decimal — or a monthly figure typed as an annual one — is the most common cause of surprising answers.

03

The math runs itself

The calculator evaluates abs(Value A - Value B) on every keystroke — there is no submit button to press.

04

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.

05

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.

1

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.

2

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.

3

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

Share this Calculator

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