Straight-line distance between two points
The distance formula is the Pythagorean theorem in disguise: it finds the straight-line gap between two points from their coordinates. This calculator handles both 2D and 3D — leave the z values at zero for a flat plane, or fill them in for space — and also returns the midpoint.
The formula
In 2D, distance = the square root of ((x₂ – x₁) squared + (y₂ – y₁) squared). In 3D, add the z term: distance = square root of (Δx squared + Δy squared + Δz squared). The differences Δx, Δy and Δz are just the leg lengths of a right triangle (or box), and the distance is its hypotenuse (or diagonal).
Why it works
Each coordinate difference is one perpendicular leg. Squaring, summing and rooting them is exactly the Pythagorean theorem extended to as many dimensions as you have, which is why the same pattern keeps appearing.
Related algebra tools
For the point halfway along, use the midpoint calculator; for the steepness of the connecting line, the slope calculator.
Worked example
From (1, 2) to (4, 6): Δx = 3 and Δy = 4, so the distance is the square root of (9 + 16) = the square root of 25 = 5 — the classic 3-4-5 right triangle.
FAQ
Do I have to use z?
No — leave both z values at zero and the tool computes the ordinary 2D distance. The z term simply vanishes.
Is distance ever negative?
Never. Squaring the differences removes any sign, so distance is always zero or positive regardless of point order.
