Math

Distance Between Two Points Calculator

Find the straight-line (Euclidean) distance between two points in three-dimensional space. Leave z at 0 for 2D.

Your numbers

Your results

Distance
Distance
—
Squared distance
—

Distance Between Two Points Calculator by TheCalcTools

How the Distance Between Two Points Calculator works

Enter the coordinates of both points. For a flat 2D problem leave both z values at 0.

The calculator squares the difference along each axis and adds them.

The square root of that sum is the distance.

The formula

d = √((x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²)

Worked example

Using the default values shown in the calculator:

x₁0
y₁0
z₁0
x₂3
y₂4
z₂0
  1. Differences: Δx = 3, Δy = 4, Δz = 0.
  2. Squared distance = 9 + 16 + 0 = 25.00.
  3. Distance = √25 = 5.00.

Result:

Distance5.0000
Squared distance25.0000

Frequently asked questions

Is this the same as the Pythagorean theorem?

Yes. In 2D the distance formula is the Pythagorean theorem applied to the horizontal and vertical differences.

What units is the answer in?

The same units as your coordinates. If the points are in metres, the distance is in metres.

Sources and further reading

More in Math · All calculators

This calculator gives estimates for information only. Check important results independently before you rely on them. See our disclaimer.