Smekys
Ad Space

Absolute Value Calculator

Free absolute value calculator: instantly computes |x|, number-line distance, solutions to |x|=a, and complex modulus.

Enter Values

Any real number, positive or negative. Its distance from 0 on the number line is returned as |x|.

Optional second point y; the distance between x and y is |x - y|.

The constant a in |x| = a. Must be non-negative; a < 0 has no real solution.

The real part of z = a + bi. Used together with Im(z) to compute the modulus |z|.

The imaginary part b of z = a + bi. The modulus is sqrt(a^2 + b^2).

Result

Absolute Value |x|
7
Distance From Zero
7
Distance Between x and y
10
Solution x = +a
5
Solution x = -a
-5
Complex Modulus |z|
5

The absolute value of a number is its distance from zero on the number line, and distance is never negative. This calculator takes any real number — positive, negative, or zero — and returns its absolute value instantly. It also goes one step further: it shows the distance between two points on the number line, solves the equation |x| = a for you, and computes the modulus of a complex number.

Type a number into the box below and the result updates as you type. Negative signs vanish, zeros stay zero, and large numbers lose nothing in magnitude — that is the whole idea of absolute value.

How to Use

  1. Enter the Number (x) in the first field. You can type a positive number like 42, a negative number like −17, a fraction, or a decimal. Press Enter or tap anywhere outside the box to see |x|.
  2. Read Absolute Value |x| on the result card. If x was negative, the sign simply flips; if x was already positive or zero, it stays exactly the same.
  3. Optionally fill in the Second Point on Number Line to see the distance between x and y. Distance is always |x − y|, which works the same whether x is to the left or the right of y.
  4. Set the Right-Hand Side a to solve |x| = a. The calculator returns the two solutions x = +a and x = −a (unless a = 0, where the two collapse into a single solution x = 0).
  5. Enter Re(z) and Im(z) to compute the modulus of a complex number z = a + bi. The modulus is the straight-line distance from the origin on the complex plane, computed as √(a² + b²).
  6. If you enter a negative value for a in |x| = a, the calculator tells you that no real solution exists — an absolute value can never be negative.

The result card highlights |x| in bold so you can grab the answer at a glance, while the surrounding lines explain what that number means geometrically.

The Definition of Absolute Value

Formally, the absolute value of a real number x is defined piecewise:

|x| = x if x ≥ 0, and |x| = −x if x < 0

That sounds trickier than it is. All it means is: drop the minus sign. |−7| = 7, |7| = 7, and |0| = 0. The notation |x| with vertical bars comes from Karl Weierstrass in the 1840s, and it quickly spread through every branch of mathematics, physics, and engineering because it captures the idea of "size" without direction.

Geometrically, |x| is how far x sits from the origin on the number line. Walk 7 steps to the left and you are still 7 steps from home — direction does not change the distance. That single insight is why absolute value shows up in budgeting (an overdraw of −$250 is still a $250 debt), in temperature (a drop from 20°C to −5°C is a 25-degree swing), and in science (errors, tolerances, and magnitudes are all reported as non-negative numbers).

Distance on the Number Line

The distance between two points x and y on a number line is |x − y|, and it does not matter which order you subtract them in. |5 − 2| = 3 and |2 − 5| = 3 — the distance from 2 to 5 is the same as the distance from 5 to 2.

This is why |x| alone is just a special case: it is the distance between x and 0, i.e. |x − 0|. When you compare two bank balances, a reading on a gauge, or two measurements on a ruler, the absolute difference between them is the number that actually matters.

Solving |x| = a

An equation of the form |x| = a asks "which numbers are exactly a units away from zero?" If a > 0 there are always two answers: x = +a on the right side of the origin and x = −a on the left. For example, |x| = 5 has the solutions x = 5 and x = −5.

If a = 0, the two answers coincide and the only solution is x = 0. If a < 0, there is no solution at all, because no number sits a negative distance from zero. This last case trips up students on tests constantly — any time the right-hand side of an absolute-value equation is negative, the equation has no real solution.

