Maths & numbers

Absolute value calculator

Find the distance of a signed number from zero on the number line.

Your numbers

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Opposite numbers have the same absolute value. The distance from x to another point c is |x−c|.

THE FORMULA|x| = distance from 0

A worked example

−7 is seven units from zero, so |−7| = 7.

Good to know

Use a real number. The result is always nonnegative.

Measure distance from zero

Locate −7 on a number line and count the seven unit intervals back to zero. Distance has no direction, so the result is 7. A point at +7 is equally far from zero. The notation |x| expresses this distance and gives the piecewise rule |x| = x for x ≥ 0 and |x| = −x for x < 0.

The second branch explains why entering a negative value gives a positive result. Substituting −7 gives −(−7) = 7. At zero both descriptions agree, giving |0| = 0. The diagram uses equal spacing for each unit so that the two distances can be compared directly.

Both −7 and 7 are seven units from zero-7-6-5-4-3-2-1012345677 units7 units
Equal unit spacing makes the two distances comparable. The signed locations differ and their absolute values both equal seven.

Use absolute differences for distances

To measure the gap between two readings, subtract them before applying absolute value. Readings of −7 and 3 are |3 − (−7)| = 10 units apart. Taking the absolute values separately and subtracting would produce |3| − |−7| = −4, which answers a different expression.

In the Absolute change in units calculator, a change from 125 to 112 is −13 and its magnitude is 13. Keep the signed change when the direction matters, such as an account balance increasing or decreasing. Use the magnitude when you only need the size of the movement.

A few questions, answered

Can an absolute value be negative?

For a real input the result is always zero or positive. A minus sign outside the bars can make an expression negative, as in −|7| = −7.

Does absolute value round the input?

It changes the sign of a negative input and preserves its magnitude. For example, |−2.75| = 2.75.

Find your calculator

Start typing to explore the library.