Absolute Value Calculator
Result
|-15| 15
Sign of x Negative
|a + b| = |-5 + 3| 2
|a − b| = |-5 − 3| 8
|a × b| = |-5 × 3| 15
|a / b| = |-5 / 3| 1.666667
Distance |a − b| on number line 8
This absolute value calculator returns |x|, the distance of a number from zero, which is always zero or positive. Enter a single number to get its magnitude and sign, and enter two numbers a and b to see the absolute value of their sum, difference, product, and quotient, plus the distance |a − b| between them on the number line.
Formula
|x| = x if x ≥ 0, −x if x < 0 · Distance = |a − b|
- The absolute value |x| equals x when x ≥ 0 and −x when x < 0, so the result is never negative.
- Geometrically, |x| is the distance of x from 0 on the number line, and |a − b| is the distance between a and b.
- Absolute value distributes over multiplication and division: |a × b| = |a| × |b| and |a / b| = |a| / |b|.
- It does not distribute over addition: in general |a + b| ≠ |a| + |b| (the triangle inequality gives |a + b| ≤ |a| + |b|).
- The sign output tells you whether the original number was positive, negative, or zero before the bars were applied.
Example Calculation
Inputs
- Single Number |x|: -15
- a (for expressions): -5
- b (for expressions): 3
With x = −15, the magnitude is |−15| = 15 and the sign is negative. For a = −5 and b = 3: |a + b| = |−2| = 2, |a − b| = |−8| = 8, |a × b| = |−15| = 15, and the distance between them on the number line is |a − b| = 8.
Frequently asked questions
What is the absolute value of a number?
It is the number's distance from zero, written |x|. It strips away the sign, so |−15| = 15 and |15| = 15, and the result is always zero or positive.
What is the absolute value of zero?
|0| = 0. Zero is its own absolute value because its distance from zero on the number line is zero.
Does |a + b| equal |a| + |b|?
Not in general. The triangle inequality says |a + b| ≤ |a| + |b|, with equality only when a and b have the same sign.
How is absolute value used to measure distance?
The distance between two numbers a and b on the number line is |a − b|, which is the same whether you compute |a − b| or |b − a|.
Does absolute value work with multiplication and division?
Yes. |a × b| = |a| × |b| and |a / b| = |a| / |b| (for b ≠ 0), so you can take the absolute value before or after multiplying or dividing.