Absolute Value Calculator
The absolute value of a number is its distance from zero on the number line, always returned as a non-negative quantity regardless of whether the original number is positive or negative. Written with vertical bars as |x|, it simply strips the sign: |7| equals 7, |-7| also equals 7, and |0| is 0. This idea scales up naturally: |3 minus 10| equals |-7| equals 7, which is the absolute difference between 3 and 10, or equivalently the distance between those two points on the number line. This calculator handles both uses. In single-number mode you enter one value and get back its absolute value, its distance from zero, and the sign of the original number. In difference mode you enter two numbers and the calculator evaluates the absolute value of their difference, |a minus b|, which is the same as the distance between a and b regardless of order. You can enter negative numbers, decimals, and zero in either field. The absolute value concept appears throughout mathematics and its applications: in error analysis it measures how far a measurement deviates from the truth; in statistics it appears in mean absolute deviation; in geometry it gives distances; in programming it is a built-in function for handling magnitudes. This tool is useful for students learning about absolute value for the first time, for checking arithmetic, and for quickly computing absolute differences between two quantities. It does not evaluate general algebraic expressions such as |x squared minus 5|; for those you would substitute a numeric value for x first.
Leave the second field blank for a single absolute value. Enter both fields to compute |a − b|, the distance between two numbers.
How it works
When only one value is entered the calculator returns Math.abs(a), which is a if a is positive or zero, or -a if a is negative. The distance from zero is identical to the absolute value. The sign label reports Positive, Negative, or Zero based on the original input. When a second value b is entered, the calculator computes |a minus b|: it subtracts b from a and then takes the absolute value of the result. This is commutative, meaning |a minus b| always equals |b minus a|, so the order you enter the values does not affect the distance result.
Worked example
Using the default value a = -7.5 with no second value: |-7.5| = 7.5. The number is 7.5 units from zero on the number line. The original number is negative. To also demonstrate the difference mode: enter a = 3 and b = 10 to get |3 minus 10| = |-7| = 7, confirming the distance between 3 and 10 is 7 units.
Related calculators
- Absolute Error Calculator: apply absolute value to the difference between a measured and true value.
- Percent Error Calculator: express that absolute error as a percentage of the true value.
- Discriminant Calculator: classify quadratic roots using b squared minus 4ac.
- Proportion Calculator: solve a/b = c/d for any missing value.