Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Absolute Value






Distance Without Direction

The absolute value of a number is its distance from zero. It keeps the size of the number and discards the sign: ∣−5∣=5|-5| = 5 and ∣5∣=5|5| = 5. This page covers what the bars mean, the rules they obey, how to remove them, and where they appear in graphs and calculus. For solving, see absolute value equations and absolute value inequalities.

Key Terms

Absolute Value— the distance of a number from zero on the number line
Absolute Value Function— the function f(x)=∣x∣f(x) = |x| and its V-shaped graph
Principal Root— the non-negative root, which is why x2=∣x∣\sqrt{x^2} = |x|
Absolute Value Inequality— an inequality whose solutions are read as distances

See All Algebra Definitions →


What Absolute Value Measures

The absolute value of a real number xx, written ∣x∣|x|, is the distance from xx to 00 on the number line.

Distance has no direction, so a number and its opposite have the same absolute value. Both −3-3 and 33 lie three units from zero, so ∣−3∣=3|-3| = 3 and ∣3∣=3|3| = 3. The bars keep the size of a number and discard its sign.

Example
∣−12∣=12|-12| = 12,   ∣7.5∣=7.5\; |7.5| = 7.5,   ∣0∣=0\; |0| = 0,   ∣−23∣=23\; \left|-\frac{2}{3}\right| = \frac{2}{3}.

The bars are also grouping symbols, like parentheses: the expression inside is simplified first, and only then is the absolute value taken.

Pitfall: Splitting the bars over a difference
Writing ∣3−8∣=∣3∣−∣8∣=−5|3 - 8| = |3| - |8| = -5 produces a negative absolute value, which is impossible. Simplify inside first: ∣3−8∣=∣−5∣=5|3 - 8| = |-5| = 5.

Example
∣3−8∣=∣−5∣=5|3 - 8| = |-5| = 5.   \; ∣2⋅(−4)+1∣=∣−7∣=7|2 \cdot (-4) + 1| = |-7| = 7.   \; ∣4∣−∣−9∣=4−9=−5|4| - |-9| = 4 - 9 = -5, because here the bars close before the subtraction.

A minus sign outside the bars is not touched by them: −∣−4∣=−(4)=−4-|-4| = -(4) = -4. The absolute value itself is never negative, but its opposite can be.
Number line: −3 and 3 are both three units from zero −5−4−3−2−112345|−3| = 3|3| = 3Same distance, opposite sides
Absolute value as distance from zero

The amber segment runs from −3 to 0, the blue one from 0 to 3. Both are three units long, so |−3| = |3| = 3. The sign says which side of zero a number is on; the absolute value says only how far.


The Piecewise Definition

Distance is the idea; the working definition is a rule with two cases.

