Absolute Value Calculator

Find the absolute value of any number, or the distance between two numbers, with exact step-by-step math and an answer that is never negative.

Loading calculator…

What absolute value means

The absolute value of a number is its distance from 00 on the number line — a measurement that is always zero or positive, no matter which direction the number sits in. Written with bars around the number, x|x|, absolute value strips away the sign and keeps only the size:

7=77=7|7| = 7 \qquad |-7| = 7

Both 77 and 7-7 are exactly 77 units away from 00, just on opposite sides, so both have the same absolute value.

|x|: distance from zero

For a single number xx, x|x| answers "how far is xx from 00?":

  • If xx is positive or 00, it's already its own distance from 00: x=x|x| = x.
  • If xx is negative, its distance from 00 is the same size with the sign dropped: x=x|x| = -x (which is positive, since xx itself is negative).
xxx\lvert x \rvert
5555
5-555
0000
3.5-3.53.53.5
Tip: A quick way to think about it: absolute value never changes a positive number or zero, and it flips a negative number to positive. It never produces a negative result.

|a − b|: distance between two numbers

Wrapping a subtraction in absolute value bars gives the distance between two numbers, regardless of which one is larger:

ab=distance between a and b|a - b| = \text{distance between } a \text{ and } b

Plain subtraction aba - b can come out negative if bb is bigger than aa, but the bars erase that sign, so the order never changes the answer:

310=7=7103=7=7|3 - 10| = |-7| = 7 \qquad |10 - 3| = |7| = 7

Both compute the same distance — 77 units — between 33 and 1010 on the number line. This calculator's "distance between two numbers" mode uses exactly this |a − b| form.

Absolute value is always ≥ 0

Because absolute value measures distance, it can never be negative. The smallest possible absolute value is 00, which happens only when the input itself is 00 — every other number, positive or negative, has a strictly positive distance from 00. This calculator's answer is always zero or positive; if you ever see a negative result for an absolute value, something has gone wrong upstream.

Worked examples

Example 1 — single negative number: 7=7|-7| = 7, since 7-7 is 77 units from 00.

Example 2 — exact decimal: 3.5=3.5|3.5| = 3.5; a positive number is already its own absolute value.

Example 3 — distance between two numbers: 310=7|3 - 10| = 7 and 103=7|10 - 3| = 7 — swapping the order gives the same distance.

Example 4 — zero: 0=0|0| = 0, the only number that is its own (and only) distance from itself.

Where absolute value shows up

Absolute value appears throughout math and science: measuring error or deviation (how far a measurement is from a target, regardless of direction), computing distance on a number line or between coordinates, and defining functions piecewise around a sign change. It's closely related to the Square Root calculator — for any real number xx, x=x2|x| = \sqrt{x^2}, since squaring erases the sign and the (principal) square root always returns a non-negative value.

Frequently asked questions

What is absolute value?
The absolute value of a number xx, written x|x|, is its distance from 00 on the number line — always zero or positive, regardless of the number's sign. So 7=7|7| = 7 and 7=7|-7| = 7, since both 77 and 7-7 are 77 units away from 00.
Why is |-7| equal to 7, not -7?
Absolute value measures distance, and distance can't be negative. 7-7 sits 77 units to the left of 00 on the number line, so its distance from 00 is 77 — the same distance as +7+7, which sits 77 units to the right. Taking absolute value simply drops the sign: 7=7|{-7}| = 7.
What does |a - b| mean?
It means the distance between aa and bb on the number line, no matter which one is bigger. Subtracting the two numbers can give either a positive or a negative result depending on the order, but wrapping the subtraction in absolute value bars always returns the non-negative distance: 310=7=7|3 - 10| = |-7| = 7, and 103=7=7|10 - 3| = |7| = 7 — the same answer either way.
Does the order of a and b matter in |a - b|?
No. ab|a - b| always equals ba|b - a|, because reversing the subtraction just flips the sign of the result inside the bars, and absolute value erases that sign. 310=7|3 - 10| = 7 and 103=7|10 - 3| = 7 are the same distance measured from either direction.
Can absolute value ever be negative?
No — absolute value is defined to always be zero or positive. There is no real number whose absolute value is negative. The only way to get 00 out of x|x| is when xx itself is 00, since 00 is its own distance from 00.
How is absolute value different from just removing a minus sign?
For a single negative number they look the same (7=7|-7| = 7 is "drop the sign"), but absolute value is really a distance measurement, which is why it also works on expressions like ab|a - b| — you can't just "remove a minus sign" from a subtraction; you compute the difference first, then take its magnitude.

Related calculators