Absolute Value Calculator

Absolute value of the first number7.50
Absolute value of the second number3.00
Distance between them |a - b|10.50
How this was calculated
  1. The absolute value strips the sign: |-7.50| = 7.50 — it answers 'how far from zero', never 'in which direction'.
  2. Distance between the two numbers = |a - b| = |-7.50 - 3.00| = |-10.50| = 10.50: on the number line they sit 10.50 units apart.
  3. Absolute value is never negative, and it is zero only for zero itself — that is what makes it the natural language for distances, errors and tolerances.

Our absolute value calculator takes any number you enter and returns its distance from zero on the number line. That distance is never negative, and it equals zero only for zero itself. Type in −7.5 and you get 7.5; type in 7.5 and you get the same result, 7.5. The tool also handles the distance between two numbers a and b, which is |a − b| — always positive, whichever order you subtract in. Behind the scenes sits the piecewise definition that powers every 'strip the sign' shortcut: |x| = x when x is at least 0, and |x| = −x when x is negative.

That piecewise rule is the accepted standard because it is the only definition that preserves the core properties professionals rely on — namely |a × b| = |a| × |b| and the triangle inequality, which states that |a + b| is at most |a| + |b|. These properties make absolute value the world's error language: tolerances, deviations, forecast errors such as mean absolute error, and temperature anomalies are all absolute values in disguise. This page shows the formula, walks through step-by-step workings, provides worked examples, and cites the sources behind each calculation.

Worked examples

Negative meets positive

Primary result: 7.50 — the distance from zero for -7.50, with the pair sitting 10.50 units apart. (-7.5 · 3)

Absolute value of the first number7.50
Absolute value of the second number3.00
Distance between them |a - b|10.50

Either side of zero

Primary result: 4.25 — |4.25| is itself, and it sits 6.00 units from -1.75. (4.25 · -1.75)

Absolute value of the first number4.25
Absolute value of the second number1.75
Distance between them |a - b|6.00

The same number twice

Primary result: 12.00 — two copies of -12 are 0.00 apart — distance zero, absolute value 12.00. (-12 · -12)

Absolute value of the first number12.00
Absolute value of the second number12.00
Distance between them |a - b|0.00

What absolute value means

The absolute value of a number is its distance from zero on the number line. Picture a horizontal line with zero in the middle, negative numbers stretching to the left, and positive numbers stretching to the right. The value 7.5 sits 7.5 units to the right of zero. The value −7.5 sits 7.5 units to the left of zero. Both are the same distance from the center, so both have the same absolute value: |−7.5| = 7.5 and |7.5| = 7.5. That is why an absolute value calculator gives you the same result whether you enter a positive number or its negative twin — it is measuring distance, not direction.

Because absolute value measures a physical distance, it is never negative, and it equals zero only for zero itself. The piecewise definition behind the shorthand "strip the sign" makes this precise: |x| = x when x is at least 0, and |x| = −x when x is negative. When x is negative, negating it flips it positive, so the result is always a nonnegative distance. The same distance idea extends to the gap between any two numbers. The distance between two numbers a and b is |a − b|, and it is always positive, whichever order you subtract in. Subtract b from a or a from b — the sign inside the bars flips, but the distance stays the same.

Two properties govern how absolute values behave under multiplication and addition. First, |a × b| = |a| × |b|: the distance of a product equals the product of the distances. Second, the triangle inequality says |a + b| is at most |a| + |b|. In plain terms, taking a shortcut (adding first, then measuring) can never put you farther than measuring each leg separately and adding the distances. Equality holds when both numbers point the same direction; the sum is strictly shorter when they point in opposite directions.

