Skip to main content
│x│ Algebra

Absolute Value Calculator

Find |x| — the distance of a number from zero — or the distance between two numbers |a − b|. Enter one value for the absolute value, or two for the distance between them.

|x| from zero
Negatives → positive
Distance |a − b|
Sign rule shown
100% Free
🔢 Open All Math Calculators 📖 Read the Guide

Absolute value — Quick answer

The absolute value is the distance from zero — always zero or positive.

|x| = x if x ≥ 0,  |x| = −x if x < 0  ·  distance = |a − b|

Worked example: |−7| = 7; distance between −3 and 5 = |−3 − 5| = 8.

Examples

ExpressionResult
|−7|7
|8.2|8.2
|0|0
|10 − 4|6

Absolute value is never negative. Distance is symmetric: |a − b| = |b − a|.

│x│ Absolute Value Calculator

Enter one number for |x|, or two numbers for the distance |a − b| between them.

Result
What it is

ℹ️ Absolute value = distance from zero, never negative. With two numbers it returns the distance |a − b| between them.

The absolute value of a number is its distance from zero on the number line — always zero or positive. Written |x|, it simply drops the sign: |−7| = 7. The same idea gives the distance between two numbers as |a − b|, which is the same whichever way round you subtract.

Reviewed: June 20, 2026 · Author: Naveen P N, Founder — AI Calculator · Verified against: the absolute-value definition, recomputed in code.

The definition

Absolute value
|x| = x if x ≥ 0,  |x| = −x if x < 0
Distance
distance(a, b) = |a − b| = |b − a|

If the number is zero or positive, the absolute value is the number itself. If it's negative, you negate it — and negating a negative makes it positive. Geometrically, |x| is how far x sits from zero. The distance between two points on the line is the absolute value of their difference, which is why it doesn't matter which you subtract from which.

Worked examples

A negative number:

Drop the sign
|−7| = −(−7) = 7

A positive decimal and zero:

Unchanged
|8.2| = 8.2  ·  |0| = 0

Distance between −3 and 5:

|a − b|
|−3 − 5| = |−8| = 8

So |−7| is 7, |8.2| stays 8.2, and −3 and 5 are 8 apart. The absolute value never comes out negative.

Frequently Asked Questions

What is the absolute value of a number?

Its distance from zero, always ≥ 0. |x| = x if x ≥ 0, else −x. |−7| = 7, |8.2| = 8.2.

Absolute value of a negative number?

Drop the minus: |−7| = 7, |−3.5| = 3.5. Same distance from zero as the positive.

Distance between two numbers?

|a − b|. Between −3 and 5 → |−8| = 8. Symmetric: |a − b| = |b − a|.

Same as modulus?

For real numbers, yes. Don't confuse with modulo (remainder) or complex modulus √(re²+im²).

Can it be negative?

Never. Zero only when the input is zero, positive otherwise. −|x| negates after, separately.

Need more math tools?

Explore distance, modulo, percent error, rounding and more across the AI Calculator math suite.

🔢 Open Math Calculators — Free

No registration required · 350+ calculators · PDF report export