Calculate the distance between two points in 3D space using the distance formula, plus the midpoint and the vector between them.
Two Points
A
B
Try:
3D distance
—
Enter both points to see the distance.
—
Δx
—
Δy
—
Δz
Enter both points above to see the 3D distance.
Midpoint of A and B
—
Enter both points to compute the midpoint.
The midpoint is the exact center of the line segment connecting Point A and Point B — found by averaging each coordinate separately: ((x1+x2)/2, (y1+y2)/2, (z1+z2)/2).
Displacement vector, A → B
—
Enter both points to compute the vector.
—
Magnitude
The vector from A to B is B − A: (x2−x1, y2−y1, z2−z1). Its magnitude (length) is the same value as the 3D distance.
Finding the distance between two points in three-dimensional space comes up constantly in geometry, physics, computer graphics, and engineering — anywhere positions are tracked with x, y, and z coordinates.
📋
Walk-through
How to Use This Calculator
3 steps▸
1
Enter both points' coordinates
Type the x, y, and z coordinates of Point A and Point B in the shared input card. All three tabs below use the same two points.
2
Read the distance
The Distance tab shows the straight-line distance between the two points, computed as d = √(Δx²+Δy²+Δz²) — the same idea as the Pythagorean theorem, extended to a third dimension.
3
Check the midpoint and vector
Switch to the Midpoint tab to see the exact center of the segment connecting A and B, or the Vector tab to see the displacement from A to B and its magnitude.
⚡
Reference
Formula & Methodology
3 formulas▸
3D distance formula
d = √(Δx² + Δy² + Δz²)
Δx, Δy, and Δz are the differences between Point B and Point A in each axis (x2−x1, y2−y1, z2−z1). Squaring, summing, and taking the square root gives the straight-line distance between the two points — an extension of the 2D Pythagorean theorem to three dimensions. The result is in whatever length unit the coordinates already use.
Midpoint formula
M = ((x1+x2)/2, (y1+y2)/2, (z1+z2)/2)
The midpoint is the coordinate-wise average of the two points — the exact center of the line segment connecting them.
Displacement vector
v = B − A = (x2−x1, y2−y1, z2−z1)
The vector pointing from Point A to Point B. Its three components are the same Δx, Δy, Δz used in the distance formula, and its magnitude (length) equals the 3D distance.
📖
Glossary
Key Terms Explained
6 terms▸
3D distance ↗The straight-line length of the segment connecting two points in three-dimensional space, computed as √(Δx²+Δy²+Δz²).
Euclidean distance ↗The standard 'as the crow flies' distance measure based on the Pythagorean theorem — applies in 2D, 3D, or any number of dimensions by summing the squared differences of each coordinate.
Midpoint ↗The point exactly halfway between two given points, found by averaging their coordinates in each axis.
Displacement vector ↗A vector describing the direction and distance from one point to another. From A to B it equals B − A, with components (Δx, Δy, Δz).
Coordinates ↗The (x, y, z) values that locate a point in three-dimensional space relative to a fixed origin.
Pythagorean theorem ↗The rule that in a right triangle, the square of the hypotenuse equals the sum of the squares of the other two sides. The 3D distance formula extends this by chaining two right triangles — one in the xy-plane, one lifting into z.
👥
Scenarios
Real-World Examples
3 worked examples▸
📍
Baseline scenario
Origin to (1, 2, 2)
Point A (0, 0, 0)Point B (1, 2, 2)
Δx=1, Δy=2, Δz=2, so d = √(1²+2²+2²) = √9 = 3. This is the calculator's default example — a clean, exact result that's easy to verify by hand.
🎯
Midpoint check
Same two points, Midpoint tab
Point A (0, 0, 0)Point B (1, 2, 2)
The midpoint averages each coordinate: ((0+1)/2, (0+2)/2, (0+2)/2) = (0.5, 1, 1) — the exact center of the segment between the two points.
➡️
Vector check
Same two points, Vector tab
Point A (0, 0, 0)Point B (1, 2, 2)
The displacement vector from A to B is B − A = (1−0, 2−0, 2−0) = (1, 2, 2). Its magnitude, √(1²+2²+2²) = 3, matches the distance from the first example — the vector's length is always the same as the distance between the points.
🔗
Reference
Cite This Calculator
APA & MLA▸
Use either format to cite this calculator in a paper, report, or resource list.
Finding the distance between two points in three-dimensional space comes up constantly in geometry, physics, computer graphics, and engineering — anywhere positions are tracked with x, y, and z coordinates. This calculator applies the 3D distance formula directly, and also surfaces two closely related results: the midpoint of the segment and the displacement vector between the points.
How the 3D distance formula works
▸
The formula d = √(Δx²+Δy²+Δz²) is a direct extension of the 2D distance formula, which is itself the Pythagorean theorem in disguise. In 2D, you find the hypotenuse of a right triangle formed by Δx and Δy. In 3D, you apply the Pythagorean theorem twice: first to find the diagonal distance across the xy-plane (√(Δx²+Δy²)), then treat that diagonal and Δz as the two legs of a second right triangle rising into the z-axis. Squaring both sides and simplifying gives the compact three-term formula used here.
Inputs and what they mean
▸
The calculator takes six numbers: the x, y, and z coordinates of Point A, and the x, y, and z coordinates of Point B. There are no required units — the formula works identically whether your coordinates are in meters, inches, pixels, or any other consistent unit, and the result comes out in that same unit. Negative coordinates are fully supported, since 3D space extends in both directions along every axis.
Limits and edge cases
▸
When Point A and Point B are the same coordinate, the distance is 0 and the displacement vector is (0, 0, 0) — there's no meaningful direction to report. This formula measures straight-line ('as the crow flies') distance only; it does not account for obstacles, curved paths, or any routing constraint. It's also a different metric from Manhattan distance (which sums absolute coordinate differences instead of taking a square root of squares) — the two give different answers except along a single axis.
❓
Questions
Frequently Asked Questions
6 questions▸
What is the 3D distance formula?+
d = √(Δx²+Δy²+Δz²), where Δx, Δy, and Δz are the differences between the two points' x, y, and z coordinates. It's the direct three-dimensional extension of the Pythagorean theorem.
How is this different from the 2D distance formula?+
The 2D formula is the same idea with the z term dropped: d = √(Δx²+Δy²). If both points share the same z-coordinate, the 3D formula reduces to exactly the 2D formula.
How do you find the midpoint of two 3D points?+
Average each coordinate separately: midpoint = ((x1+x2)/2, (y1+y2)/2, (z1+z2)/2). It's the point exactly halfway between A and B in every axis.
What units does the result use?+
Whatever length unit your coordinates are already in. The formula is unit-agnostic — enter coordinates in meters and the distance comes out in meters; enter them in inches and it comes out in inches.
What is the displacement vector?+
The vector from Point A to Point B, computed as B − A: (x2−x1, y2−y1, z2−z1). It captures both direction and distance; its magnitude equals the 3D distance.
Is this the same as Manhattan distance?+
No. Manhattan distance sums the absolute differences (|Δx|+|Δy|+|Δz|) instead of taking the square root of the sum of squares. It measures grid-style travel (like city blocks) rather than a straight line, and generally gives a larger number than Euclidean distance for the same two points.
📄
Save & share
Get a branded PDF of your results
Download a one-page PDF of your numbers instantly. Add your email to also get our occasional calculator tips — no spam, unsubscribe anytime. Privacy.