Absolute values run the world's error language. Manufacturing tolerances, forecast errors such as mean absolute error (MAE), temperature anomalies, and deviations from a target are all absolute values in disguise. In every case, the question is the same: how far is the observed value from the reference? The sign of the error — too high or too low — is discarded so that the size of the gap is what gets reported, compared, and averaged.

  • |−7.5| = 7.5 and |7.5| = 7.5 — same distance from zero, opposite directions
  • Absolute value is never negative; it equals zero only for zero itself
  • Distance between two numbers a and b: |a − b|, always positive regardless of subtraction order
  • Piecewise definition: |x| = x when x ≥ 0, and |x| = −x when x is negative
  • Multiplication property: |a × b| = |a| × |b|
  • Triangle inequality: |a + b| is at most |a| + |b|
Whenever you see a tolerance, a deviation, or a forecast error reported as a single positive number, you are looking at an absolute value. The sign was stripped because the question was "how far?" — not "which way?"

Distance between two numbers

The absolute value calculator above handles distance calculations using the general formula |a − b|. This expression gives you the straight-line distance between any two numbers on the number line, and it is always positive, whichever order you subtract in. That symmetry is what makes absolute value so useful here: |a − b| and |b − a| give you the same result, so you never have to worry about which number comes first.

When you use this tool, three cases can appear. For same-sign pairs, such as 8 and 3, the calculation is |8 − 3| = 5. For opposite-sign pairs, such as −4 and 6, the distance is |−4 − 6| = |−10| = 10 — the numbers sit on opposite sides of zero, so the distance spans both of their gaps from zero. For identical numbers, the result is zero, because a number sits exactly on top of itself. In every case the formula stays the same; only the sign handling changes.

The piecewise definition behind the calculation is straightforward: |x| = x when x is at least 0, and |x| = −x when x is negative. That is the formal way of saying you strip the sign. Absolute value is never negative, and it equals zero only for zero itself, which is why the distance between two identical numbers comes out to exactly 0 while every other pair produces a positive result.

  • Same-sign pair (both positive or both negative): subtract the smaller from the larger in absolute terms — |8 − 3| = 5, |−3 − (−8)| = 5.
  • Opposite-sign pair (one positive, one negative): add their distances from zero — |−4 − 6| = 10.
  • Identical numbers: the distance is 0, since |a − a| = 0.
The triangle inequality tells us |a + b| is at most |a| + |b|. In distance terms, going directly from one point to another is never longer than making a stop along the way — a property this calculator relies on when it reports every distance as a single non-negative value.

Where absolute value shows up

Absolute value is not just a textbook exercise. The notation is worth learning because it shows up wherever people measure how far something is from a target. An absolute value calculator can help you see that quickly, but the underlying idea is what matters. The absolute value of a number is its distance from zero on the number line: |−7.5| = 7.5 and |7.5| = 7.5. Absolute value is never negative, and it equals zero only for zero itself.

That distance idea extends to any two points. The distance between two numbers a and b is |a − b| — always positive, whichever order you subtract in. This is exactly why machinists use tolerances. If a shaft must be 10 mm wide and the actual part measures 9.98 mm, the deviation is |9.98 − 10| = 0.02 mm. The sign does not matter; only the size of the gap does. The same logic applies in forecasting, where mean absolute error (MAE) averages the absolute differences between predicted and actual values so that overestimates and underestimates do not cancel each other out.

Statistics works the same way. Deviations from a mean are signed, but when analysts want to talk about typical spread without worrying about direction, they reach for absolute values. Temperature anomalies — the difference between a given day's temperature and a long-term average — are another example. A cold anomaly and a warm anomaly of the same size both matter equally, so reporting them as absolute values keeps the focus on magnitude rather than direction. Absolute temperature scales, such as Kelvin, are built on the same principle: they measure distance from absolute zero, and they never go negative.

Behind all of these uses sits a simple piecewise definition. Formally, |x| = x when x is at least 0, and |x| = −x when x is negative — the piecewise definition behind 'strip the sign.' Two key properties make the algebra reliable. First, |a x b| = |a| x |b|, so the absolute value of a product equals the product of the absolute values. Second, the triangle inequality says that |a + b| is at most |a| + |b|, meaning the combined distance can never exceed the sum of the individual distances. These rules hold whether you are working with machining tolerances, forecast errors, or statistical deviations.

