Skip to main content
Back to Calculators

Absolute Value Calculator

Find the absolute value (magnitude) of any number. |x|

Last updated: 10/8/2026

The absolute value of a number is its distance from zero on the number line, ignoring direction, so it is never negative. |−7| and |7| are both 7. Enter any real number, including decimals and negatives, and the calculator returns |x| together with the sign of the input. The page below covers the definition, the algebraic rules that follow from it, and how to solve equations that contain absolute value bars.

Calculator Inputs

Results

Enter values above to see your results

How It Works

By definition |x| = x when x ≥ 0 and |x| = −x when x < 0. In words: a non-negative number is unchanged, a negative number has its sign flipped. Equivalently |x| = √(x²), which is why squaring removes absolute value bars in algebra. The calculator applies the piecewise definition directly.

Rules that follow from the definition

Absolute value distributes over multiplication and division but not over addition: |a × b| = |a| × |b| and |a ÷ b| = |a| ÷ |b|, while |a + b| ≤ |a| + |b| (the triangle inequality, with equality only when a and b have the same sign or one is zero). For example |−3 × 4| = 12 = |−3| × |4|, but |−3 + 4| = 1, which is less than 3 + 4 = 7.

The distance between two numbers a and b on the number line is |a − b|, which is the same as |b − a|. This is the most common practical use: a tolerance of ±0.5 mm around 20 mm is the set of lengths L with |L − 20| ≤ 0.5.

Solving equations with absolute value

An equation of the form |expression| = k with k > 0 splits into two ordinary equations: expression = k and expression = −k. So |x − 3| = 5 gives x − 3 = 5 or x − 3 = −5, hence x = 8 or x = −2. If k = 0 there is one solution (expression = 0), and if k < 0 there is none, because an absolute value cannot be negative. Inequalities follow the same pattern: |x − 3| < 5 means −5 < x − 3 < 5, i.e. −2 < x < 8, while |x − 3| > 5 means x < −2 or x > 8.

Worked example

Absolute value of −42

Check the sign:−42 < 0= Negative, so use |x| = −x
Apply the rule:−(−42)= 42

Solve |2x + 1| = 9

Split into two cases:2x + 1 = 9 or 2x + 1 = −9= Two linear equations
Case 1:2x = 8= x = 4
Case 2:2x = −10= x = −5
Check:|2(4) + 1| = |9| and |2(−5) + 1| = |−9|= Both equal 9

Tips & Best Practices

  • •Absolute value is written with two vertical bars: |x|. In spreadsheets and most programming languages the function is ABS(x) or abs(x).
  • •|−5| = 5 and |5| = 5; the only number whose absolute value is 0 is 0 itself.
  • •Do not confuse |x| with a negative sign removal only: |x − y| is not x + y. Evaluate the expression inside the bars first, then take the absolute value.

Frequently Asked Questions

Can the absolute value of a number be negative?

No. By definition |x| ≥ 0 for every real number x. Be careful with −|x|, though: that is the negative of an absolute value and is zero or negative, for example −|−4| = −4.

What is the absolute value of zero?

|0| = 0. Zero is the only number equal to its own negative, so it is the only input that returns 0.

Why does |x| = √(x²)?

Squaring any real number gives a non-negative result and erases the sign. The principal square root then returns the non-negative number whose square is x², which is exactly |x|. For example √((−6)²) = √36 = 6 = |−6|.

Does absolute value work for complex numbers?

The same idea extends to complex numbers as the modulus: |a + bi| = √(a² + b²), the distance from the origin in the complex plane. This calculator handles real numbers only.