3D Distance Calculator
Compute the Euclidean distance, midpoint and per-axis differences between two points in three-dimensional space.
Straight-line distance between the two points
- 1
Δx (x2 − x1)
4 − 1 = 3 - 2
Δy (y2 − y1)
6 − 2 = 4 - 3
Δz (z2 − z1)
8 − 3 = 5 - 4
Sum of squares
3² + 4² + 5² = 50 - 5
Distance
√(50) = 7.0711Square root of the summed squared differences gives the straight-line distance.
How does this calculator work?
The 3D distance between two points is the square root of the summed squared differences along the x, y and z axes: d = √(Δx² + Δy² + Δz²). This calculator also returns the midpoint and each axis delta, so you can see both how far apart the points are and where the gap lies.
Formula
How this is calculated
Enter the coordinates of two points P1 = (x1, y1, z1) and P2 = (x2, y2, z2). Each axis accepts any real number, positive or negative, and the calculator updates instantly as you type.
The straight-line (Euclidean) distance follows directly from the Pythagorean theorem extended to three dimensions: it is the square root of the sum of the squared differences along each axis, d = √(Δx² + Δy² + Δz²), where Δx = x2 − x1, Δy = y2 − y1 and Δz = z2 − z1. The midpoint is the component-wise average, ((x1 + x2)/2, (y1 + y2)/2, (z1 + z2)/2), giving the point exactly halfway along the segment.
Distance is always non-negative and is zero only when the two points coincide. Because squaring removes sign, the order of the points does not affect the distance or the midpoint, though the signed deltas flip sign if you swap P1 and P2. The bar chart shows the absolute deltas |Δx|, |Δy| and |Δz|, making it easy to see which axis contributes most to the separation. All outputs share whatever unit your coordinates use.
Frequently asked questions
The distance between (x1,y1,z1) and (x2,y2,z2) is √((x2−x1)² + (y2−y1)² + (z2−z1)²), the three-dimensional version of the Pythagorean theorem.
No. Distance and midpoint are the same regardless of order. Only the signed deltas Δx, Δy and Δz change sign when you swap the points.
Yes. Any real numbers are valid; the squaring in the formula handles negative differences correctly.
Also known as
TG we-Calculate Editorial Team. (2026). 3D Distance Calculator [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/3d-distance-calculator
TG we-Calculate Editorial Team. "3D Distance Calculator." TG we-Calculate. 2026. https://we-calculate.com/calculator/3d-distance-calculator.
TG we-Calculate Editorial Team, "3D Distance Calculator," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/3d-distance-calculator
@misc{wecalculate_3d_distance_calculator, title = {3D Distance Calculator}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/3d-distance-calculator}}, year = {2026}, note = {TG we-Calculate} }
Did this calculator help you?
