Absolute Value Calculator

Find the absolute value of a number, or the distance between two numbers on the number line, with exact decimal arithmetic and each step written out.

Absolute value |x|7.25

-1000000000000000 – 1000000000000000

Absolute value |x|

7.25

  • Distance from 07.25
  • Opposite −x7.25
  • Sign of xnegative

Absolute value is the distance from zero on the number line, so it is never negative. Inputs are handled as exact decimals.

How this was calculated

x = −7.25 is negative, so |x| = −x = −(−7.25) = 7.25.

What absolute value means

The absolute value of a number is its distance from zero on the number line, so it is never negative. Written |x|, it equals x when x is zero or positive and −x when x is negative: |8| = 8 and |−8| = 8.

The absolute difference |a − b| is the distance between a and b. Because distance has no direction, |a − b| = |b − a|.

Worked examples

|−7.25|: the number is negative, so |−7.25| = −(−7.25) = 7.25.

|3.5 − (−12)|: first a − b = 3.5 + 12 = 15.5, then |15.5| = 15.5. Swapping the order gives −12 − 3.5 = −15.5, whose absolute value is also 15.5.

Exact decimals

The calculator subtracts as exact decimals rather than binary floating point, so |0.3 − 0.1| comes out as exactly 0.2 instead of 0.19999999999999998.

How to use the Absolute Value Calculator

Choose a mode and enter your numbers.

  1. Choose the mode

    Pick absolute value |x| or absolute difference |a − b|.

  2. Enter the numbers

    Type any positive or negative number, including decimals.

  3. Read the result

    See the result with the signed difference and each step.

References

Frequently asked questions

Can an absolute value be negative?

No. It measures distance from zero, so the smallest possible value is 0, which is the absolute value of 0 itself.

What is the difference between absolute difference and percent error?

Absolute difference is the raw gap |a − b| in the original units. Percent error divides that gap by a reference value and expresses it as a percentage.

Is |a − b| the same as |a| − |b|?

Not in general. For a = 3 and b = −5, |a − b| = 8 but |a| − |b| = −2. The triangle inequality says |a| − |b| ≤ |a − b|.

Last updated . Results are estimates for informational purposes only.