The distance between two points on a number line is the absolute value of their difference: for points at a and b, distance = |a − b| = |b − a|. The bars matter. Subtract in the wrong order and you get −7 instead of 7, and the sign tells you direction, not spacing. The condition that trips people up is a shared origin: both coordinates must be read against the same zero before you subtract anything.
That single rule handles integers, fractions, decimals, radicals, and signed values. What changes is the arithmetic, not the idea. Here is where the rule comes from inside a standard curriculum, how it fails in practice, and how a few common shortcuts mislead.
Why the Distance Formula Reduces to One Subtraction
Picture a ruler. The space between the mark at 3 and the mark at 10 is seven units because you count the gaps, not the marks. On a number line drawn at even spacing, that counting shortcut and the subtraction |10 − 3| always land on the same answer. The formula is just the counting done faster.
Subtraction computes a gap you could measure with a physical ruler, a tape measure, or a marked stick. Nothing about the arithmetic changes at scale: a three-centimeter gap and a three-kilometer gap are both "the right endpoint minus the left endpoint, whatever the sign." The coordinate system supplies the units.
Larger absolute values do not make the operation more complex. A student who can place 4 and 9 and count five intervals between them has already done the work the formula encodes. Writing |9 − 4| is bookkeeping. Writing it on a test is not the point. Understanding that it is counting is.
One more property keeps the numbers honest. If both points shift by the same amount, the distance does not change: |(a + k) − (b + k)| = |a − b|. Slide a whole segment three units right, or three units left, and its length is fixed. That invariant is what lets you relabel a number line with a new zero without breaking anything you have already measured.
Distance Is About Absolute Value, Not Which Point Comes First
Distance has no sign. That is the whole reason the absolute value bars exist. If you compute 3 − 10 you get −7, and if you compute 10 − 3 you get 7. Both describe the same physical gap. One of them has an extra minus sign attached because you subtracted "backwards." The bars throw that sign away.
A signed subtraction carries two pieces of information: the size of the gap, and the direction from one point to the other. A displacement says "move seven units left to get from 10 to 3." A distance says only "they are seven units apart." When the question asks for distance, both answers redesign themselves into 7.
Negative answers to distance questions are therefore always wrong. If a homework answer key gives a signed value, it is telling you about displacement, not distance. Check the wording before you trust the sign. Direction lives in a separately reported "left" or "right," not inside the distance number itself.
Two points can be symmetric about zero and still be far apart: −5 and 5 sit ten units from each other. That surprises people because neither coordinate is large. The formula catches it because |5 − (−5)| = |5 + 5| = 10. The subtraction handles the negative sign automatically once you stop trying to do it mentally.
The Three Cases You Actually Meet on a Number Line
Every number-line problem is one of three cases. Same side of zero: subtract the smaller from the larger and drop the sign. Opposite sides of zero: add the two absolute values. One point at zero: the other coordinate's absolute value, with nothing else involved. Naming the case before you compute is faster than guessing at the operation.
Here are the cases written out with the arithmetic shown.
Same side, positive: 2 and 9 → |2 − 9| = |−7| = 7 Same side, negative: −2 and −9 → |−2 − (−9)| = |7| = 7 Opposite sides: −4 and 6 → |−4 − 6| = |−10| = 10 One point at zero, positive: 0 and 8 → |0 − 8| = 8 One point at zero, negative: 0 and −12 → |−12| = 12
Notice that the first two cases produce the same 7, and the answer is positive both times. A common error is to "double the distance to zero" when both points are negative, which produces a number like 14 for −2 and −9. That is wrong. Both points sit on the same side of zero, so the gap between them is just the difference in their distances from zero.
For the opposite-sides case, the shortcut is to add the two distances from zero. The formula and the shortcut agree. Writing |a| + |b| when a and b have opposite signs is faster than expanding the subtraction. When they share a sign, use ||a| − |b|| instead.
Worked Examples With Integers, Fractions, Decimals, and Radicals
The arithmetic changes with the type of number but the formula never does. What follows is the arithmetic as it actually appears in a homework set, with the intermediate step shown so you can see where a mistake could creep in.
Take −7 and 2. Opposite sides of zero, so the answer is |−7 − 2| = |−9| = 9, or as a shortcut |−7| + |2| = 7 + 2 = 9. Now take 3/4 and 1/4. Same side, so the answer is |3/4 − 1/4| = 2/4 = 1/2. Take −1.5 and 4.25. |−1.5 − 4.25| = |−5.75| = 5.75, which is 1.5 + 4.25 and matches the shortcut. Take √2 and √8. |√2 − √8| = |√2 − 2√2| = |−√2| = √2 ≈ 1.414, assuming the spacing is the standard number line.
Note the decimal answer in the −1.5 to 4.25 case: 5.75, which is exact. A calculator that shows 5.750000001 is doing what a by-hand calculation avoids. When a decimal subtraction looks one digit off, line up the decimal places. The formula does not fix a misplaced decimal point. Only careful arithmetic does.
One worked problem becomes a habit. Solve each example first by counting intervals and then by the formula, and the two answers should agree. Anywhere they don't, you have found either an arithmetic error or a case your mental count missed.
Reading the Formula on a Coordinate Plane
A number line is the x-axis with extra information removed. When algebra class gives you two points like (2, 5) and (8, 5), the y-coordinates match, so the vertical distance is zero and the horizontal distance is what the formula produces: |8 − 2| = 6. Lining them up on a single axis is why this skill transfers to the Pythagorean distance formula.
The general coordinate distance is √((x₂ − x₁)² + (y₂ − y₁)²). When the y-coordinates match, that collapses to √(x₂ − x₁)², which is just |x₂ − x₁|. The number-line formula is the degenerate case of the plane formula, not a separate tool. Tests often present it as "distance from (a, 0) to (b, 0)," which looks harder than it is once you notice the y-values are both zero.
Vertical lines work the same way. Points (4, 1) and (4, 9) sit 8 units apart, computed with the y-coordinate subtraction. The rule does not care which axis carries the variation.
One warning about diagonal distances. If both x and y change, |x₂ − x₁| gives you the horizontal leg, not the straight-line distance. The number-line formula is a special case, and using it on a diagonal problem returns a leg length rather than the answer the problem wants. The commas separating coordinates don't affect the arithmetic. The position does.
The Sign Trap: Displacement Versus Distance
Displacement is the signed version of the same subtraction. Behind it is a direction: 7 − 10 = −3 means "3 units to the left." Behind distance is nothing but gap size. The two are easy to mix up because both are computed from the same values.
A classroom example. Suppose a hiker walks from position 12 to position 5 on a marked trail. The distance covered is |12 − 5| = 7 units. The displacement is 5 − 12 = −7 units, meaning "seven units in the negative direction." A report saying "the hiker moved −7" is correct for displacement and wrong for distance. If the question is "how far," the answer is 7.
Mass-produced answer keys sometimes mix the two. Signed answers for "distance" problems are the tell. Check the phrasing: "how far," "distance between," "space between" all mean absolute value. "Displacement," "change in position," "signed distance" mean preserve the sign. The same numbers, different reporting.
For readers tracking GPS or fitness-tracker readouts, the same distinction appears under different names. An app that says "no net movement" after a round trip is reporting displacement zero. The same trip has a nonzero total distance. These are not contradictory numbers. They answer different questions.
Shortcut, Mistake, and Edge: The Zero Point
The most common mistake is subtracting before checking signs. Take −3 and −11. A student who computes −11 − (−3) = −8 and then reports "8" has the right answer for the wrong reason; the distance is 8. A student who computes 11 − 3 = 8 by mistakenly stripping the minus signs also gets 8 here. Testing that method on −3 and 4 gives 1 instead of 7, which is why "drop all the minus signs first" is a dangerous shortcut.
A second mistake is assuming "the larger number is to the right." True on a standard number line, false if coordinates are reversed (as in some spreadsheet columns or timestamps descending). The sign of the subtraction tells you which way is which only if the axis itself has a defined direction. The absolute value removes that concern entirely.
The zero-point edge works the same as any other. |0 − (−8)| = 8. Points that are symmetric about zero behave like points anywhere else, once you treat zero as a normal coordinate. There is nothing special about zero in the formula. It confuses people because it is easy to write and easy to drop from a subtraction. Write it explicitly.
Failing case to watch for: a problem that gives coordinates in mixed units. Point A at 3 inches and point B at 4 centimeters cannot be subtracted until one of them is converted. The formula produces a number that mixes the units together, and the result means nothing. Convert first, then subtract.
Practice Set With Answers You Can Audit
Solve each problem before reading the answer. Then check the intermediate step and the final result against what follows. Six items cover all the cases you'll meet.
1: Distance between 5 and 12. |5 − 12| = 7. Same side, positive. 2: Distance between −6 and 2. |−6 − 2| = 8. Opposite sides, so the shortcut is 6 + 2 = 8. 3: Distance between −4 and −15. |−4 − (−15)| = 11. Same side, negative, answer is 11. 4: Distance between 0 and −3.75. |0 − (−3.75)| = 3.75. Zero-point case. 5: Distance between 1/3 and 5/6. |1/3 − 5/6| = |2/6 − 5/6| = 3/6 = 1/2. Convert to a common denominator first. 6: Distance between 2.7 and −1.3. |2.7 − (−1.3)| = |4.0| = 4. Opposite sides, exact decimal.
If you got an answer that doesn't appear here because you subtracted in a different order, check the absolute value. If you got five out of six right, your method is probably fine and the one error is arithmetic. If you got three or fewer, check your sign handling on the opposite-sides items first. Those turn negative additions into a single subtraction step, and the shortcut is the faster fix.
When a problem looks impossible, try substituting specific numbers. Replace the complex expression with −2 and 3, compute distance = 5, then solve the actual problem with that number to check whether your formula gives 5. The number-line formula is not a mysterious equation; it is counting with a calculator.
Common Misconceptions and Corner Cases
"Distance is always the bigger number minus the smaller number." Works when both are positive, fails when both are negative. For −2 and −9, bigger is −2 and smaller is −9, so "bigger minus smaller" gives 7. Correct. But the same rule with −2 and −9 misbehaves if you read "bigger" as "larger distance from zero." The shortcut is trustworthy only with actual values, not magnitudes.
"Distance can be negative if the second point is to the left." No, that's direction. A negative number in a distance box is worth a correction. The physical gap is never negative; a displacement can be.
"Fractional coordinates can't have fractional distances." They can. A gap of 3/8 inch is a perfectly real distance, and the formula returns it. Unit choice is separate from the arithmetic.
"A distance of zero means the two points are the same." It does, but only on a number line. On a line with two axes, zero distance means they coincide in both coordinates. The number-line case is the version with the y-coordinates at zero.
Finally, watch for problems that give coordinates in a picture rather than as numbers. The formula still applies to the marks, but the scale factors (e.g., 1 tick = 4 units) need to be applied. Reading positions off a scaled axis without converting units is the most common failure on diagrams.
FAQ
What is the formula for the distance between two points on a number line?
Distance = |a − b|, where a and b are the coordinates of the two points. The absolute value bars are not decorative; they convert a signed subtraction into a signed-free gap. Either order works. The result is the same. A reference-free version is simply "count the intervals between the two tick marks."
When do I use the shortcut vs. the formula?
Use ||a| − |b|| when the points share a sign, |a| + |b| when they have opposite signs, and the other point's absolute value when one point is zero. The shortcut and the full formula produce identical answers; the shortcut is just fewer steps. On a test, the full formula is safer because it fails less silently.
Why did I get a negative answer?
Because you reported displacement instead of distance, or because you subtracted a larger value from a smaller one and did not take the absolute value. Distance problems always return a nonnegative number. If your answer has a minus sign, the report should say "displacement" or "signed," not "distance."
How is this different from distance between two points on a coordinate plane?
The plane version adds a second subtraction and a square root: √((x₂ − x₁)² + (y₂ − y₁)²). When the y-coordinates match, the plane version collapses to the number-line version. The number-line formula is a special case, not a different concept. The trap is applying it to diagonal distances, which returns a leg rather than the hypotenuse.
Can the distance ever be greater than the distance from either point to zero?
Yes, when the points are on opposite sides of zero. −5 and 5 sit ten units apart, while each is only five from zero. The distance between them is twice the larger point-to-zero distance. When both points share a side of zero, the point-to-point distance cannot exceed the larger point-to-zero distance.
What's a typical mistake when the coordinates are fractions or decimals?
Forgetting to convert to a common denominator or misaligning decimal places. A gap between 1/2 and 1/8 is not 7; it's 3/8 because 1/2 = 4/8. A gap between 1.2 and 0.13 is not 1.07 or 0.93; it's 1.07, but only if you line up the decimal places carefully. The formula is exact; the arithmetic is the risk.
Does the zero point matter for the answer?
No, because the absolute value removes the reference point entirely. Shift both points by +10 or −10 and the distance is unchanged. The zero matters only for defining which side is "positive," which affects displacement but not distance. If a problem says "the origin is at," use the given origin to label coordinates, then subtract as usual.
How would I audit an answer key that seems wrong?
Check the wording. If "distance" was asked, a signed answer is at best ambiguous and probably wrong. Recompute with |a − b| in both orders; the answer should be the same. Then try a simple substitute like a = −2 and b = 3 to check whether the formula reproduces the key's number. If it doesn't, the key, not the problem, contains the error.