Absolute Value Calculator
Find the absolute value of any number, or the distance between two numbers, with exact step-by-step math and an answer that is never negative.
What absolute value means
The absolute value of a number is its distance from on the number line — a measurement that is always zero or positive, no matter which direction the number sits in. Written with bars around the number, , absolute value strips away the sign and keeps only the size:
Both and are exactly units away from , just on opposite sides, so both have the same absolute value.
|x|: distance from zero
For a single number , answers "how far is from ?":
- If is positive or , it's already its own distance from : .
- If is negative, its distance from is the same size with the sign dropped: (which is positive, since itself is negative).
|a − b|: distance between two numbers
Wrapping a subtraction in absolute value bars gives the distance between two numbers, regardless of which one is larger:
Plain subtraction can come out negative if is bigger than , but the bars erase that sign, so the order never changes the answer:
Both compute the same distance — units — between and on the number line. This calculator's "distance between two numbers" mode uses exactly this |a − b| form.
Absolute value is always ≥ 0
Because absolute value measures distance, it can never be negative. The smallest possible absolute value is , which happens only when the input itself is — every other number, positive or negative, has a strictly positive distance from . This calculator's answer is always zero or positive; if you ever see a negative result for an absolute value, something has gone wrong upstream.
Worked examples
Example 1 — single negative number: , since is units from .
Example 2 — exact decimal: ; a positive number is already its own absolute value.
Example 3 — distance between two numbers: and — swapping the order gives the same distance.
Example 4 — zero: , the only number that is its own (and only) distance from itself.
Where absolute value shows up
Absolute value appears throughout math and science: measuring error or deviation (how far a measurement is from a target, regardless of direction), computing distance on a number line or between coordinates, and defining functions piecewise around a sign change. It's closely related to the Square Root calculator — for any real number , , since squaring erases the sign and the (principal) square root always returns a non-negative value.
Frequently asked questions
- What is absolute value?
- The absolute value of a number , written , is its distance from on the number line — always zero or positive, regardless of the number's sign. So and , since both and are units away from .
- Why is |-7| equal to 7, not -7?
- Absolute value measures distance, and distance can't be negative. sits units to the left of on the number line, so its distance from is — the same distance as , which sits units to the right. Taking absolute value simply drops the sign: .
- What does |a - b| mean?
- It means the distance between and on the number line, no matter which one is bigger. Subtracting the two numbers can give either a positive or a negative result depending on the order, but wrapping the subtraction in absolute value bars always returns the non-negative distance: , and — the same answer either way.
- Does the order of a and b matter in |a - b|?
- No. always equals , because reversing the subtraction just flips the sign of the result inside the bars, and absolute value erases that sign. and are the same distance measured from either direction.
- Can absolute value ever be negative?
- No — absolute value is defined to always be zero or positive. There is no real number whose absolute value is negative. The only way to get out of is when itself is , since is its own distance from .
- How is absolute value different from just removing a minus sign?
- For a single negative number they look the same ( is "drop the sign"), but absolute value is really a distance measurement, which is why it also works on expressions like — you can't just "remove a minus sign" from a subtraction; you compute the difference first, then take its magnitude.