Math calculator

Absolute Value Calculator

How far from zero, and how far apart.

Who this is for: Absolute change versus relative change, and when the second has no value.

Distance from zero

Add a second value for the distance between them.

|−7|

7

The bars measure how far the number sits from zero, and distance has no direction.

|value|

7

distance from zero

Sign of the input

negative

left of zero

  • −7 sits 7 to the left of zero, so its distance from zero is 7.

Decimals are read from the digits you typed, so 2.675 stays 2.675 rather than the 2.67499999999999982 a double would hold.

What this tool shows

Absolute value is a distance, and distance has no direction. That is the definition worth carrying, because “drop the minus sign” is a rule about how a number is written and it fails as soon as there is a letter inside the bars.

  • The absolute value of any number
  • The distance between two numbers
  • Absolute change and relative change
  • Why |−x| is not x
  • What the bars mean in an equation
  • Where a relative change has no value
Distance from zero Distance between two Exact decimals Absolute vs relative change

Add a second value for the distance between the two.

Updated 25 September 2026 · Works in any browser, no installation

The absolute value of a number is its distance from zero. |−7| is 7 and |7| is 7, because both sit seven units from zero — one to the left, one to the right. Zero is its own absolute value, and it is the only number that is neither positive nor negative.

At a glance

Formula shown
|x| = x when x ≥ 0, and −x when x < 0. The distance between a and b is |a − b|, which equals |b − a| because squaring or negating a difference does not change its size.
Scenario support
Measuring an error without caring which side it fell on; finding how far apart two temperatures or two readings are; checking a tolerance.

Distance, not sign removal

Put the number on a line and ask how far it is from zero. That is the whole definition, and it is worth holding onto because it survives everywhere the shortcut does not.

It explains immediately why the answer is never negative — distances are not — and why zero is the only fixed point. It also explains |a − b|: the gap between two numbers is the distance between them, and the gap does not know which one you started from.

The bars are not brackets. |3 − 5| is 2, not −2, because the bars are applied last and the subtraction inside them happens first.

Why not just drop the sign

“Take off the minus sign” works for every number you can write down, and stops working the moment a letter appears.

|−x| is not x. It is |x|. The expression −x is only negative when x is positive, and if x is already negative then −x is the positive one and the bars change nothing. The sign written in front tells you nothing about the sign of the value.

This is the step that makes absolute-value equations need two cases rather than one. |x| = 5 has two answers because two numbers sit five units from zero, and no amount of sign-dropping produces the second one.

The definition that always works is the piecewise one: |x| is x when x is zero or positive, and −x when x is negative. That second branch is a minus sign making a positive number, which looks wrong and is the whole point.

Absolute change and relative change

Two quantities go up by 5. One started at 10 and one started at 1,000. The absolute change is the same; the relative change is not remotely.

Absolute change is |new − old|, in the original units. It answers “how much”.

Relative change divides that by the starting value and is usually written as a percentage. It answers “how much, compared with what there was”.

A relative change from zero has no value at all. Not infinity, not a very large number — there is nothing for the change to be a proportion of, and this page says so rather than printing a number that would be meaningless.

Which one to quote is a real choice. A drug that lowers a risk from 2 in 10,000 to 1 in 10,000 has halved it in relative terms and moved it by 0.01 percentage points in absolute terms. Both sentences are true and they leave very different impressions.

Two changes worked through: across zero, then down and back up

Both examples are the calculator’s own output, pinned as tests in its engine suite, so the working here cannot drift from what the tool computes.

From −3 °C at dawn to 4 °C by noon

The rise is |4 − (−3)| = |7| = 7 degrees. Subtract inside the bars first, taking care that minus a negative is a plus, and only then take the absolute value.

The tempting shortcut is |4| − |−3| = 4 − 3 = 1, and it is wrong by six degrees. Taking absolute values first throws away the fact that the two readings sit on opposite sides of zero, which is exactly the part of the journey the shortcut loses. It only agrees with the right answer when both numbers have the same sign.

Enter the readings the other way round, 4 then −3, and the absolute change is still 7 while the signed change becomes −7. The distance has no direction; the change does.

The calculator will also print a relative change here, 700/3%, about 233.33%. Treat it with suspicion: 0 °C is not an absence of temperature, so a percentage of a Celsius reading describes nothing physical. In Fahrenheit the same morning, 26.6 °F to 39.2 °F, would be a rise of about 47%. Quote relative change only for quantities with a true zero, such as money, mass or counts.

A $1,250 bill cut to $1,100, then raised back

Going down, the absolute change is |1,100 − 1,250| = 150, the signed change is −150, and the relative change is −150 ÷ 1,250 = −12%.

Going back up from 1,100 to 1,250, the absolute change is 150 again, but the relative change is 150 ÷ 1,100, which the calculator shows exactly as 150/11%, about 13.64%. The same 150 is a smaller share of the bigger starting value.

