Skip to content
ENExplore Calculators

Number Line Distance Calculator

Work out number line distance instantly with clear inputs, formula shown and shareable results.

About Number Line Distance Calculator

Distance on a number line is the absolute difference |b − a|, which is never negative. The midpoint is the plain average (a + b)/2.

Formulas

Distance

d = |b − a|

Midpoint

m = (a + b) / 2

Worked example

With the default values below, Number Line Distance Calculator returns Distance of 19.000000. Change any input above and every figure here is recalculated in your browser.

Inputs used

First point
-7
Second point
12

Results

Distance
19.000000
Midpoint
2.500000
Signed difference b − a
19.000000
Direction
Second point is to the right

Step by step

  1. 1Values used
  2. 2Distance
  3. 3Midpoint
  4. 4Distance= 19.000000
  5. 5Midpoint= 2.500000
  6. 6Signed difference b − a= 19.000000
  7. 7Direction= Second point is to the right

Assumptions and limits

  • The result is derived only from the 2 inputs listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
  • Figures are rounded for display to 6 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

Frequently Asked Questions

From −7 to 12?

The distance is 19 and the midpoint is 2.5.

Why use absolute value?

Distance is a magnitude, so it should not depend on which point you name first.

Number Line Distance Calculator | Calcrivo