Quick answer

|x| uses one input. |a − b| uses two inputs and returns the gap between them.

Formula

  • |x| = distance from 0
  • |a − b| = distance between a and b
  • Both results are ≥ 0

Introduction

Distance questions in word problems often hide inside absolute value notation. Reading the story for one point versus two points picks the right formula.

Signed change tells you direction; distance tells you how far. A stock drop of $8 and a gain of $8 have different signs but the same magnitude if you only care about size.

The Absolute Value Calculator evaluates |x| for single-number checks. Read what is absolute value first, then the formula guide for |a − b| notation.

One point vs two points

Temperature −4°F is 4 units from zero on a relative scale, so |−4| = 4. That is a single-location reading measured from the origin of the scale.

If a hike starts at 120 m and ends at 95 m, the signed change is −25 m but the distance traveled along the vertical line is |120 − 95| = 25 m.

On a number line, draw both points and count the gap. The count should equal |a − b| regardless of which point you label first.

In one dimension, |a − b| matches the distance formula students later see in the plane, but planar distance uses the Pythagorean theorem instead of a single subtraction.

Distance formulas

  • |x| = |x − 0|
  • |a − b| = |b − a|
  • Order inside the bars does not change the distance
  • Distance is always ≥ 0

Treat |x| as a special case of two-point distance where the second point is zero.

When a problem gives coordinates on a line, subtract in either order and apply | | if needed.

Graphical views help when you plot gaps as vertical segments between points or between a V-shaped graph and a horizontal line.

Choosing the right measure

  1. Count how many locations you have. One number → |x|. Two numbers → |a − b|.
  2. Subtract in either order. For distance, |a − b| and |b − a| match.
  3. Apply | | if needed. If the subtraction is negative, the bars return the positive gap.
  4. Interpret units. Attach meters, dollars, or degrees as the story requires. Magnitude without units is incomplete in applied problems.

Dual readings

On a number line, |7 − (−2)| = |9| = 9. The points are nine units apart.

Bank balance moves from −$40 to $25. Signed change is $65, but if the question asks how far apart the balances are on a number line, |25 − (−40)| = 65.

|−8| = 8 measures distance from zero only, not distance between −8 and 5. For that, use |−8 − 5| = 13.