Absolute Value Calculator

Calculate the absolute value of any number. Find the distance from zero, solve absolute value equations, and understand |x| notation.

Any real number
For distance |x − y|
|-42|
42.0000000000
Sign: negative
√(x²) Verification
42.0000000000
Should equal |x|
|x − y| Distance
57.0000000000
|-42 − 15|
Negated (−x)
42.0000000000
−(-42)
Floor / Ceil
-42 / -42
⌊x⌋ and ⌈x⌉
1/x
-0.02380952
|1/x| = 0.02380952
Number Line
−1000+100
Planning notes, formulas, and examples

About the Absolute Value Calculator

The Absolute Value Calculator computes |x| — the distance of a number from zero on the number line. The absolute value is always non-negative: |5| = 5 and |−5| = 5.

Absolute value is a fundamental concept in mathematics with applications in distance calculations, error measurement, signal processing, and optimization. It removes the sign of a number, returning its magnitude.

This calculator computes the absolute value, shows properties (|x| = |−x|, |x × y| = |x| × |y|), and helps solve absolute value equations and inequalities by breaking them into cases.

When This Page Helps

While |x| is simple for a single number, this calculator helps verify absolute value properties, compare magnitudes, and understand how absolute value equations work.

How to Use the Inputs

  1. Enter any number (positive, negative, or zero).
  2. View |x| (the absolute value).
  3. See both the original value and its absolute value.
  4. Check properties like |x| = |−x|.
  5. Use for distance calculations or error measurement.
Formula used
|x| = x if x ≥ 0 |x| = −x if x < 0 Equivalently: |x| = √(x²)

Example Calculation

Result: 42

|−42| = 42. The absolute value removes the negative sign, giving the distance from zero.

Tips & Best Practices

  • |x| is always ≥ 0.
  • |x| = 0 only when x = 0.
  • |a − b| gives the distance between a and b on the number line.
  • |x × y| = |x| × |y| (multiplicative property).
  • The triangle inequality: |a + b| ≤ |a| + |b|.
  • In programming, use Math.abs(x) for absolute value.

Absolute Value in Distance

The distance between two points a and b on a number line is |a − b|. In two dimensions, distance uses the Pythagorean theorem, which extends absolute value to vectors.

Absolute Value Equations

Solving |2x − 3| = 7 requires two cases: 2x − 3 = 7 (x = 5) or 2x − 3 = −7 (x = −2). This case-splitting technique is essential in algebra.

Absolute Value in Optimization

Minimizing Σ|xᵢ − c| finds the median, while minimizing Σ(xᵢ − c)² finds the mean. Absolute-value optimization (L1 norm) produces sparser, more robust solutions.

Sources & Methodology

Last updated:

Frequently Asked Questions

  • Absolute value |x| is the distance of x from zero on the number line. It is always non-negative. |7| = 7 and |−7| = 7.