This distance formula calculator finds the distance between any two points on the coordinate plane — and throws in the midpoint and slope of the segment joining them, the trio that travels together.
The Distance Formula Is Pythagoras in a Coat
Plot the two points, draw the segment between them, and complete a right triangle with horizontal and vertical legs. The legs are |Δx| and |Δy|; the segment is the hypotenuse. So: distance = √((x₂−x₁)² + (y₂−y₁)²) — literally the Pythagorean theorem applied to coordinate differences (the engine our Midpoint and Slope calculators pick their own pieces from). Part of our Math Calculators collection.
Worked Example (Verified)
Points (1, 2) and (4, 6):
- Δx = 4 − 1 = 3; Δy = 6 − 2 = 4
- Distance = √(3² + 4²) = √25 = 5 — the immortal 3-4-5 triangle, wearing coordinates
- Midpoint: (2.5, 4); slope: 4/3 ≈ 1.333
Using It Well
- Order does not matter for distance — squaring erases the sign of each difference. (For slope, keep the same order top and bottom.)
- Units stay consistent: coordinates in miles give miles, in pixels give pixels — the formula is unit-agnostic, which is why it serves map work, game development and CNC toolpaths alike.
- 3D extension: add the third difference under the same root — √((Δx)² + (Δy)² + (Δz)²) — used for drone paths, warehouse robotics and molecular geometry.
- Straight-line (“as the crow flies”) distance is a floor on real travel: roads and terrain only add. Our MPG Calculator handles the road-bound costs; this page handles the geometry.
Related Tools
- Midpoint Calculator
- Slope Calculator
- Math Calculators — the full collection
Frequently Asked Questions
What is the distance formula?
d = √((x₂ − x₁)² + (y₂ − y₁)²). It is the Pythagorean theorem applied to the horizontal and vertical separations of the two points.
What is the distance between (1, 2) and (4, 6)?
5 units — the differences are 3 and 4, and √(9 + 16) = 5.
Does the order of the points matter?
Not for distance (squared differences are positive either way). The midpoint is also symmetric; only slope’s sign depends on consistency, and it is the same slope line read either direction.
What if the two points share an x or a y?
Then the segment is vertical or horizontal and the distance is just the absolute difference of the other coordinate — the formula handles it automatically (one term goes to zero), though the slope of a vertical line is undefined.
How do I find the midpoint too?
Average the coordinates: ((x₁+x₂)/2, (y₁+y₂)/2). Shown on this page and in depth at the Midpoint Calculator.
Is this distance formula calculator free?
Yes — free, instant, no sign-up.