Absolute value, written |x|, is the non-negative distance of a real number x from zero on the number line, and it follows a single rule: |x| = x when x ≥ 0 and |x| = -x when x < 0. The vertical bars are not decoration; they signal an instruction to discard sign information and keep only magnitude. Because the operation answers "how far, not which way," the result of |x| can never be less than zero — |0| = 0 and |-8| = 8 both produce a non-negative number, the same way 5 does. This is also why the function is sometimes called magnitude in physics or modulus in older mathematics texts. The rule is so short it fits in one line, which is why an absolute value calculator exists mainly to remove the small but real chance of flipping a sign by hand, and to give a live result for decimals and numbers written in scientific notation that are easy to mistype. In the rest of this article we will explain exactly what the bars mean, the one rule that decides every answer, the √(x²) shortcut that gives the same thing, and where absolute value shows up in measurement, geometry, and statistics.

What the Vertical Bars Around a Number Actually Mean
The notation |x| reads as "the absolute value of x" and operates on a single real number at a time. Picture the number line stretching left to right through zero: a positive number sits to the right, a negative number sits an equal distance to the left, and zero sits exactly at the origin. Absolute value asks one question: how many units away from zero is this number? It does not care which direction. That is why |-7| and |7| both return 7: the two numbers are on opposite sides of zero but stand the same number of units away. The same idea generalises to any real number, including decimals and values written in scientific notation. |-3.14| is 3.14, |0.001| is 0.001, and |1.2e4| is 12000. Nothing about the value of the digits changes; only the sign is stripped.
Because the bars return a distance, three consequences follow. First, |x| ≥ 0 for every real x — distance cannot be negative. Second, |x| = |-x| always — a number and its opposite share one magnitude. Third, |x| = 0 only when x itself is 0, since zero is the only point on the number line that sits exactly at the origin. These three facts are useful enough that they show up in proofs, in inequality work, and in any place where magnitude is treated separately from direction.
The Single Rule That Decides Every Answer
If you remember one thing about absolute value, make it this: when x is positive or zero, the absolute value is the number unchanged; when x is negative, the absolute value drops the minus sign. Stated as a piecewise rule, the definition looks like this:
| Condition on x | Rule | What happens |
|---|---|---|
| Positive (x > 0) | |x| = x | Value passes through unchanged |
| Zero (x = 0) | |x| = x | Result is zero |
| Negative (x < 0) | |x| = -x | Sign is dropped, value becomes positive |
The negative branch is the one people hesitate over, because writing -x looks like it should make things negative. The trick is that -x is read as "the negative of x," and if x is already negative, negating it produces a positive. For example, with x = -12, the rule gives |-12| = -(-12) = 12. The minus sign does not cancel itself; it cancels the minus that was already there.
The √(x²) Shortcut and Why It Works
A second way to produce the same answer is to square the number and then take the principal (non-negative) square root: |x| = √(x²). Squaring a real number always returns a non-negative value, because a negative times a negative is a positive and a positive times a positive is a positive — there is no way out. The principal square root then returns the non-negative root by convention, so √(x²) ends up doing exactly what the piecewise rule does, just through a different route.
This shortcut matters less for whole numbers, where the sign rule is faster, and more for algebraic expressions where sign analysis is awkward. If you have to simplify |2 − 7|, for instance, you can either compute the inner expression to get |-5| and drop the sign, or you can write √((2 − 7)²) = √(25) = 5. Both routes are correct. The shortcut is also the form most spreadsheet functions and programming libraries use internally: ABS, fabs, abs, and Math.abs all evaluate the magnitude without writing out a piecewise branch.
Where Absolute Value Shows Up Beyond the Classroom
Absolute value is the natural tool when you want size without direction. In measurement, the absolute error between a measured value and a true value is |measured − true|. The sign tells you whether you over- or under-shot, but the size of the mistake is the absolute value — and that is what people usually quote when they say "within 0.2 grams." In geometry, the distance between two points a and b on a line is |a − b|, and the order of subtraction never changes the result, since |a − b| = |b − a|. In physics and engineering, speed is the magnitude of velocity, and amplitude is the absolute peak of a signal — both strip direction and keep size. The concept also defines the bars in inequalities like |x − 5| < 2, which describes every number within two units of 5, and it powers the L1 (Manhattan) distance and the mean absolute error used throughout statistics and data science.
A worked example keeps the idea concrete. Take the number x = -3.14. Since x is negative, the rule for negative inputs gives |-3.14| = -(-3.14) = 3.14. The digits are identical; only the sign is removed. The same value goes back into the calculator as 3.14 and produces the same answer, which captures the whole point of the function.
If you want a deeper tour of these applications, the guide on absolute value in real life walks through distance, error, and magnitude in more detail.
How to Get |x| with the Calculator
The Absolute Value Calculator takes the rule above and removes every chance of getting the sign wrong by hand. Three steps are all it takes:
- Type any number into the input field. Negatives, decimals, and scientific notation like 1.2e4 are all accepted.
- Read the absolute value |x| in the result panel. The result updates live as you edit, with no button to press, so partial entries are still safe to read.
- Click Copy to put the result on your clipboard for homework, a spreadsheet cell, or a line of code.
Because everything runs in your browser and nothing is uploaded, your input stays on your device. This makes the tool suitable for classrooms, exam prep, and quick checks while reading.
What the Tool Accepts and What It Stops At
The calculator accepts any real number you can type: whole numbers such as 42, negatives such as -42, decimals such as -3.14, and scientific notation such as 1.2e-4 or 6.02e23. Scientific notation is the compact way to write very large or very small numbers, and the tool parses the mantissa and exponent the same way a spreadsheet would. Live updates mean you can edit a digit and watch the result move without clicking anything, which is helpful when checking several nearby values.
At the edge, the tool follows the limits of standard floating-point storage. Inputs up to roughly 1.8 × 10^308 are supported, which covers almost every value a person is likely to type. Anything larger exceeds the range a computer can store precisely and is flagged rather than silently rounded, so you do not get a quietly wrong answer at the extremes. For ordinary homework, spreadsheets, and engineering work, this ceiling is far above anything needed.
Properties Worth Remembering
A handful of facts cover most of what absolute value is used for. They are worth keeping in one place:
- |x| ≥ 0 for every real x, and |x| = 0 only when x = 0.
- |x| = |-x| — a number and its opposite share one magnitude.
- |ab| = |a| · |b| — the absolute value of a product is the product of the absolute values.
- |a + b| ≤ |a| + |b| — the triangle inequality, used heavily in proofs and vector work.
- |a − b| = |b − a| — order of subtraction never changes a distance.
These properties follow directly from the rule that |x| strips the sign, and they are the reason absolute value is treated as a function rather than a notation. Knowing them lets you rearrange expressions without worrying about hidden sign changes, which is the main payoff of understanding what the calculator is doing under the hood.
For a deeper look, see Absolute Value Calculator for Beginners: Learn |x| Fast.