Absolute Value of a Number

Compute the absolute value of any real number — its distance from zero on the number line, always non-negative. Enter a positive, negative, or decimal number to get |number| instantly.

Absolute Value5
Sign of Number
-1
Negative of Absolute Value
-5

The absolute value |x| is the non-negative magnitude of x: it removes the sign. For example, |-7| = 7 and |3.5| = 3.5.

What the Absolute Value Calculator Does

This Absolute Value Calculator returns the absolute value of any number you enter, written as |x|. The absolute value is the distance of a number from zero on the number line, so the result is always zero or positive. Enter a value like -7 and it returns 7; enter 4.2 and it returns 4.2.

It is useful for students checking algebra and pre-calculus homework, engineers and finance users measuring how far a reading deviates from a target, and anyone who needs a quick magnitude without worrying about direction or sign.

How Absolute Value Works (The Formula)

Absolute value strips the sign from a number while keeping its size. The standard piecewise definition is:

|x| = x when x is greater than or equal to 0, and |x| = -x when x is less than 0.

The second case can look confusing: when x is negative, -x is actually positive. For example, if x = -5, then -x = -(-5) = 5. An equivalent formula used in programming and spreadsheets is |x| = sqrt(x^2), since squaring removes the sign and the square root returns the non-negative root.

Worked Example

Suppose you want |-12.5|. Because -12.5 is less than 0, you apply the second rule: |x| = -x = -(-12.5) = 12.5. The number sits 12.5 units to the left of zero, so its distance from zero is 12.5.

Check it with the square-root method: sqrt((-12.5)^2) = sqrt(156.25) = 12.5. Both approaches agree, which is exactly what the calculator returns.

Working With Expressions Inside the Bars

If the input is an expression, evaluate everything inside the bars first, then take the absolute value. Treat the bars like parentheses for order of operations.

For instance, |3 - 9| = |-6| = 6, not 3 - 9 = -6. Likewise, a coefficient outside the bars multiplies after you take the absolute value: 2 x |-4| = 2 x 4 = 8.

Common Mistakes and Tips

A few errors come up repeatedly. Keep these points in mind when using absolute value:

  • Absolute value is never negative. |x| = 0 only when x = 0; otherwise the result is positive.
  • It does not simply delete the minus sign in every step. |-x| is not always x unless you know x is non-negative; |-(−5)| = 5, but the rule depends on the actual value.
  • Distribute carefully: |a + b| is generally not |a| + |b|. For example, |3 + (-7)| = 4, but |3| + |-7| = 10.
  • For an absolute value equation like |x| = 6, remember there are two solutions, x = 6 and x = -6.
  • When measuring error or deviation, absolute value gives the magnitude of the gap regardless of whether the reading was above or below target.

Where Absolute Value Is Used

Beyond homework, absolute value appears anywhere direction does not matter but size does. In statistics it underlies the mean absolute deviation; in quality control and instrumentation it measures how far a measurement strays from a setpoint; in finance it can express the size of a gain or loss without its sign.

On a number line you can read it directly: the absolute value of any point is simply how many units it sits from zero, in either direction.

Frequently asked questions

What is absolute value?

The absolute value of a number is its distance from zero on the number line, ignoring direction. It is always zero or positive, written as |x|.

What is the absolute value of a negative number?

It is the same number with the sign removed. For example, |-12| = 12 and |-0.8| = 0.8.

Can absolute value be negative?

No. Absolute value is never negative because it measures magnitude. The smallest possible result is 0, which occurs only when the input is 0.

What does the sign output mean?

It shows whether the original number was positive (1), negative (-1), or zero (0), which tells you which direction the value pointed before its sign was removed.