The Piecewise Definition
∣x∣={xif x≥0−xif x<0|x| = \begin{cases} x & \text{if } x \geq 0 \\ -x & \text{if } x < 0 \end{cases}

For x≥0x \geq 0, the number already equals its distance from zero and is left unchanged. For x<0x < 0, the rule returns −x-x, the opposite of xx.

Pitfall: Reading −x as a negative number
Seeing ∣x∣=−x|x| = -x and concluding that ∣x∣|x| is negative. In this case xx itself is negative, so −x-x is positive: ∣−6∣=−(−6)=6|-6| = -(-6) = 6.

The second case looks as if it produced a negative number, but it does the reverse. When xx is negative, −x-x is positive: for x=−6x = -6, −x=−(−6)=6-x = -(-6) = 6. The minus sign in −x-x means "the opposite of xx", not "a negative number".

Example
For x=4x = 4: the first case applies, ∣4∣=4|4| = 4. For x=−2.5x = -2.5: the second case applies, ∣−2.5∣=−(−2.5)=2.5|-2.5| = -(-2.5) = 2.5.

The two cases agree at x=0x = 0, where both give 00, so the boundary point could go in either one. Putting it in the first case, x≥0x \geq 0, is the usual convention.

Absolute Value as Distance Between Numbers

    Subtracting two numbers gives a signed gap: positive or negative depending on the order. The bars remove the sign, so the order no longer matters.

    Absolute Value as Distance Between Numbers
    distance between a and b=∣a−b∣=∣b−a∣\text{distance between } a \text{ and } b = |a - b| = |b - a|

    Example
    The distance between −2-2 and 55 is ∣5−(−2)∣=∣7∣=7|5 - (-2)| = |7| = 7, and in the other order ∣−2−5∣=∣−7∣=7|-2 - 5| = |-7| = 7.

    The definition of ∣x∣|x| is the special case b=0b = 0: ∣x∣=∣x−0∣|x| = |x - 0|, the distance from xx to 00.

    This reading turns statements about absolute value into statements about position:

  • ∣x−3∣=2|x - 3| = 2 asks for the numbers at distance 22 from 33: they are 11 and 55.
  • ∣x−3∣<2|x - 3| < 2 asks for the numbers closer than 22 to 33: the open interval (1,5)(1, 5).
  • ∣x+4∣|x + 4| is the distance from xx to −4-4, because x+4=x−(−4)x + 4 = x - (-4).

  • The same picture is used to solve absolute value equations and absolute value inequalities without algebra.
Number line: the distance from −2 to 5 is 7; the numbers with |x − 3| < 2 fill the open interval from 1 to 5 −3−2−11234567|5 − (−2)| = 7|x − 3| < 2Distances between numbers
Absolute value as distance between numbers

Top: the gap from −2 to 5 is |5 − (−2)| = 7, whichever number is subtracted from which. Bottom: |x − 3| < 2 collects every number less than 2 away from 3, the open interval from 1 to 5. The hollow ends are 1 and 5 themselves, which are exactly 2 away.


Properties of Absolute Value

For all real numbers aa and bb, the bars obey the rules below.

RULE
Absolute value passes through multiplication and division: ∣ab∣=∣a∣ ∣b∣|ab| = |a|\,|b| and ∣ab∣=∣a∣∣b∣\left|\frac{a}{b}\right| = \frac{|a|}{|b|} for b≠0b \neq 0. It does not pass through addition or subtraction.

The product rule holds because the size of a product is the product of the sizes, and the sign is decided separately. For sums there is no such rule: ∣3+(−5)∣=2|3 + (-5)| = 2, while ∣3∣+∣−5∣=8|3| + |-5| = 8. The best that can be said about a sum is the triangle inequality.
PropertyRuleExample
Never negative|a| ≥ 0|−5| = 5
Zero only at zero|a| = 0 exactly when a = 0|0| = 0
Opposites|−a| = |a||−7| = |7| = 7
Product|ab| = |a| · |b||(−3)(4)| = 12 = 3 · 4
Quotient|a / b| = |a| / |b|,  b ≠ 0|−8 / 2| = 4 = 8 / 2
Powers|aⁿ| = |a|ⁿ|(−2)³| = 8 = 2³
Square|a|² = a²|−5|² = 25 = (−5)²
Square root√(a²) = |a|√((−5)²) = 5
Bounds−|a| ≤ a ≤ |a|−5 ≤ −5 ≤ 5
Triangle inequality|a + b| ≤ |a| + |b||3 + (−5)| = 2 ≤ 8
Reverse triangle inequality| |a| − |b| | ≤ |a − b|| 3 − 5 | = 2 ≤ |3 − (−5)| = 8
Absolute value splits over products and quotients, never over sums and differences.

Square Roots and Squares

The square root symbol always means the principal root, the non-negative one. So x2\sqrt{x^2} is the non-negative number whose square is x2x^2, and that number is ∣x∣|x|, not xx.

Square Roots and Squares
x2=∣x∣\sqrt{x^2} = |x|

Pitfall: Writing √(x²) = x
For x=−4x = -4 this gives (−4)2=−4\sqrt{(-4)^2} = -4, a negative square root. In fact 16=4=∣−4∣\sqrt{16} = 4 = |-4|.

Example
For x=−4x = -4: (−4)2=16=4=∣−4∣\sqrt{(-4)^2} = \sqrt{16} = 4 = |-4|. For x=4x = 4: 16=4=∣4∣\sqrt{16} = 4 = |4|. The answer is ∣x∣|x| in both cases.

The same holds for every even root, x44=∣x∣\sqrt[4]{x^4} = |x|, but not for odd roots: (−2)33=−2\sqrt[3]{(-2)^3} = -2, so x33=x\sqrt[3]{x^3} = x. The properties of roots page covers the general rule.

Squaring goes the other way and removes bars: ∣x∣2=x2|x|^2 = x^2, because squaring discards the sign just as the bars do. This is why ∣A∣=∣B∣|A| = |B| holds exactly when A2=B2A^2 = B^2, which gives a second way to solve equations with absolute value on both sides.

The Triangle Inequality

The absolute value of a sum is at most the sum of the absolute values.

The Triangle Inequality
∣a+b∣≤∣a∣+∣b∣|a + b| \leq |a| + |b|

When aa and bb have the same sign, nothing cancels and the two sides are equal: ∣2+5∣=7=∣2∣+∣5∣|2 + 5| = 7 = |2| + |5|. When the signs differ, part of one number cancels part of the other, and the left side is smaller: ∣2+(−5)∣=3|2 + (-5)| = 3, while ∣2∣+∣−5∣=7|2| + |-5| = 7.

RULE
∣a+b∣=∣a∣+∣b∣|a + b| = |a| + |b| exactly when ab≥0ab \geq 0, that is, when aa and bb do not have opposite signs.

On the number line: start at 00, take a step of aa, then a step of bb. The walk covers ∣a∣+∣b∣|a| + |b| in total, but if the second step turns back, the end point a+ba + b is closer to the start than that.

Replacing bb by b−ab - a and rearranging gives the reverse form, ∣∣a∣−∣b∣∣≤∣a−b∣\big||a| - |b|\big| \leq |a - b|: two numbers are at least as far apart as their distances from zero differ.

The same inequality holds for complex numbers, where aa, bb and a+ba + b form the sides of an actual triangle. The proof and the reverse form are on the modulus of complex numbers page.

Removing the Bars

To rewrite an expression without bars, split at the point where the inside equals zero. On the side where the inside AA is non-negative, replace ∣A∣|A| by AA; on the side where it is negative, replace ∣A∣|A| by −A-A.

Example
∣x−2∣|x - 2| is zero at x=2x = 2. For x≥2x \geq 2: ∣x−2∣=x−2|x - 2| = x - 2. For x<2x < 2: ∣x−2∣=−(x−2)=2−x|x - 2| = -(x - 2) = 2 - x.

Pitfall: Negating only the first term
For x<5x < 5, writing ∣x−5∣=−x−5|x - 5| = -x - 5. At x=2x = 2 this gives −7-7, but ∣2−5∣=3|2 - 5| = 3. The whole inside changes sign: −(x−5)=5−x-(x - 5) = 5 - x.

With several absolute values, each one has its own split point. Together the split points cut the number line into intervals, and on each interval every inside expression keeps one sign.

Example
Simplify f(x)=∣x−2∣+∣x+1∣f(x) = |x - 2| + |x + 1|. The split points are x=−1x = -1 and x=2x = 2.
For x<−1x < -1, both insides are negative: f(x)=−(x−2)−(x+1)=−2x+1f(x) = -(x - 2) - (x + 1) = -2x + 1.
For −1≤x<2-1 \leq x < 2, only x+1x + 1 is non-negative: f(x)=−(x−2)+(x+1)=3f(x) = -(x - 2) + (x + 1) = 3.
For x≥2x \geq 2, both are non-negative: f(x)=(x−2)+(x+1)=2x−1f(x) = (x - 2) + (x + 1) = 2x - 1.
Check one point in each interval: f(−2)=4+1=5=−2(−2)+1f(-2) = 4 + 1 = 5 = -2(-2) + 1,   f(0)=2+1=3\; f(0) = 2 + 1 = 3,   f(3)=1+4=5=2(3)−1\; f(3) = 1 + 4 = 5 = 2(3) - 1.

The result is a piecewise function. Every expression built from absolute values of linear terms becomes one this way.
Graph of f(x) = |x − 2| + |x + 1|: the line −2x + 1 left of −1, the constant 3 between −1 and 2, the line 2x − 1 right of 2xy−3−2−1123412345678x = −1x = 2−2x + 132x − 1f(x) = |x − 2| + |x + 1|
Removing the bars piece by piece

The dashed lines are the split points, where x + 1 and x − 2 change sign. Each interval gets its own formula. Between −1 and 2 the graph is flat at 3: there the two distances, from x to 2 and from x to −1, always add up to the distance between −1 and 2.


The Graph of the Absolute Value Function

    The graph of y=∣x∣y = |x| follows the two cases of the definition: the line y=xy = x for x≥0x \geq 0 and the line y=−xy = -x for x<0x < 0. The two half-lines meet at the origin and form a V.

  • The vertex (0,0)(0, 0) is the lowest point; the range is [0,∞)[0, \infty).
  • The graph is symmetric about the yy-axis, because ∣−x∣=∣x∣|-x| = |x|: the function is even.
  • The slope is −1-1 on the left and 11 on the right.

  • Shifting and stretching move the V without changing its shape. The graph of y=a∣x−h∣+ky = a|x - h| + k has its vertex at (h,k)(h, k), opens upward when a>0a > 0 and downward when a<0a < 0, and has slopes −a-a and aa on the two sides.

    Example
    y=2∣x−1∣−3y = 2|x - 1| - 3 has its vertex at (1,−3)(1, -3), opens upward, and has slopes −2-2 and 22. It crosses the xx-axis where ∣x−1∣=32|x - 1| = \frac{3}{2}: at x=−12x = -\frac{1}{2} and x=52x = \frac{5}{2}.

    The absolute value function section of the function families page places this graph among the other basic shapes.
Graph of y = |x|: the half-line y = −x for x < 0 and y = x for x ≥ 0, meeting at the vertex (0, 0)xy−4−3−2−11234−2−11234y = −xy = xvertex (0, 0)y = |x|
The V shape

The graph keeps the part of y = x on the right and the part of y = −x on the left; the faded dashed continuations are the halves the bars throw away. The two half-lines meet at the vertex, where the slope jumps from −1 to 1.


Absolute Value in Equations and Inequalities

Equations and inequalities with absolute value all reduce to a few forms. In each, AA stands for the expression inside the bars and kk for a constant.

The two signs of kk behave differently. An absolute value is never negative, so ∣A∣=k|A| = k and ∣A∣<k|A| < k have no solutions when k<0k < 0, and ∣A∣>k|A| > k holds for every xx.

The full methods, with expressions on both sides and quadratic insides, are on the absolute value equations and absolute value inequalities pages. To check an answer, use the absolute value equation calculator.
FormEquivalent statementExampleSolution
|A| = k,  k > 0A = k  or  A = −k|x − 3| = 2x = 1 or x = 5
|A| < k,  k > 0−k < A < k|x − 3| < 21 < x < 5
|A| > k,  k > 0A < −k  or  A > k|x − 3| > 2x < 1 or x > 5
|A| = 0A = 0|x − 3| = 0x = 3
|A| = k  or  |A| < k,  k < 0impossible|x − 3| = −2no solution
|A| > k,  k < 0always true|x − 3| > −2every real x

Absolute Value in Calculus

The function ∣x∣|x| is the standard example of a function that is continuous but not differentiable.

Continuity. The graph has no gaps or jumps: ∣x∣|x| is continuous at every real number.

The corner at 0. To the left of 00 the slope is −1-1; to the right it is 11. The two one-sided derivatives disagree, so ∣x∣|x| has no derivative at 00. The corners section of the differentiability page treats this case.

The derivative elsewhere. For x≠0x \neq 0:

Absolute Value in Calculus
ddx∣x∣=x∣x∣={−1if x<01if x>0\frac{d}{dx}|x| = \frac{x}{|x|} = \begin{cases} -1 & \text{if } x < 0 \\ 1 & \text{if } x > 0 \end{cases}

One-sided limits. The quotient ∣x∣x\frac{|x|}{x} approaches −1-1 from the left and 11 from the right, so its two-sided limit at 00 does not exist. See one-sided limits.

Antiderivatives. ∫∣x∣ dx=x∣x∣2+C\int |x|\,dx = \frac{x|x|}{2} + C. The bars also appear in ∫1x dx=ln⁡∣x∣+C\int \frac{1}{x}\,dx = \ln|x| + C: the logarithm accepts only positive inputs, while 1x\frac{1}{x} is defined for negative xx as well, and the bars cover both sides. This formula is listed with the basic antiderivatives.

Area. An integral counts area below the axis as negative; the integral of ∣f(x)∣|f(x)| counts all of it as positive. For example, ∫−12∣x∣ dx=12+2=52\int_{-1}^{2} |x|\,dx = \frac{1}{2} + 2 = \frac{5}{2}, while ∫−12x dx=32\int_{-1}^{2} x\,dx = \frac{3}{2}.

Absolute Value Beyond the Real Numbers

The idea of size without direction carries over to other kinds of numbers.

For a complex number z=a+biz = a + bi, the absolute value, also called the modulus, is ∣z∣=a2+b2|z| = \sqrt{a^2 + b^2}: the distance from zz to the origin in the complex plane. When b=0b = 0 it reduces to the ordinary absolute value, a2=∣a∣\sqrt{a^2} = |a|. See modulus of complex numbers.

For a vector, the same role is played by its length, written ∥v∥\|v\|.

In every setting, four rules hold: the size is never negative, it is zero only for zero, it multiplies over products, and it obeys the triangle inequality. These four rules are what make a quantity a measure of size.

Common Pitfalls

Splitting the bars over a sum or difference

The bars are distributed over the terms inside, as if they were a factor.

Wrong working: ∣3−8∣=∣3∣−∣8∣=3−8=−5|3 - 8| = |3| - |8| = 3 - 8 = -5, and ∣x+2∣=∣x∣+2|x + 2| = |x| + 2.

Right working: simplify inside first, ∣3−8∣=∣−5∣=5|3 - 8| = |-5| = 5. The expression ∣x+2∣|x + 2| cannot be split; it is x+2x + 2 for x≥−2x \geq -2 and −x−2-x - 2 for x<−2x < -2.

Why it happens: the product rule ∣ab∣=∣a∣ ∣b∣|ab| = |a|\,|b| is true, and it is carried over to sums, where it fails.

How to check: an absolute value can never be negative, so −5-5 is wrong on sight. For the expression, test a negative value: at x=−5x = -5, ∣−5+2∣=3|-5 + 2| = 3, but ∣−5∣+2=7|-5| + 2 = 7.

Reading −x as a negative number

The case ∣x∣=−x|x| = -x is read as "the absolute value is negative".

Wrong working: "For x<0x < 0, ∣x∣=−x|x| = -x, so on this side the absolute value is negative."

Right working: on this side xx is negative, so −x-x is positive. For x=−6x = -6, ∣x∣=−(−6)=6|x| = -(-6) = 6.

Why it happens: a minus sign in front of a letter is read as a negative number, when it means the opposite of whatever the letter stands for.

How to check: substitute a number from the case. Any negative xx gives a positive −x-x.

Writing √(x²) = x

The square root and the square are treated as canceling.

Wrong working: x2=x\sqrt{x^2} = x, so (−4)2=−4\sqrt{(-4)^2} = -4.

Right working: (−4)2=16=4\sqrt{(-4)^2} = \sqrt{16} = 4. In general x2=∣x∣\sqrt{x^2} = |x|.

Why it happens: for non-negative xx the square root and the square do undo each other, and the rule is remembered without its condition.

How to check: a square root symbol never gives a negative result. If the answer can be negative, bars are missing.

Negating only the first term

When the inside is negative, the minus sign is applied to the first term only.

Wrong working: for x<5x < 5, ∣x−5∣=−x−5|x - 5| = -x - 5.

Right working: the whole inside changes sign, ∣x−5∣=−(x−5)=5−x|x - 5| = -(x - 5) = 5 - x.

Why it happens: the parentheses around x−5x - 5 are left out when −A-A is written down.

How to check: test a value from the interval. At x=2x = 2, ∣2−5∣=3|2 - 5| = 3 and 5−2=35 - 2 = 3, while −2−5=−7-2 - 5 = -7.

Summary: Absolute Value at a Glance

The definition, the rules, the graph and the calculus facts on this page reduce to the table below.
IdeaStatementExample
Meaning|x| is the distance from x to 0|−3| = |3| = 3
Definition|x| = x for x ≥ 0,  |x| = −x for x < 0|−6| = −(−6) = 6
Distance between numbers|a − b|distance from −2 to 5 is 7
What splits over the barsproducts and quotients; never sums or differences|−2 · 3| = 6,  |3 − 8| ≠ 3 − 8
Square roots√(x²) = |x|√((−4)²) = 4
Triangle inequality|a + b| ≤ |a| + |b|, equal exactly when ab ≥ 0|2 + (−5)| = 3 < 7
Removing the barssplit where the inside is 0; use A or −A on each side|x − 2| = 2 − x for x < 2
Graphy = a|x − h| + k is a V with vertex (h, k)y = 2|x − 1| − 3: vertex (1, −3)
Calculuscontinuous everywhere, corner at 0; ∫ 1/x dx = ln|x| + Cslopes −1 and 1 meet at 0

Absolute Value FAQ

Can an absolute value be negative?

+
No. A distance is never negative, so |x| ≥ 0 for every real x, and |x| = 0 only when x = 0. An expression such as −|4| = −4 is negative, but that is the opposite of an absolute value, not an absolute value.Read more →

Is the square root of x squared equal to x?

+
Only when x ≥ 0. In general √(x²) = |x|, because the square root symbol always gives the non-negative root. For x = −4, √((−4)²) = √16 = 4, not −4.Read more →

Is |a + b| equal to |a| + |b|?

+
Not in general. The triangle inequality says |a + b| ≤ |a| + |b|, with equality exactly when a and b do not have opposite signs. For example, |2 + (−5)| = 3, while |2| + |−5| = 7. Absolute value does split over products: |ab| = |a| · |b|.Read more →

Why is |x| not differentiable at 0?

+
The graph of |x| has a corner at 0: the slope is −1 just to the left and 1 just to the right. The two one-sided derivatives disagree, so no single derivative exists there, even though |x| is continuous at 0.Read more →

Why is ∣x+4∣|x + 4| the distance to −4-4 and not to 44?

+
Because the distance reading needs a difference. The distance between xx and bb is ∣x−b∣|x - b|, so x+4x + 4 has to be rewritten first as x−(−4)x - (-4), and the point it measures from is −4-4. That makes ∣x+4∣=1|x + 4| = 1 a question about the numbers one unit from −4-4: they are −5-5 and −3-3, and both check, since ∣−1∣=∣1∣=1|-1| = |1| = 1.Read more →

Is −∣x∣-|x| the same as ∣−x∣|-x|?

+
No. In ∣−x∣|-x| the minus sign is inside the bars, and a number and its opposite lie the same distance from zero, so ∣−x∣=∣x∣|-x| = |x| and ∣−4∣=4|-4| = 4. In −∣x∣-|x| the minus sign is outside, so it acts after the bars: −∣−4∣=−(4)=−4-|-4| = -(4) = -4. The first is never negative; the second is never positive.Read more →

What is the antiderivative of ∣x∣|x|?

+
∫∣x∣ dx=x∣x∣2+C\int |x|\,dx = \frac{x|x|}{2} + C, one formula for both sides of 00. Differentiating checks it: for x>0x > 0 the function is x22\frac{x^2}{2}, with derivative xx, and for x<0x < 0 it is −x22-\frac{x^2}{2}, with derivative −x-x, and both equal ∣x∣|x|. Unlike ∣x∣|x| itself, x∣x∣2\frac{x|x|}{2} has no corner at 00; its slope there is 00.Read more →