What is absolute value?
The absolute value of a number, written \(|x|\), is its distance from zero on the number line. Distance is never negative, so the absolute value of any real number is always zero or positive. For example, both 5 and -5 sit five units away from 0, so \(|5| = 5\) and \(|-5| = 5\). This calculator works with any real number — positive, negative, whole, or decimal.
How to use this calculator
Type a value into the "x =" box. You can enter a leading minus sign for negatives and a decimal point for fractions (for example -9.27). Use the result to read both the absolute value and the rule that was applied. Submit the form to compute \(|x| =\) instantly.
The formula explained
Absolute value is defined piecewise: \(|x| = x\) when \(x\) is greater than or equal to 0, and \(|x| = -x\) when \(x\) is less than 0. The second case flips the sign of a negative number, turning it positive.
$$|x| = \begin{cases} x & \text{if } x \ge 0 \\ -x & \text{if } x < 0 \end{cases}$$An equivalent definition is \(|x| = \sqrt{x^2}\), since squaring removes the sign and the square root returns the magnitude. Either way, the output is never negative.
Worked example
Suppose \(x = -5\). Because -5 is less than 0, we apply \(|x| = -x\), giving $$-(-5) = 5.$$ So the distance from 0 to -5 is 5 units. Likewise, \(|12.5| = 12.5\) and \(|0| = 0\). Zero is the single value whose absolute value is neither positive nor negative — it is simply 0.
FAQ
Can the result ever be negative? No. Absolute value measures distance, which is always 0 or greater.
What is the absolute value of 0? It is 0. Zero is neither positive nor negative, and its distance from itself is 0.
Does this handle complex numbers? No. This tool covers only real numbers. For a complex number \(a + bi\) the magnitude is \(\sqrt{a^2 + b^2}\), which is a different calculation.