Distance between two points, midpoint and slope — in 2D or 3D, with unit conversion.
This is the straight-line (Euclidean) distance between two points — not a road distance. Results update live.
Distance between the points
How to use this tool
Type the x and y coordinates of the first point.
Type the x and y coordinates of the second point.
Pick the unit your coordinates are in — the distance is also shown converted to metres, kilometres, miles and feet.
Switch on 3D mode if your points also have a z-coordinate.
Formula & worked example
Points (0, 0) and (3, 4) are 5 units apart: d = √(3² + 4²) = √25 = 5. Their midpoint is (1.5, 2) and the slope of the line joining them is 4 ÷ 3 ≈ 1.3333.
Limitations — read this before you rely on it
This is a flat, straight-line (Euclidean) distance on a coordinate grid. It does not account for roads, terrain, obstacles, or the curvature of the Earth, so it is not suitable for long real-world geographic distances, where a great-circle or route distance is needed. Slope is only defined for 2D points and is undefined for a vertical line (where x₂ = x₁).
Frequently asked questions
Enter the x and y coordinates of both points. The calculator gives the straight-line distance, the midpoint and (in 2D) the slope, with the full working shown.
Use the distance formula: d = √((x₂ − x₁)² + (y₂ − y₁)²). For 3D points, add (z₂ − z₁)² inside the square root. This is the Euclidean distance — the length of the straight line between the points.
Yes. Switch on 3D mode and enter a z-coordinate for each point. The distance then includes the depth difference as well as the horizontal and vertical differences.
The midpoint is the average of each coordinate: ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2). It is the point exactly halfway between the two points.
No. This gives the straight-line distance, not a road, walking or driving distance. For travel distances, use a maps or route planner.
