The absolute value of a number is its distance from zero — and distance is never negative. This Absolute Value Calculator evaluates |x| for any number you enter, measures the distance |a − b| between two numbers, and solves simple equations of the form |x| = a, showing the number-line reasoning behind every answer.
Worked Example: |−7| and a Distance
With x = −7 the calculator reports |−7| = 7: the point −7 sits seven units from zero, and the bars simply report that distance, discarding the direction. Add a second number, say b = 3, and it reports the distance |−7 − 3| = |−10| = 10 — the gap between −7 and 3 on the number line, which you can verify by counting the units between them. Distance is the interpretation that makes absolute value useful everywhere else: |a − b| is always “how far apart,” never “in which direction.”
The Definition, Two Ways
Formally, |x| = x when x is zero or positive, and |x| = −x when x is negative — the second branch flips the sign, which is why |−7| = −(−7) = 7. Geometrically, |x| is the distance from x to 0. The two definitions always agree, and the geometric one explains the properties students actually use: |x| is never negative, |−x| = |x| (opposite points are equally far from zero), |ab| = |a||b|, and the triangle inequality |a + b| ≤ |a| + |b| — a direct route is never longer than a detour. When an equation says |x| = 7, it asks “which points are 7 units from zero?” and the answer is a pair: x = 7 or x = −7. When it says |x| = −2, the answer is “no such point exists,” because distance cannot be negative — the calculator reports exactly that for negative targets.
Where Absolute Value Earns Its Keep
Error and tolerance. A machined part specified at 50 mm ± 0.2 is acceptable exactly when |measured − 50| ≤ 0.2 — absolute value turns a two-sided spec into one inequality. Temperature and finance. A swing from −4° to 3° is |3 − (−4)| = 7 degrees of change; a stock that moved |−2.3%| moved 2.3%, and ranking movers by |change| treats gains and losses symmetrically. Data science. Mean absolute error averages |predicted − actual| precisely because signed errors would cancel and flatter the model. In each case the pattern is identical: subtract to get a signed difference, take the bars to keep only the size.
Common Mistakes
Treating |x| as “remove the minus sign” works for numbers but breaks for expressions: |x − 5| is not x + 5 or x − 5 until you know the sign of what is inside. Distributing wrongly is the second classic: |a + b| is not |a| + |b| in general (try a = 3, b = −5: |−2| = 2, but |3| + |−5| = 8). Third, forgetting the second solution: |x| = 7 has two answers, and dropping the negative one loses half the solution set. Finally, |x|² = x² always — squaring removes the sign anyway — which is why the bars can be dropped after squaring in equations.
Absolute Value on the Graph and in Inequalities
Graph y = |x| and you get the famous V: the line y = x for positive inputs, mirrored to y = −x for negative ones, with the corner at the origin where the sign flips. Every absolute-value graph is that V shifted, stretched or flipped — |x − 3| moves the corner to x = 3, and |x| + 2 lifts it to height 2. The V explains the inequality patterns students memorize: |x| < 7 describes points within 7 of zero, the single interval −7 < x < 7, while |x| > 7 describes points farther than 7 away, the two rays x < −7 or x > 7. With a shift inside, the same reading works around the new center: |x − 3| ≤ 2 says “within 2 of 3,” which is the interval 1 ≤ x ≤ 5 — solve it by unpacking to −2 ≤ x − 3 ≤ 2 and adding 3 throughout. Distance language converts every one of these problems into a number-line picture before any algebra begins, and the picture is what the calculator’s distance mode is quietly drawing: |x − b| is a V centered at b, and the inequality asks where that V stays below a given height.
A Note on Notation and History
The vertical bars were introduced by Karl Weierstrass in 1841 and took decades to become universal; before them, authors wrote out “modulus” in words — which is why the operation is still called the modulus of a real number in many textbooks, and why complex analysis uses |z| for the distance of a complex number from the origin, the direct generalization of the same idea: |3 + 4i| = 5 by Pythagoras, the two-dimensional distance formula the one-dimensional bars grow into. The calculator on this page sticks to the real line, where everything reduces to distance from zero — but it is worth knowing the bars you are using are the ground floor of a much larger building.
Related Tools
Continue with the Factor Calculator, the Reciprocal Calculator, the Cross Multiplication Calculator, or browse the full Math Calculators hub.
Frequently Asked Questions
What is the absolute value of −7?
Seven. Absolute value reports distance from zero, and −7 is seven units away, so |−7| = 7.
Can absolute value ever be negative?
No. Distances are zero or positive, so |x| ≥ 0 for every real x, and |x| = 0 only when x = 0.
How do I solve |x| = 7?
Any point 7 units from zero qualifies, so x = 7 or x = −7. Equations |x| = a with a negative have no solution.
What does |a − b| mean?
The distance between a and b on the number line. |3 − (−4)| = |7| = 7, matching the gap you would count between the points.
Is |−x| the same as |x|?
Yes. Opposite numbers sit equally far from zero, so their absolute values are identical.
Why does |x| = −2 have no solution?
Because the left side can never be negative. No real number is a negative distance from zero.