Three-Dimensional Distance Calculator

Three-Dimensional Distance Calculator

Emerging AI Skill PRO

Enter Calculation

Formula

d=(X2−X1)2+(Y2−Y1)2+(Z2−Z1)2d = \sqrt{\left({{\text{X}_2}} - {{\text{X}_1}}\right)^2 + \left({{\text{Y}_2}} - {{\text{Y}_1}}\right)^2 + \left({{\text{Z}_2}} - {{\text{Z}_1}}\right)^2}

Example

d=(4−1)2+(6−2)2+(3−3)2=5d = \sqrt{\left(4 - 1\right)^2 + \left(6 - 2\right)^2 + \left(3 - 3\right)^2} = 5
Usage stats

Advertisement

Results

3D Distance
5
units between the two points
Δx (x₂ − x₁) 3
Δy (y₂ − y₁) 4
Δz (z₂ − z₁) 0

Report an error on this page

What Is the 3D Distance Calculator?

This calculator finds the straight-line (Euclidean) distance between two points located in three-dimensional space. Each point is described by three coordinates — an x value, a y value, and a z value — and the tool returns the shortest distance separating them. It is the natural extension of the familiar 2D distance formula into a third dimension, making it useful in geometry, physics, computer graphics, engineering, and 3D modeling.

How to Use It

Enter the coordinates of the first point (\(\text{X}_1\), \(\text{Y}_1\), \(\text{Z}_1\)) and the second point (\(\text{X}_2\), \(\text{Y}_2\), \(\text{Z}_2\)). Click calculate to see the distance along with the component differences \(\Delta x\), \(\Delta y\), and \(\Delta z\). Coordinates may be positive, negative, or decimal values, and the result is expressed in the same units as your inputs.

Right-triangle decomposition showing horizontal and vertical legs forming the 3D diagonal
The formula extends the Pythagorean theorem to three dimensions using the x, y, and z differences.

The Formula Explained

The distance is computed with the three-dimensional Pythagorean theorem:

$$d = \sqrt{\left(\text{X}_2 - \text{X}_1\right)^2 + \left(\text{Y}_2 - \text{Y}_1\right)^2 + \left(\text{Z}_2 - \text{Z}_1\right)^2}$$

Each axis difference is squared so negatives never reduce the total, the squares are summed, and the square root converts the sum back to a linear measurement. Because the contributions are added under one root, the order of the points does not matter.

Advertisement

Worked Example

Suppose point A = (1, 2, 3) and point B = (4, 6, 3). Then \(\Delta x = 3\), \(\Delta y = 4\), \(\Delta z = 0\). Squaring gives $$9 + 16 + 0 = 25,$$ and \(\sqrt{25} = 5\). The two points are exactly 5 units apart.

Two points in a 3D coordinate system connected by a straight diagonal distance line
The 3D distance is the straight line between two points across the x, y, and z axes.

FAQ

Does the order of the points matter? No. Swapping point 1 and point 2 only flips the sign of each difference, and squaring removes the sign, so the distance is identical.

What units does the result use? Whatever units your coordinates are in. If you enter meters, the distance is in meters; the formula is unit-agnostic.

What if two points are identical? All differences are zero, so the distance is 0.

Last updated:

Most popular in Math and Statistics

View all Math and Statistics calculators