How to use the Absolute Value Calculator
- Enter the value you want the magnitude of.
- Enter a second value to measure the distance between them.
- Read |x| and |x − y| together.
- Use the sign row when direction matters separately from size.
How the calculation works
Absolute value returns distance from zero, so |−42.5| and |42.5| are both 42.5. Formally it is defined piecewise: x when x ≥ 0, and −x when x < 0. The second branch confuses people because it looks like it produces a negative; it does not, since negating a negative gives a positive.
The more useful reading is |x − y| as the distance between two points on the number line, which is symmetric: |3 − 7| and |7 − 3| both equal 4. This is the one-dimensional case of a metric, and it generalises to the Euclidean distance formula in higher dimensions. It is also why absolute deviation appears in statistics — mean absolute deviation averages distances from the mean, treating overshoot and undershoot as equally bad.
In inequalities, |x| < a means −a < x < a (a band around zero), while |x| > a splits into two separate regions. Getting that split wrong is the most common algebra error involving absolute values.
|x| = x if x ≥ 0, else −x ; distance = |x − y| ; |x| < a ⟺ −a < x < aSource: Standard definition of absolute value and the one-dimensional metric.
Worked example
A machined part must sit within 0.05 mm of a 12.00 mm target; the measured piece is 11.962 mm.
- Deviation: |11.962 − 12.00| = 0.038 mm.
- Compare with the tolerance: 0.038 < 0.05.
- Direction: undersize.
Within tolerance, but biased undersize — worth checking the tool offset before the next run.
Frequently asked questions
Is |−x| always positive?+
Non-negative. It is zero when x is zero, and positive otherwise.
How does absolute value work in inequalities?+
|x| < a becomes a band, −a < x < a. |x| > a becomes two separate regions.
Why use absolute deviation instead of squared error?+
Absolute deviation is robust to outliers; squared error punishes large misses far more heavily.
Does it apply to complex numbers?+
Yes — there it is the modulus, the distance from the origin in the complex plane.
Last reviewed September 1, 2026. We review this page whenever the underlying formula, tax year, published rate or standard changes.