Find |x| for any number instantly — the non-negative distance from zero, shown with clear step-by-step working.
How far is a number from zero? The answer is its absolute value — the number’s size with the sign stripped away. A debt of $250 and a credit of $250 are opposites in bookkeeping, but both represent the same magnitude: 250 dollars. Whether you are measuring how far a temperature dropped below freezing, how much a stock moved regardless of direction, or how big an error is without caring whether it was too high or too low, the absolute value gives you the clean, always-positive measure of size. This free Absolute Value Calculator computes |x| for any number — whole numbers, decimals, and negatives — and shows every step of the working so you can follow along, verify the result, and understand exactly what the number means.
The idea is one of the simplest in all of mathematics, yet it quietly powers an enormous amount of real-world math. On the number line, the absolute value of x is simply the distance from x to zero. Distance is never negative, so the absolute value is never negative either: |5| = 5, |−5| = 5, and |0| = 0. Notice that 5 and −5 sit at the same distance from zero, just on opposite sides — that is why they share the same absolute value. This single concept is the foundation of the absolute difference between two numbers, the distance formula in geometry, error measurement in science and machine learning, and the idea of magnitude in physics. Once you truly understand absolute value, dozens of other formulas start making sense.
Using the calculator takes only a few seconds:
To start over, press Reset to restore the default example value. You can type directly into the box and press Calculate as many times as you like — there are no limits and nothing is sent to any server; every calculation happens instantly in your browser.
The absolute value of a real number x, written |x| (x between two vertical bars), is defined as x itself when x is zero or positive, and as −x when x is negative. In plain language: drop the minus sign if there is one, and leave everything else alone. The vertical bars are called absolute value bars, and they act as an instruction — “make this quantity non-negative.”
Geometrically, |x| is the distance from the point x to the origin (zero) on the number line. This interpretation is worth pausing on, because it explains every property of absolute value at a glance. Distance cannot be negative, which is why |x| ≥ 0 always. The points 4 and −4 are both 4 units from zero, which is why |4| = |−4| = 4. And zero sits exactly at the origin, which is why |0| = 0 — the smallest possible absolute value. Any number’s absolute value is the answer to the question “how many units away from zero is it?”
Absolute value has several elegant algebraic properties that make it indispensable in higher math. The multiplicative property says |a × b| = |a| × |b| — the absolute value of a product equals the product of the absolute values. The triangle inequality, one of the most famous results in mathematics, says |a + b| ≤ |a| + |b| — the direct route is never longer than the detour. And the reverse triangle inequality says the gap between two absolute values can never exceed the absolute value of the gap: ||a| − |b|| ≤ |a − b|. These are not just textbook curiosities; the triangle inequality is the reason the absolute value defines a genuine notion of distance, and it underpins convergence proofs in calculus, error bounds in numerical computing, and the mathematics of signal processing.
It also helps to see how absolute value connects to ideas you already know. The absolute value is closely related to the square root of a square: √x² = |x|, not x — a fact that trips up many students, because squaring destroys the sign information and the square root can only return the non-negative root. In programming, the absolute value function (usually called abs()) is one of the most-used math utilities, appearing in everything from game physics to financial software. In statistics, the mean absolute deviation measures spread by averaging absolute deviations from the mean — a robust alternative to the standard deviation that is less sensitive to outliers. Wherever “how big, ignoring direction” is the right question, absolute value is the answer.
|x| = x if x ≥ 0
|x| = −x if x < 0
The definition is a piecewise function: it gives one rule for non-negative inputs and another for negative ones. For a positive number or zero, the absolute value changes nothing: |12| = 12, |0| = 0, |3.7| = 3.7. For a negative number, the absolute value negates it — and negating a negative produces a positive: |−12| = −(−12) = 12. A common point of confusion is the “−x” in the second rule: it does not mean “the answer is negative.” When x itself is negative, −x is positive. For example, if x = −9, then −x = −(−9) = 9, so |−9| = 9.
There is also a neat single-line formula using the square root: |x| = √x². Squaring any real number gives a non-negative result, and the principal (non-negative) square root of that square recovers the original magnitude. So |−6| = √(−6)² = √36 = 6. This version is popular in computer graphics and physics engines because it avoids branching. Either formulation gives identical results for every real number.
Example 1 — a negative decimal. Find |−7.25|. The input is negative, so apply the second rule: |−7.25| = −(−7.25) = 7.25. On the number line, −7.25 sits 7.25 units to the left of zero, so its distance from zero is 7.25. Answer: 7.25.
Example 2 — a positive whole number. Find |42|. The input is positive, so the bars change nothing: |42| = 42. Answer: 42.
Example 3 — zero. Find |0|. Zero is neither positive nor negative, and it sits exactly at the origin, zero units from itself. Both rules agree: |0| = 0. Zero is the only number whose absolute value equals itself while also being the smallest possible absolute value. Answer: 0.
Example 4 — nested bars. Find ||−3| − 5|. Work from the inside out. First, |−3| = 3. Substitute: |3 − 5| = |−2| = 2. The inner bars resolve first, exactly like parentheses. Answer: 2.
Example 5 — with a variable expression. Find |2 − 9|. First evaluate inside the bars: 2 − 9 = −7. Then take the absolute value: |−7| = 7. A frequent mistake is to distribute the bars as |2| − |9| = 2 − 9 = −7, which is wrong — the bars must wrap the entire evaluated expression before the sign is removed. Answer: 7.
Temperature swings. A weather station records −8°C overnight and 14°C in the afternoon. How far did the temperature move? The change is 14 − (−8) = 22 degrees, and equivalently the overnight low was |−8| = 8 degrees below freezing while the high was |14| = 14 degrees above it. Meteorologists routinely use absolute values when they report “degrees from freezing” because nobody wants to hear that it is “−8 degrees warm.”
Stock market moves. A share price drops by $4.50 on Monday and rises by $4.50 on Tuesday. The signed changes (−4.50 and +4.50) average to zero, suggesting nothing happened — but the stock was volatile. The absolute moves tell the true story: |−4.50| + |4.50| = $9.00 of total movement. Traders use absolute and squared price changes to measure volatility, which is why risk models depend on absolute values rather than raw signed returns.
Manufacturing tolerance. A machine shop must cut rods to 200 mm with a tolerance of ±0.5 mm. A rod measuring 199.6 mm has an error of 199.6 − 200 = −0.4 mm; a rod at 200.4 mm has an error of +0.4 mm. Quality control does not care about the direction — it checks whether |error| ≤ 0.5 mm. Both rods pass, because |−0.4| = 0.4 and |0.4| = 0.4. This “absolute error” is the standard acceptance criterion across machining, electronics, and pharmaceuticals.
GPS and navigation. Your destination is at mile marker 120 and you are at marker 135. Your navigation app computes |135 − 120| = 15 miles remaining. It does not matter that you overshot (a signed difference of +15) versus approaching from below (a signed difference of −15) — the distance to drive is 15 miles either way. Every distance readout on a map is an absolute value in disguise.
1. Thinking |−x| is always positive-x. The bars remove the sign of whatever is inside after it is evaluated. If x = −4, then |x| = |−4| = 4, which equals −x. But if x = 4, then |x| = 4 = x. The safe habit: substitute first, then strip the sign.
2. Distributing bars over addition. |a + b| is not equal to |a| + |b| in general. For a = 5 and b = −5: |5 + (−5)| = |0| = 0, but |5| + |−5| = 10. The triangle inequality says |a + b| ≤ |a| + |b|, with equality only when a and b share the same sign (or one is zero). Never split the bars across a sum.
3. Forgetting that √x² = |x|, not x. When solving √(x²) = 9, the solutions are x = 9 and x = −9, because √x² simplifies to |x|, and |x| = 9 has two solutions. Writing √x² = x silently discards the negative solution and is one of the most common algebra errors.
4. Assuming the answer keeps the original sign. Absolute value output is never negative. If your calculation produces something like |−13| = −13, stop — a negative result from absolute value bars is always a mistake. The bars are a guarantee of non-negativity.
5. Confusing |x| with −x. Negation flips the sign; absolute value removes it. For x = −7: −x = 7 and |x| = 7 — same here, but for x = 7: −x = −7 while |x| = 7. They agree only for non-positive inputs. Keep the two operations distinct in your mind.
Continue exploring measurement and comparison tools: the Absolute Difference Calculator finds the positive distance |a − b| between any two numbers; the Percentage Calculator converts absolute changes into relative ones; the Ratio Calculator compares two quantities proportionally; the Standard Deviation Calculator measures spread using squared deviations; and the Quadratic Formula Calculator solves equations where absolute-value-style sign analysis often appears in the discriminant.
Absolute value |x| is the non-negative magnitude of a real number x: |x| = x for x ≥ 0 and |x| = −x for x < 0, equivalently the distance from x to 0 on the real number line, and equivalently √x². Key properties: |x| ≥ 0; |xy| = |x||y|; triangle inequality |x + y| ≤ |x| + |y|. Used for error measurement, tolerance checking, volatility, and distance computation.
Absolute value is a number’s distance from zero, always expressed as a non-negative number. The absolute value of 6 is 6, and the absolute value of −6 is also 6, because both sit 6 units away from zero on the number line. Think of it as “the size of the number with the sign removed.”
Drop the minus sign. The absolute value of any negative number is its positive counterpart: |−9| = 9, |−0.5| = 0.5, |−1,000| = 1,000. Mathematically this follows the rule |x| = −x when x is negative — negating a negative yields a positive.
Zero. |0| = 0. Zero sits exactly at the origin of the number line, so its distance from zero is zero. It is the only number whose absolute value is 0, and 0 is the smallest possible absolute value — an absolute value can never be negative.
Absolute value is written with vertical bars around the number, like |−7|. On a standard keyboard the vertical bar | is usually on the same key as the backslash \, above the Enter key (hold Shift to type it). In most programming languages you use the abs() function instead, for example abs(-7) in Python or Math.abs(-7) in JavaScript.
No — never. By definition |x| ≥ 0 for every real number x. The bars are a guarantee of non-negativity: whatever is inside, positive, negative, or zero, the result that comes out is zero or positive. If a calculation ever hands you a negative “absolute value,” an algebra mistake happened somewhere upstream.
Absolute value |x| measures one number’s distance from zero, while absolute difference |a − b| measures the distance between two numbers. Absolute difference generalizes absolute value: |a − 0| is exactly |a|. Use absolute value for a single magnitude (like an error size) and absolute difference when comparing two values (like two measurements).
Anywhere direction does not matter but size does: manufacturing tolerances check that |error| stays within limits, traders measure stock volatility with absolute price moves, navigation apps show |distance remaining|, and weather reports give degrees from freezing as an absolute value. In data science, mean absolute error is a standard way to score predictions.
The same rule applies: remove the sign and keep the magnitude. |−3/4| = 3/4, |−2.718| = 2.718, and |5/8| = 5/8. Fractions and decimals behave exactly like whole numbers — only the sign matters, never the form of the number.
Cite this page as: SigmaCalculator. (2026). Absolute Value Calculator. https://sigmacalculator.net/math-calculators/absolute-value-calculator/
Last updated: October 9, 2026