Distance Calculator (3D)

Enter the coordinates of two points in 3D spaceX1, Y1, Z1 for the first point and X2, Y2, Z2 for the second — and this 3D Distance Calculator computes the straight-line distance between them using the 3D distance formula. You also get the individual axis differences (ΔX, ΔY, ΔZ) as supporting outputs.

Results

Distance (d)

--

ΔX (X2 − X1)

--

ΔY (Y2 − Y1)

--

ΔZ (Z2 − Z1)

--

Distance² (d²)

--

Axis Contributions to Distance²

Frequently Asked Questions

What is the 3D distance formula?

The 3D distance formula calculates the straight-line distance between two points in three-dimensional space: d = √[(x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²]. It is an extension of the 2D Pythagorean theorem applied to a third axis (Z). The result is always a non-negative value.

How do I calculate the 3D distance between two points?

Subtract the corresponding coordinates of the two points to get ΔX, ΔY, and ΔZ. Square each difference, add the three squared values together, then take the square root of the sum. For example, between (5, 6, 2) and (−7, 11, −13): d = √[(−12)² + 5² + (−15)²] = √[144 + 25 + 225] = √394 ≈ 19.849.

What is the distance from (1, 1, 1) to (3, 6, 9)?

Using the 3D distance formula: d = √[(3−1)² + (6−1)² + (9−1)²] = √[4 + 25 + 64] = √93 ≈ 9.644. Enter these values directly into the calculator above to verify.

What is the distance from (1, 1, 1) to the origin (0, 0, 0)?

d = √[(0−1)² + (0−1)² + (0−1)²] = √[1 + 1 + 1] = √3 ≈ 1.732. This is also known as the magnitude of the vector (1, 1, 1).

Can I enter negative coordinates?

Yes. The calculator accepts any real numbers — positive, negative, or decimal — for all six coordinate inputs. The squared differences in the formula ensure negative values are handled correctly and the result is always positive.

What is the difference between 2D and 3D distance?

The 2D distance formula is d = √[(x₂−x₁)² + (y₂−y₁)²], which works on a flat plane. The 3D formula adds a third term for the Z-axis: d = √[(x₂−x₁)² + (y₂−y₁)² + (z₂−z₁)²]. Use the 3D formula whenever your points exist in three-dimensional space.

Why is the distance between two points always positive?

Distance is a scalar quantity representing a physical length, which cannot be negative. Even though the coordinate differences (ΔX, ΔY, ΔZ) can be negative, squaring them before summing ensures all contributions are positive, and the square root of a positive number is always positive.

What units does the 3D distance calculator use?

The calculator is unit-agnostic — it works with whatever unit system your coordinates are in. If your coordinates are in meters, the result is in meters. If they are in inches, feet, or any other unit, the output distance will be in those same units.

More Math Tools