How to use the 3D distance calculator
- Enter the first point as x₁, y₁ and z₁.
- Enter the second point as x₂, y₂ and z₂.
- Read the Distance and the Midpoint.
- Check the Working, which lists Δx, Δy and Δz, their squares and the square root.
What it does and when to use it
Use this when your points have height or depth as well as position on a plane: the length of a cable between two anchor points at different heights, the diagonal of a room or a shipping box, the gap between two atoms in a molecule model, or the distance between objects in a 3D game or CAD file. Students meet it in 3D coordinate geometry and when finding the length of a vector.
For flat points, use the 2D distance calculator. The 3D vector calculator works with directions and angles in space. The Pythagorean calculator explains the right-triangle rule this formula is built on.
How it works
The tool uses the 3D distance formula:
d = √((x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²)
It is the Pythagorean theorem applied twice. First the floor diagonal √(Δx² + Δy²) is found, then that diagonal and the height difference Δz form a second right triangle. The midpoint averages each coordinate: ((x₁ + x₂)/2, (y₁ + y₂)/2, (z₁ + z₂)/2).
Worked examples
Step by step. From (2, −1, 4) to (8, 1, 7).
- Differences: Δx = 8 − 2 = 6, Δy = 1 − (−1) = 2, Δz = 7 − 4 = 3.
- Squares: 36, 4 and 9.
- Add them: 36 + 4 + 9 = 49.
- Square root: √49 = 7.
The working ends √(36 + 4 + 9) = √49 = 7, and the tool gives Midpoint: (5, 0, 5.5).
A box diagonal. A box 3 by 4 by 12 units, from corner (0, 0, 0) to (3, 4, 12), gives Distance: 13. A rod up to 13 units long fits inside from corner to corner, even though the longest edge is only 12. The floor diagonal alone is 5 (from 3 and 4), and 5 with 12 makes 13.
Limits and tips
- No units are attached. Keep all six coordinates in the same unit.
- Answers that are not whole show up to 10 significant figures. In maths classes you may need to leave them as a square root, which the working line shows (for example √29).
- Everything is worked out in your browser.
Frequently asked questions
How is this different from the 2D distance formula?
Can I find the longest rod that fits in a box?
Do negative coordinates work?
Can it measure distances between GPS positions?
How do we know nothing is uploaded? Test it yourself on the privacy proof page.