Absolute Value Calculator

Calculate the absolute value of a number or expression, the distance between two numbers, and solve absolute-value equations like |a x + b| = c and |a x + b| = |c x + d|. Shows two, one, or no solutions with steps.

https://hexacalculator.com/calculators/mathematics/algebra/absolute-value-calculator

Mathematics

Algebra

Absolute Value Calculator

Calculate the absolute value of a number or expression, the distance between two numbers, and solve absolute-value equations like |a x + b| = c and |a x + b| = |c x + d|. Shows two, one, or no solutions with steps.

Absolute Value Calculator

Choose your task

Choose what you want to do: take the absolute value of a number or an expression, measure the distance between two values, or solve an absolute-value equation.

Enter your values

Only the boxes your chosen task needs are shown. The answer updates as you type.

Result

Value inside the bars

|-7| = 7. The absolute value is the distance of -7 from zero on the number line, so the sign drops away.

Visualize

A picture of what the absolute value is doing.

Loading calculator…

The absolute value of a number answers the question how far is that number from zero? Since only its magnitude is considered and not its sign, positive numbers and their corresponding negative numbers have the same absolute value. The absolute value of 5 is 5, and the absolute value of -5 is also 5. This is because both these numbers are five units away from zero on a number line.

This calculator allows you to perform five different types of calculations involving absolute values: the absolute value of a single number, the absolute value of an expression in the form "a times x plus b", the distance between two values and equations where the absolute sign is on only one side or both sides of the equals sign. Selecting the type of calculation from above will show only the input fields required for that type of calculation.

What is absolute value?

Imagine a number line stretching out from zero in both directions. Every number has a unique position on this line and its absolute value is the distance of that position from zero. Since distance doesn't have direction, an absolute value can never be negative.

If absolute value is denoted by two vertical lines, there are two cases:

x={xif x0xif x<0|x| = \begin{cases} x & \text{if } x \ge 0 \\ -x & \text{if } x < 0 \end{cases}

If x is zero or a positive number, the absolute value equals x. If x is a negative number, change the sign to obtain a positive number which represents the magnitude of the negative number x. Only zero has an absolute value of zero, and zero is neither positive nor negative.

The absolute value of a formula

The absolute value sign can be used not only for single numbers but also for any formulas. If a formula is enclosed in vertical bars, the value of the formula will first be calculated and then the absolute value of that result will be found.

ax+b|a x + b|

When a is equal to 2, b is equal to 3 and x is negative (4), then the expression inside the vertical bars is equivalent to: (2) multiplied by a negative value (4), plus 3. The result is a negative value (5). The absolute value of this result is 5. In programming, the "abs" function performs exactly this operation. It returns the distance of a number from zero, regardless of whether the number is positive or negative.

The distance between two numbers

The distance between two numbers is the absolute value of their difference. It doesn't matter which number you subtract from which because the sign of the difference can change but the absolute value of the result will be the same.

distance=ab=ba\text{distance} = |a - b| = |b - a|

The distance from 3 to 8 is the absolute value of the difference when 3 is subtracted from 8. Since this difference is negative (5), the distance is 5. A negative number (5) resulting from direct subtraction indicates direction, while the absolute value (5) represents only the magnitude of the distance. This can be thought of as a GPS reading that shows you are seven miles from a landmark, regardless of whether you are east or west of it. Similarly, an engineer might measure the difference between the size of a part and the desired size to determine if it is within tolerance (0.2 mm).

Solving Absolute Value Equations

An equation where the absolute value of an expression resulting from the product of x and a plus the addition of b is equal to c seeks all values of x for which the distance of the expression from zero is exactly c. Since one can move away from zero in two directions, the original equation is split into two regular equations. After removing the absolute value sign, in one case the expression is set equal to c and in the other case it is set equal to -c.

ax+b=c    ax+b=corax+b=c|a x + b| = c \;\Rightarrow\; a x + b = c \quad \text{or} \quad a x + b = -c

The number of solutions depends entirely on the number on the right side of the equation.

Right-hand value

Number of solutions

Why

Positive

Two

Two points lie that far from the pivot, one each side

Zero

One

Only the pivot itself is zero distance away

Negative

None

A distance can never be negative

Consider the case where the absolute value of x minus four is equal to six. Splitting this into two cases gives us that x minus four equals six, so x is ten. In the other case we have x minus four equals negative six, so x is negative two. These two solutions are on either side of the midpoint and both are six units away from four. If you make the right hand side zero then the two branches merge into a single solution where x is equal to four. If the right hand side is negative there are no solutions.

If both sides of an equation have absolute values

If both sides of the equation have absolute values, for example if the absolute value of an expression involving x and a plus b is equal to the absolute value of another expression involving c times x plus d, then those two expressions must either be equal or they must be opposites. So again you're going to set up two equations.

ax+b=cx+dorax+b=(cx+d)a x + b = c x + d \quad \text{or} \quad a x + b = -(c x + d)

For the equation where the absolute value of the expression "2x - 1" is equal to the absolute value of the expression "x + 3", if both expressions are equal, then x = 4. If the expressions are opposite numbers, then x = -2/3. A calculator shows these two solutions.

How to use the calculator:

In the top menu select the type of calculation that fits your problem. The input fields will change accordingly and only show the items required for the current calculation.

Enter values to see the result instantly. In distance mode there are separate unit choices for each of the two numbers so you can enter one position in miles and another in kilometers and still get a meaningful answer. In equation solving mode, the calculator will list all solutions or explicitly state if there is no solution or only one solution.

Examples of calculations:

The examples below have chosen values that are easy to calculate so you can check your results by hand.

Task

Input

Answer

Absolute value

|-7|

7

Expression

|2 times -4 + 3|

5

Distance

|3 - 8|

5

Solve, two answers

|x - 4| = 6

x = 10 or x = -2

Solve, one answer

|x + 3| = 0

x = -3

Solve, no answer

|2x - 5| = -4

no solution

Both sides

|2x - 1| = |x + 3|

x = 4 or x = -2/3

Examples of applications for absolute value:

Regardless of direction, the absolute value can be used to show how far away a number is from zero. In a leaderboard, for example, a difference of 300 points between an athlete and the record shows that their performance was either better or worse than the record. Thermostats also use absolute values to keep room temperature within a few degrees of the desired setting. If it's too hot, they turn on air conditioning; if it's too cold, they turn on heating.

In manufacturing industry absolute values are used to determine tolerances. If the difference between a component's dimensions and its specification is within an acceptable range then it meets requirements. Scientists use them to represent error, i.e. the difference between a measured value and the true value. In navigation they are used to calculate the straight line distance between two points on a route.

Common mistakes:

The most common mistake when solving equations is to only consider one of the two possible cases and stop at the first solution. When you see an absolute value sign, remember to consider both the positive and negative case simultaneously.

Another common mistake is to incorrectly interpret the absolute value sign as a parenthesis and remove it early. The absolute value of the expression "x minus 5" is not equal to the expression "x minus 5". Therefore, the absolute value sign must be kept until the equation is split into two branches. If the right side is a positive number, there are two solutions; if it is zero, there is one solution; and if it is negative, there are no solutions. By remembering this, you will avoid unnecessarily searching for non-existent solutions.

This tool is great for learning and solving everyday problems. For tasks that are used to assess performance, please verify each solution by plugging it into the original equation.

Frequently asked questions

What is absolute value?

The absolute value is the distance from zero on a number line. So it's always either zero or positive. The absolute value of 9 is 9, and the absolute value of -9 is also 9, because they're both nine units away from zero. Because the absolute value only considers magnitude and not direction, signs are ignored.

How do you solve an absolute value equation?

You remove the absolute value and split the equation into two regular equations. If the absolute value of an expression that is the product of x and a plus b is equal to c, then you write it once as equal to c and once as equal to -c, and solve each of those equations. For example, if the absolute value of the expression "x minus 4" is equal to 6, then x is either 10 or -2. Finally, you must substitute each solution into the original equation in order to rule out solutions that are not actually valid.

Why can't absolute value be a negative number?

Because it's a distance. A distance can never be negative. If the absolute value of an expression that has 5 subtracted from 2x is equal to -4, this means that some point is a negative distance away from our reference point, which is impossible. So if there's only a negative number on the other side of the absolute value sign, then the equation has no solution.

How do you find the absolute value of an expression that adds 3 to 2x?

If you substitute the value of x into this expression, evaluate it and then find its absolute value, if x is equal to negative 4, then 2 times negative 4 plus 3 is going to be negative 5, and the absolute value of negative 5 is 5. Functions like "abs" in spreadsheets or programming languages do the same thing.

How do you calculate the distance between two numbers?

You subtract one number from the other and calculate the absolute value of the difference, which is the magnitude of the expression with a minus sign between a and b. It doesn't matter which number you subtract first because the absolute value sign will remove both positive and negative signs. The distance between 3 and 8 is the absolute value of the difference when 3 is subtracted from 8, which results in 5. This is also the same as the absolute value of the difference when 8 is subtracted from 3.

Related calculators

Disclaimer: This calculator is provided for general informational and educational purposes only. Our calculators are under active development, and results may be inaccurate, incomplete, or unsuitable for your situation. Always verify the figures independently and seek advice from a qualified professional before relying on them. We make no warranties and accept no liability for any loss or decision arising from use of this tool.

References

  1. Wikipedia: Absolute value

    Formal definition of absolute value, its properties, and the distance interpretation.

  2. Khan Academy: Absolute value

    Lessons on absolute value, absolute-value equations, and their graphs.

  3. Wikipedia: Number line

    The number line, the basis for the distance-from-zero idea.