Common mistakes

The most common mistake people make when using an absolute value calculator is treating |x| as simply "make it positive" and then dropping one of the valid solutions. Consider an equation like |x| = 5. The absolute value of a number is its distance from zero on the number line, so both 5 and −5 are five units away from zero. That means x = 5 and x = −5 both work. If you just "make x positive" and move on, you lose the negative solution entirely. The piecewise definition makes this clear: |x| = x when x is at least 0, and |x| = −x when x is negative. So when you see |x| = 5, you are solving two cases — x = 5 or x = −5 — not just one.

A second mistake involves the distance between two numbers. The distance between two numbers a and b is |a − b|, always positive, whichever order you subtract in. That means |a − b| = |b − a|. But people often assume |a − b| equals |a| − |b|, and that is simply wrong. Take a = 3 and b = 7. Then |a − b| = |3 − 7| = |−4| = 4, while |a| − |b| = |3| − |7| = 3 − 7 = −4. The two expressions give different results, and |a| − |b| can even be negative — which can never happen with a true absolute value, since absolute value is never negative and equals zero only for zero itself.

This matters in real applications more than you might expect. Absolute values run the world's error language: tolerances, deviations, forecast errors (MAE), and temperature anomalies are all absolute values in disguise. In those settings, |a − b| typically represents the gap between a measured value and a target. If you swap in |a| − |b| by mistake, your error calculation falls apart — you may get a negative "distance" or a magnitude that makes no physical sense.

  • Always split |x| = c into two cases: x = c and x = −c (when c is positive).
  • Never rewrite |a − b| as |a| − |b| — they are not equal in general.
  • Remember that |a − b| = |b − a|, so the order of subtraction does not matter.
  • Use the correct properties instead: |a × b| = |a| × |b|, and the triangle inequality says |a + b| is at most |a| + |b|.
If your result comes out negative, you have made a mistake. Absolute value is never negative — it equals zero only for zero itself.

FAQs

What is the absolute value of a number?

It is the distance from zero on the number line, ignoring direction. The absolute value of −7.5 is 7.5; the absolute value of 7.5 is also 7.5. This means whether the number is positive or negative, the absolute value is always the same nonnegative number representing how far it sits from zero.

How do you find the distance between two numbers?

Subtract them and take the absolute value: |a − b|. Between −7.5 and 3 the distance is |−10.5| = 10.5 units. This method works regardless of which number you subtract from which, because the absolute value ensures the result is always a nonnegative distance.

Can absolute value be negative?

No. Absolute value is a distance, and distances are zero or positive. |x| = 0 only when x itself is 0. Since absolute value measures how far a number is from zero without regard to direction, it can never produce a negative result, no matter what the input is.

What is the difference between |a − b| and |a| − |b|?

They are usually different numbers: |3 − (−7.5)| = 10.5, but |3| − |−7.5| = −4.5. Distance is computed by subtracting first, then taking the absolute value. Taking absolute values first and then subtracting can produce a negative result, which is not a valid distance.

Why does absolute value matter in real life?

It is how errors and tolerances are expressed: a part made to 10 mm ± 0.1 mm, a forecast off by 2 degrees, a bank balance's deviation from budget — all absolute differences. Whenever you need to measure the size of a gap or discrepancy without caring about direction, absolute value gives you the meaningful nonnegative quantity.

What is |0|?

Zero. Zero is exactly zero units from zero, and it is the only number whose absolute value is itself zero. Every other number, whether positive or negative, has a positive absolute value because it sits some nonzero distance away from zero on the number line.

Sources

Related calculators

Fraction to Decimal Calculator
Any fraction as a decimal, a percentage and a mixed number — with the simplification shown and a note on whether the decimal terminates or repeats.
Percentage Calculator
Four percentage jobs in one tool: X% of Y, X as a % of Y, percentage change, and increasing or decreasing a number by a percent.
Long Division Calculator
Long division with the whole quotient, the remainder and the decimal carried to four places — plus the multiply-back check that proves the answer.