Absolute Value Calculator
Enter a number to find its absolute value, its distance from zero.
Updated
Absolute Value Calculator
Our Absolute Value Calculator finds |x|, the distance of any number from zero on the number line. Type a positive or negative number, whole or decimal, and the absolute value appears instantly with the working shown. It keeps every digit you type, so long decimals are never rounded.
Quick answer
The absolute value of a number is its distance from 0, so it is never negative. Drop the minus sign from a negative number; leave a positive number or 0 as it is. For example, |−7| = 7, |7| = 7 and |0| = 0. Enter any number above and the calculator shows the result instantly.
- Formula: |x| = x if x ≥ 0, and −x if x < 0
- Always 0 or more: |x| = −2 has no solution
- Distance between two numbers: |a − b|, e.g. |5 − (−8)| = 13
- In code and spreadsheets: abs(x), Math.abs(x) or =ABS(A1)
What Is Absolute Value?
The absolute value of a number tells you how far it is from 0, without caring which side of 0 it is on. On a number line, −4 and 4 are both four steps from 0, so |−4| = |4| = 4. It is written with two vertical bars around the number, a notation introduced by Karl Weierstrass in 1841.
Absolute value is used whenever only the size of a number matters, not its direction: the distance between two points, how far a measurement is from its target, the size of an error, or a change in temperature or price.
Absolute Value Formula
|x| = −x if x < 0
Also: |x| = √(x²)
The second line can look odd at first: if x is negative, −x is positive. For x = −7, −x = −(−7) = 7. The last line works because squaring removes the sign and the square root gives back the positive value: √((−7)²) = √49 = 7.
Example Calculations
| Expression | Absolute value | Why |
|---|---|---|
| |−7| | 7 | Negative, so drop the minus sign |
| |7| | 7 | Positive, so it stays the same |
| |−12.5| | 12.5 | Decimals work the same way |
| |−3/4| | 3/4 | So do fractions |
| |0| | 0 | Zero is 0 away from itself |
| |3 − 10| | 7 | Work out the inside first: |−7| = 7 |
| −|−5| | −5 | |−5| = 5, then the outside minus applies |
Properties of Absolute Value
| Property | Rule | Example |
|---|---|---|
| Never negative | |a| ≥ 0 | |−9| = 9 |
| Opposites match | |−a| = |a| | |−4| = |4| = 4 |
| Products | |a × b| = |a| × |b| | |−3 × 4| = 3 × 4 = 12 |
| Quotients | |a ÷ b| = |a| ÷ |b| | |−12 ÷ 4| = 12 ÷ 4 = 3 |
| Triangle inequality | |a + b| ≤ |a| + |b| | |−3 + 5| = 2 ≤ 8 |
| Squares | |a|² = a² | |−6|² = 36 = (−6)² |
Watch out for sums: absolute value does not split over addition. |−3 + 5| = 2, but |−3| + |5| = 8. The two are equal only when the numbers have the same sign (or one is 0).
Absolute Value Equations and Inequalities
|x − 3| = 2 → x = 5 or x = 1
|x| = −2 → no solution
|x| < 3 → −3 < x < 3
|x| ≥ 3 → x ≤ −3 or x ≥ 3
Read |x − c| as “the distance from x to c”. Then |x − 3| = 2 asks which numbers are 2 away from 3 (1 and 5), and |x| < 3 asks which numbers are less than 3 away from 0 (everything between −3 and 3).
Key Terms
- Absolute value
- The distance of a number from 0, written |x|.
- Magnitude
- The size of a number regardless of its sign; another word for absolute value.
- Modulus
- Another name for absolute value, also used for the size of a complex number.
- Opposite
- The number the same distance from 0 on the other side: the opposite of 4 is −4.
- Number line
- A straight line with 0 in the middle, positives to the right and negatives to the left.
How to Use the Absolute Value Calculator
- Enter the number. Type any number in the “Number (x)” box: positive, negative, whole or decimal, for example −12.5.
- Read the absolute value. The absolute value appears as you type, with the working underneath (for example |−12.5| = 12.5, −12.5 is 12.5 units from 0). Every digit you typed is kept; nothing is rounded.
- Copy the result. Press Copy to copy the result. Press Clear or Esc to start again.
Example: enter −0.000123456789 and the result is 0.000123456789, with every digit kept.
Who Can Use This Calculator?
Frequently Asked Questions (FAQs)
What is the absolute value of a number?
The absolute value of a number is its distance from 0 on the number line, written |x|. Distance is never negative, so the absolute value is always 0 or more: |7| = 7 and |−7| = 7, because both are 7 steps from 0.
How do you find the absolute value?
If the number is negative, drop the minus sign; if it is positive or 0, leave it as it is. So |−12.5| = 12.5, |3| = 3 and |0| = 0. As a formula: |x| = x when x ≥ 0, and |x| = −x when x < 0.
Can an absolute value be negative?
No. An absolute value is a distance, so it is always 0 or positive. That is why an equation like |x| = −2 has no solution. Note that −|5| = −5 is allowed: the minus sign sits outside the bars and is applied after the absolute value.
What is the absolute value of 0?
|0| = 0. Zero is the only number whose absolute value is 0, because every other number is some distance away from 0.
How do you find the distance between two numbers?
Subtract them and take the absolute value: the distance between a and b is |a − b|. The distance between −8 and 5 is |5 − (−8)| = 13, which is also the temperature change from −8 °C to 5 °C. The order does not matter: |−8 − 5| = 13 too.
How do you solve absolute value equations?
|x| = 5 means x is 5 away from 0, so x = 5 or x = −5. For |x − 3| = 2, split it into x − 3 = 2 or x − 3 = −2, giving x = 5 or x = 1. If the right-hand side is negative, there is no solution.
Is absolute value the same as modulus?
Yes, for real numbers “modulus” is another name for absolute value, and in code it is usually called abs. For a complex number a + bi, the modulus is its distance from 0 in the complex plane, √(a² + b²), so |3 + 4i| = 5. Modulus can also mean the remainder operation (mod), which is different.
How do you get the absolute value in Excel or code?
Excel and Google Sheets: =ABS(A1). JavaScript and Java: Math.abs(x). Python: abs(x). C: abs() for integers and fabs() for decimals. One catch: the most negative integer has no positive partner, so Math.abs(Integer.MIN_VALUE) in Java returns the same negative number, and abs(INT_MIN) in C is undefined.
Is the Absolute Value Calculator free?
Yes. It is completely free, needs no sign-up, and can be used as many times as you like.
Try our Absolute Value Calculator to find |x| for any number instantly.