Absolute Value Calculator

How far is any number from zero on the number line?

Enter any real number — positive, negative, or zero — and get its absolute value immediately. The result shows the distance from zero on the number line, along with which branch of the piecewise definition was applied.

Updated July 2026 · How this works

Example calculation — edit any field to use your own numbers

Worth knowing
How It Works
The formula, explained simply

Picture a number line stretched out in both directions from a central zero. The absolute value of any number is simply how far that point sits from zero — measured in steps, with no regard for which direction you walked to get there. Walk fifteen steps left and you are fifteen units from zero. Walk fifteen steps right and you are also fifteen units from zero. The direction vanishes; only the distance survives.

That intuition is captured exactly by the piecewise definition. For non-negative inputs, nothing changes: the number is already at a non-negative distance from zero. For negative inputs, the sign is flipped by negating the value, converting the directed position into a pure distance. Two simple rules, covering every real number without exception.

The notation |x| is a compact way of writing this operation. You will see it in geometry when computing lengths, in algebra when solving equations with two symmetric solutions, in calculus when defining norms and metrics, and in physics when reporting magnitudes. Every use case reduces to the same question: how far is this quantity from zero?

When To Use This
Right tool, right situation

Use an absolute value calculation whenever you care about magnitude rather than direction. Typical situations include computing distances between two points on a number line (subtract one from the other, then take the absolute value), measuring the size of an error or deviation regardless of sign, and simplifying expressions that appear under a square root where the radicand must be non-negative.

Absolute value is also the right tool when solving equations or inequalities of the form |x - a| = b or |x| ≤ c, because the solution always splits into two cases that correspond to the two branches of the definition. In these settings the tool gives you the numeric magnitude you need for each case.

This calculator is not appropriate for complex numbers, vectors, or matrices. For a complex number the correct quantity is the modulus; for a vector it is the Euclidean norm; for a matrix it is a matrix norm. All of these reduce to absolute value only in the special case of a single real number. If your quantity has more than one component, use the appropriate multi-dimensional tool instead.

Common Mistakes
Why results sometimes look wrong

Mistake 1 — Thinking absolute value always removes the minus sign by discarding it. The mechanism is negation, not deletion. For a negative input x, |x| = -x means you are computing the negative of a negative, which gives a positive. Simply dropping the sign character without understanding the arithmetic can cause errors when x appears in a larger expression: substituting |x| = -x into a formula still requires carrying out that negation correctly.

Mistake 2 — Solving |x| = c with only one solution. Because both x = c and x = -c satisfy the equation when c is positive, ignoring the negative solution is a common error in algebra. The absolute value definition guarantees that two inputs map to the same output whenever the inputs are negatives of each other. Always check both branches when the equation is set equal to a specific value.

Mistake 3 — Applying absolute value to complex numbers as if they were real. This calculator covers real numbers only. For a complex number a + bi, the modulus (also called absolute value) is computed as the square root of a squared plus b squared — a different formula that produces a real result from a two-dimensional input. Using the real-number definition on a complex number gives the wrong answer or breaks down entirely.

The Math
Worked examples and deeper derivation

The absolute value function is defined piecewise. For any real number x: if x is greater than or equal to zero, |x| = x; if x is negative, |x| = -x. Both branches produce a non-negative result, and together they cover all real numbers.

For the example input of -15, x is negative so the second branch applies: |-15| = -(-15) = 15. The double negative resolves to a positive. For a positive input the first branch applies and the value passes through unchanged.

Four algebraic properties follow directly from the definition. First, |x| is always greater than or equal to zero. Second, |x| = |-x|, confirming the mirror symmetry. Third, the product rule: |xy| = |x||y|. Fourth, the quotient rule: |x/y| = |x|/|y| whenever y is nonzero. The triangle inequality — |x + y| ≤ |x| + |y| — is a fifth property with deep consequences in analysis and geometry.

Finding the magnitude of a negative temperature reading
Number: -15
The input -15 is negative, so the second branch of the definition applies: |-15| = -(-15) = 15. In a context such as temperature deviation, this tells you the reading sits 15 units away from the reference point of zero, regardless of direction.
Confirming a positive number is already its own absolute value
Number: 7.5
The input 7.5 is non-negative, so the first branch applies: |7.5| = 7.5 = 7.5. The value passes through unchanged. This confirms that absolute value is not just about removing a minus sign — it is about measuring distance, and positive numbers are already at a non-negative distance of 7.5 from zero.
Engineer checking error magnitude in a control system
Number: -0.007
Control systems often care about the magnitude of an error signal, not its direction. For an error reading of -0.007, the absolute value is 0.007. The negative branch applies because -0.007 is less than zero, so the result is -(-0.007) = 0.007. The system is 0.007 units off target in magnitude terms.
Expert Unlock
The thing most explanations skip

The piecewise definition treats the real line as two half-lines joined at zero, which means the function has a corner — a point of non-differentiability — at the origin. This matters in optimisation: a function involving |x| is convex everywhere but not smooth at zero, which is why subgradient methods rather than standard gradients are needed there. In machine learning, the L1 loss (mean absolute error) inherits exactly this geometry, producing sparse solutions where gradient descent on a smooth loss would not.

What does the absolute value of a number actually mean?

What is the absolute value of a negative number?
The absolute value of a negative number is its positive counterpart — equivalently, its distance from zero on the number line. For any negative input x, the definition gives |x| = -x, which resolves to a positive result because negating a negative yields a positive. This is the branch that applies to any value below zero.
Can the absolute value of a number ever be negative?
No. By definition, |x| is always greater than or equal to zero for every real number x. Both branches of the piecewise formula — x when x is non-negative, and -x when x is negative — produce a non-negative result. Zero is the only number whose absolute value equals zero.
Why does absolute value matter in equations and inequalities?
Absolute value equations typically yield two solutions because both a positive and a negative input can produce the same absolute value. For example, |x| = 15 is satisfied by both x = 15 and x = -15. Inequalities involving absolute value describe intervals — |x| less than some threshold means x lies within that distance of zero, which translates to a compound inequality. Recognising which branch applies is the key step in solving these correctly.

Need something this doesn't cover?

Suggest a tool — we'll build it →