Complex Modulus

When x is not a single real number but a complex number z = a + bi, the absolute value generalizes into the modulus |z| = √(a² + b²). It is the hypotenuse of the right triangle whose legs are the real part a and the imaginary part b, computed with the Pythagorean theorem. For z = 3 + 4i, |z| = √(9 + 16) = √25 = 5. The modulus is always non-negative, just like its real-number cousin, and it is the standard way to measure "how big" a complex number is in fields from circuit analysis to quantum mechanics.

Examples

Example 1 — A negative bank balance. Your checking account shows −$250 after an overdraft. The absolute value |−250| = 250 tells you the size of the debt: you owe $250, not −$250. Swipe the Number (x) box to −250 and the card returns 250.

Example 2 — Distance between two points. The thermometer reads −4°C in the morning and 11°C at noon. The temperature swing is |(−4) − 11| = |−15| = 15 degrees. Enter x = −4 and the second point y = 11, and the Distance Between x and y field shows 15.

Example 3 — Solving |x| = 5. Looking for numbers exactly five units from zero? The calculator returns x = +5 and x = −5. On a number line both points are the same distance from the origin, just on opposite sides.

Example 4 — A very large number. A debt of $2,500,000 written as −2,500,000 has an absolute value of 2,500,000. Magnitudes of a million or more are handled exactly, with no rounding surprises.

Example 5 — Complex modulus. For z = 3 + 4i, enter Re(z) = 3 and Im(z) = 4. The modulus is √(3² + 4²) = √25 = 5, the classic 3-4-5 right triangle on the complex plane.

FAQ

What is the absolute value of a negative number?

The absolute value of a negative number is the same number with the negative sign removed. For example, |−12| = 12 and |−0.75| = 0.75. Geometrically, it is the distance from that number to zero on the number line, and distance can never be negative.

Is the absolute value of 0 equal to 0?

Yes. |0| = 0 is the boundary case of the piecewise definition. Zero is exactly zero units away from itself, so its absolute value is zero. It is also the only number whose absolute value equals itself without being positive.

Can an absolute value ever be negative?

No. By definition an absolute value measures distance, and distance is always greater than or equal to zero. This is also why the equation |x| = a has no real solution when a is negative — there is no number whose distance from zero is a negative number.

How do I solve |x| = a?

If a is positive, there are two solutions: x = +a and x = −a. If a = 0, the only solution is x = 0. If a is negative, there is no real solution. Enter the right-hand side a in this calculator and both solutions appear automatically on the result card.

What is the difference between absolute value and the distance between two points?

They are the same idea applied to different pairs of points. |x| is the distance from x to 0. The distance between two points x and y is |x − y|, which reduces to |x| when y = 0. Because subtraction is inside the absolute value bars, the order of x and y does not matter: |x − y| = |y − x|.

What is the modulus of a complex number?

For a complex number z = a + bi, the modulus is |z| = √(a² + b²). It is the straight-line distance from the origin to the point (a, b) on the complex plane, computed with the Pythagorean theorem. For example, |3 + 4i| = √(9 + 16) = 5.

Does the absolute value work for very large numbers?

Yes. The engine uses exact integer arithmetic for whole numbers and correctly rounded floating-point arithmetic for decimals, so values of 1,000,000 and beyond — whether positive or negative — return their true magnitude with no overflow or rounding error.

Disclaimer

This absolute value calculator is provided for informational purposes only and does not constitute mathematical, financial, engineering, or academic advice. Results are computed directly from the piecewise definition |x| = x (if x ≥ 0) and |x| = −x (if x < 0), and from the Pythagorean formula √(a² + b²) for complex modulus. Always double-check critical calculations against your textbook, a teacher, or a qualified professional before relying on them in homework, exams, or real-world decisions.

Related Calculators

Disclaimer

Results are estimates for illustration only. Verify important figures independently.