Overview

The distance formula extends to three dimensions by adding a third squared difference.

Enter the coordinates of both points.

Worked examples

InputsResult
x₁1y₁2z₁3x₂4y₂6z₂15Distance: 13Midpoint: (2.5, 4, 9)
Show 2 more examples
x₁0y₁0z₁0x₂1y₂1z₂1Distance: 1.73205Midpoint: (0.5, 0.5, 0.5)
x₁-3y₁4z₁2x₂5y₂-1z₂7Distance: 10.6771Midpoint: (1, 1.5, 4.5)

Distance by z₂

With the calculator's starting values, the distance is 13. The table shows how it changes with the z₂.

z₂Distance
87.07107
108.60233
1210.2956
1412.083
15starting value13
1613.9284
1815.8114
2017.72
2219.6469

Other inputs: x₁: 1 · y₁: 2 · z₁: 3 · x₂: 4 · y₂: 6. Change them in the calculator above for your own numbers.

How it works

Distance is the Pythagorean theorem applied twice. The midpoint averages each coordinate.

The formula

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

Practical tips

  • (1, 2, 3) to (4, 6, 15) is exactly 13.
  • Used in 3D games, robotics and CAD.
  • Keep the same units on all axes.

Frequently asked questions

What about 2D?

Set both z values to 0, or use the distance formula calculator.

What is the midpoint?

The point halfway along the line between them.