That asymmetry is the practical lesson. A 12% cut is not undone by a 12% rise; a 12% rise from 1,100 reaches only 1,232. When a price, a salary or a portfolio falls and recovers, the absolute change is the symmetric one and the relative change is not.

Four misreadings of the bars

  • |a − b| taken as |a| − |b|. It gave 1 instead of 7 above. Subtract first, then apply the bars.
  • |−x| read as x. With x = −4, |−x| is |4| = 4, which equals |x|, not x.
  • A relative change from zero. Going from 0 to 5 has an absolute change of 5 and no relative change at all; the calculator reports it as undefined rather than infinite.
  • Percentages of readings with an arbitrary zero. Celsius and Fahrenheit give different percentages for the same weather, which is the sign that neither means anything.

The shape of the graph

y = |x| is a V with its point at the origin: the line y = x for positive x, and its reflection for negative x.

The corner is the interesting part. The function is continuous there — you can draw it without lifting the pen — but it has no single slope at that point, because the slope is −1 arriving and +1 leaving. It is the standard example of a function that is continuous everywhere and differentiable not quite everywhere.

Anything inside the bars just moves the corner. |x − 3| has its point at x = 3, which is also why |x − 3| reads as “the distance from x to 3” and why that reading makes the equations easy.

Where it gets used

Error and tolerance. A measurement is within tolerance when |measured − target| is small enough. Nobody cares which side it fell on, which is exactly what the bars encode.

Distance. On a number line the distance between two points is |a − b|. In more dimensions it becomes Pythagoras, but the one-dimensional case is where the idea starts.

Statistics. The mean absolute deviation averages |x − mean| across a dataset. It is the honest alternative to squaring the differences, and it is less sensitive to a single extreme value.

Programming. Comparing two floating-point numbers is done with |a − b| < tolerance rather than with equality, because exact equality on decimals almost never holds.

Sources and methodology

The definition and its properties are standard; these are the references.

Method. Values are parsed from the decimal string rather than through a floating-point number, so 2.675 stays 2.675 rather than becoming the 2.67499999999999982 a double actually holds — which matters here because the page reports the input back alongside the answer. A relative change from a starting value of zero is reported as undefined rather than as infinity or as a very large number, because there is genuinely nothing for the change to be a percentage of. That engine is verified on every change against 155 hand-written assertions, including that the distance between two values is identical whichever way round they are subtracted, and that no absolute value is ever returned negative. The count and the per-case breakdown are published on the formula verification page.

Related calculators

Where this goes next:

Absolute Value EquationBoth cases written out, in interval and set-builder notation — with the distinction the topic turns on: a less-than is an AND, a greater-than is an OR.
Percentage ChangeWork out percentage increase or decrease, reverse change, loss recovery, percentage points, multi-period change, and CAGR.
Percent ErrorPercent error against an accepted value, rounded to your significant figures, for one measurement, repeated trials, or a whole column of pairs.
Floor and CeilingFloor, ceiling and truncation side by side — because for negative numbers those are three different answers, and floor(−2.5) is −3 while truncating gives −2.
DistanceThe distance between two points in the plane or in space, kept exact as a surd wherever the square root does not come out — √50 stays √50, and is also shown as 5√2.
RoundingAll seven rounding rules on the same number at once, so the disagreement at a tie is visible rather than buried inside whichever one your software happened to pick.

More in Math, or browse all calculators.

Read the guide

When the bars contain an unknown rather than a number, the Absolute Value Equation Calculator solves both cases and handles the inequalities.

Educational use disclaimer

This is an educational tool. Values are read from the digits you type and kept exact, so a decimal is not rounded on its way in.

How we calculate · Found an error? email us

Authorship & verification

Built and maintained by .

How this calculator is tested

155 automated cases pass, run against the engine this calculator shares with 5 related calculators; last run 30 September 2026.

Test cases by kind
Independent cross-check4expected values published elsewhere, or reached by a second method
Golden104worked by hand, the arithmetic written into the test
Boundary26zero, negative, extreme and invalid inputs
Property8rules that must hold for any input
Structural13every output present and finite

Full verification report for this calculator

What's changed (4 updates)

Published 7 September 2026

  1. Published the absolute value page built around distance rather than around 'drop the minus sign', because the second rule fails as soon as a letter is inside the bars — |−x| is |x|, not x.
  2. A relative change from a starting value of zero is reported as undefined rather than as infinity or a very large number, since there is genuinely nothing for the change to be a percentage of.
  3. Values are parsed from the digits typed rather than through a double, so the input echoed back beside the answer is the number the reader entered.
  4. Added two worked changes computed by the engine and pinned as tests: −3 °C to 4 °C (why |a| − |b| fails across zero, and why a percentage of a Celsius reading means nothing) and a $1,250 bill cut to $1,100 and back (−12% down, 150/11% up).

Add this calculator to your site

Responsive embed — and private: nothing your visitors type leaves their browser.