InfyCalculator
➗

3D Distance Calculator

Find the straight-line distance between two points in 3D space from their (x, y, z) coordinates, plus the midpoint between them.

x₁
y₁
z₁
x₂
y₂
z₂
Loading calculator…

How it works

d = √((x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²) · midpoint = ((x₁+x₂)/2, (y₁+y₂)/2, (z₁+z₂)/2)

The 3D distance formula is the Pythagorean theorem applied twice — once in the base plane and once for the vertical rise — so it extends the familiar 2D distance to space by adding a z-term under the same square root. Each coordinate difference is squared (which drops any sign), the three are summed, and the square root gives the straight-line length. The midpoint is just the average of the two points, coordinate by coordinate.

Worked example

From the origin (0, 0, 0) to (2, 3, 6): the differences are 2, 3 and 6, so d = √(2² + 3² + 6²) = √(4 + 9 + 36) = √49 = 7 exactly. The midpoint is ((0+2)/2, (0+3)/2, (0+6)/2) = (1, 1.5, 3), the point halfway along that segment.

Sources: Euclidean distance — Wikipedia

Frequently asked questions

How is 3D distance different from 2D distance?

It adds a third squared term for the z-axis: √(Δx² + Δy² + Δz²) instead of √(Δx² + Δy²). Geometrically you apply the Pythagorean theorem twice, so a diagonal through space is longer than its shadow on the floor.

Does the order of the two points matter?

No. Each difference is squared, which erases the sign, so swapping point 1 and point 2 gives the same distance. The midpoint is also unchanged because addition is commutative.

What is the midpoint used for?

It is the exact centre of the segment between the two points — useful for finding a balance point, the centre of a sphere through two poles, or the middle of an edge in 3D modelling and graphics.

Related calculators

This calculator is for educational purposes. Double-check important results before acting on them.