Ultra Calculator
    Maths

    Absolute Value Calculator

    The absolute value of a number is its distance from 0, so it is never negative: |-7| = 7 and |7| = 7. The distance between two numbers is the absolute value of their difference, so -3 and 5 are |5 - (-3)| = 8 apart. The calculator also solves |x| = a and |ax + b| = c.

    Last updated by Ultra Calculator

    Absolute Value

    How to calculate it

    |x| = x when x ≥ 0, and |x| = -x when x < 0
    x
    any real number
    |x|
    the absolute value of x, its distance from 0 on the number line

    The distance between x and y is |y - x|. The equation |x| = a has two solutions, x = a and x = -a, when a > 0; one solution, x = 0, when a = 0; and none when a < 0.

    Worked example

    Absolute value of -7

    |-7| = 7, because -7 is 7 units from 0 on the number line.

    You enter
    Calculation typeAbsolute value |x|
    Number (x)-7
    The calculator returns
    Result7
    Working|-7| = 7
    On the number line-7 is 7 units from 0, on the negative side
    DetailsSign: negative Distance from 0: 7 |7| = 7 too

    How to use this calculator

    1. Choose a Calculation type.
    2. For Absolute value |x|, enter Number (x). For Distance between two numbers, also enter Second number (y).
    3. For Solve |x| = a, put a in Equation value.
    4. For Expression |ax + b|, enter Coefficient (a), Constant (b) and the x to test in Number (x). Add an Equation value to solve |ax + b| = that value as well.
    5. Read Result, then Working and On the number line for the explanation.

    Frequently asked questions

    What is absolute value?

    It is how far a number is from 0, ignoring direction. Absolute value is always 0 or positive: |-12| = 12, |12| = 12 and |0| = 0.

    How do you find the distance between two numbers?

    Subtract one from the other and take the absolute value. The distance between -3 and 5 is |5 - (-3)| = 8, whichever way round you subtract.

    How do you solve an absolute value equation?

    For a positive right-hand side, split it into two equations, one for each sign. For |2x + 3| = 7, solve 2x + 3 = 7 and 2x + 3 = -7 to get x = 2 and x = -5. Substitute both back to check them.

    Can an absolute value be negative?

    No. An equation such as |x| = -3 has no solution because no number is a negative distance from 0.

    How do you solve absolute value inequalities?

    |x| < 3 means x is within 3 of zero, so -3 < x < 3. |x| > 3 means x is further than 3 from zero, so x < -3 or x > 3. This calculator does not solve inequalities, but Solve |x| = a finds their boundary points.

    Does this find the modulus of a complex number?

    No. The modulus of a + bi is √(a² + b²), so |3 + 4i| = 5. Expression |ax + b| evaluates the absolute value of a linear expression with real numbers.

    Learn more

    Absolute value as distance

    On a number line, |x| is the distance from x to 0, and |x - y| is the distance from x to y. Reversing the subtraction changes the sign inside the bars but leaves the distance unchanged.

    Why |x| = a has two answers

    There are two points at any positive distance from 0, one on each side. So |x| = 4 means x = 4 or x = -4. At distance 0 there is only one point, and a negative distance has no solution.

    Rules worth knowing

    |xy| = |x| × |y|, and |-x| = |x|. For sums, |x + y| is at most |x| + |y|, a rule called the triangle inequality. For example, |3 + (-5)| = 2, but |3| + |-5| = 8.

    • Finding how far apart two temperatures, scores or positions are
    • Measuring error: a 49.6 mm part against a 50 mm target is out by |49.6 - 50| = 0.4 mm
    • Checking a tolerance: a reading within 0.5 of the target satisfies |x - target| ≤ 0.5
    • Solving absolute value equations in algebra homework
    • Comparing the sizes of gains and losses, ignoring direction

    Removing minus signs before working out the inside

    |-3 + 5| is |2| = 2, not 3 + 5 = 8. Evaluate what is inside the bars first, then take the absolute value.

    Keeping only the positive solution

    |x| = 4 is true for x = -4 as well as x = 4. Write both.

    Solving |x| = a negative number

    |x| = -2 has no solution. Check the right-hand side before doing any algebra.

    Splitting the bars across a sum

    |x + y| is not usually |x| + |y|. They are equal when x and y have the same sign or at least one is 0.

    • To solve |ax + b| = c by hand when a ≠ 0 and c > 0, the answers are (c - b) ÷ a and (-c - b) ÷ a.
    • When a ≠ 0, the graph of y = |ax + b| is a V shape with its point at x = -b ÷ a, where the value is 0.
    • For a tolerance check, compare |measured - target| with the allowed error.

    Methodology and sources

    Each mode applies the definition directly and shows only the boxes it uses. Absolute value |x| returns the distance from 0, Distance between two numbers is |y - x|, and Expression |ax + b| evaluates ax + b at your x before taking its absolute value. Solve |x| = a gives ±a, 0 or no solution according to the sign of a. In Expression mode, an Equation value c also solves |ax + b| = c: two answers, x = (c - b) ÷ a and x = (-c - b) ÷ a, when c is above 0, one answer, x = -b ÷ a, when c is 0, and none when c is negative. When a is 0 the expression is the constant |b|, so every x is a solution if c = |b| and none is otherwise. A blank Constant (b) counts as 0. Results and solutions are rounded to 6 decimal places. Only real numbers are handled; complex moduli and inequalities are not supported.