Distance Between Points Calculator
Calculate the distance between two points on a 2D plane, with the midpoint.
By Konstantin Iakovlev · Updated December 2026 · Source: Khan Academy — Distance formula review · Methodology
Distance
5.0000
Midpoint
(2.50, 4.00)
Calculation
| dx | 3.00 |
| dy | 4.00 |
| Distance | 5.0000 |
Use the Distance Between Points Calculator above to calculate your results. Enter your values and see instant results — all calculations run in your browser.
Disclaimer: This calculator is for informational purposes only. Results are estimates based on the information you provide and the assumptions described on this page.
You might also need
How It Works
Measuring the straight-line gap between two points is a routine need across navigation, engineering, and urban planning. This calculator works on a flat plane: enter two points (x1, y1) and (x2, y2), and it returns the distance between them, the midpoint, and the horizontal and vertical differences (dx and dy).
The method is the Pythagorean theorem, carried into more than one dimension. For two points in 2D, (x1, y1) and (x2, y2), the distance is D = sqrt((x2 - x1)^2 + (y2 - y1)^2). The calculator has no z inputs; for points in 3D space the same idea extends to D = sqrt((x2 - x1)^2 + (y2 - y1)^2 + (z2 - z1)^2), so square the calculator's 2D distance, add (z2 - z1)^2 and take the square root. The midpoint is ((x1 + x2)/2, (y1 + y2)/2).
Keep every coordinate in the same unit; pairing meters with kilometers will throw the answer off entirely. The classic slips in doing this by hand are forgetting to square each difference before adding them, or skipping the final square root, both of which the calculator handles for you. What it can't catch is a mistyped coordinate, so give your inputs a second look before relying on the result.
Example: Distance Between Two Delivery Hubs
- 1 On a city grid measured in kilometers, one delivery hub sits at (15, 20) and another at (40, 5). Enter x1 = 15, y1 = 20, x2 = 40, y2 = 5.
- 2 dx = 40 - 15 = 25 and dy = 5 - 20 = -15, so D = sqrt(25^2 + (-15)^2) = sqrt(625 + 225) = sqrt(850).
- 3 The calculator shows a distance of 29.1548 km and a midpoint of (27.50, 12.50).
- 4 Height barely matters at this scale: if one hub sits 0.1 km higher than the other, the 3D distance is sqrt(850 + 0.1^2) = sqrt(850.01) = 29.1549 km, about 17 cm more.
Source: Khan Academy — Distance formula review · Last updated: December 2026