Distance Between Two Points Calculator
The distance between two points calculator applies the distance formula, d = √((x₂ − x₁)² + (y₂ − y₁)²). From (−2, 3) to (4, −5) the distance is 10, and the tool also gives the midpoint and the slope.
Sources: OpenStax College Algebra 2e, Wikipedia Updated
Calculate the distance between two points, find their midpoint, and determine the slope of the line connecting them.
Point 1 coordinates
Point 2 coordinates
Distance, midpoint and slope
Distance:
Midpoint:
Slope:
Distance example: from (3, 4) to (7, 10)
GPS Navigation: If you're at position (3, 4) and need to reach (7, 10):
- Distance = 7.21 units (could be miles or kilometers)
- Midpoint (5, 7) = halfway point for a rest stop
- Slope = 1.5 = for every 1 unit east, you travel 1.5 units north
Try these coordinates above to see the calculations!
Distance, midpoint and slope from two points
From two coordinate pairs the tool works out three things: the straight-line distance by the Pythagorean theorem, the midpoint as the average of each coordinate, and the slope of the line joining them. These are the formulas in OpenStax College Algebra.
The midpoint calculator and the slope calculator each show one of these with its own steps.
How to find the distance between two points
Take point 1 at (−2, 3) and point 2 at (4, −5).
- Find the horizontal gap: Δx = 4 − (−2) = 6.
- Find the vertical gap: Δy = −5 − 3 = −8.
- Square, add and take the square root: d = √(6² + (−8)²) = √(36 + 64) = √100 = 10.
This is the Euclidean distance, here a 3-4-5 right triangle doubled to 6-8-10, which is why the answer is a whole number. The midpoint is ((−2 + 4) ÷ 2, (3 + (−5)) ÷ 2) = (1, −1), and the slope is −8 ÷ 6 = −1.3333: the line drops about 1.33 units for each unit to the right.
The square root step is where most answers are not whole numbers; the square root calculator shows it with steps.
Vertical and horizontal lines
If both points have the same x-coordinate, the slope divides by zero. The tool reports "Undefined (vertical line)" instead of an error. If both have the same y-coordinate, the slope is 0 and the tool labels it "0 (horizontal line)".
Where the distance formula is used
Distance, midpoint and slope together cover most coordinate geometry proofs and the equation of a line through two points. The same idea measures waypoints on a flat map grid, but not over long distances on the Earth's curved surface.
The legs and the hypotenuse are the same as in the right triangle calculator. For a curve instead of a straight line, the average rate of change calculator gives the slope between two of its points.
Input rules
All four coordinate boxes need a number. Empty boxes are not treated as zero. More coordinate tools are on the algebra calculators page.
Distance Between Two Points Calculator: FAQ
Is the distance formula the Pythagorean theorem?
Yes. The horizontal and vertical gaps are the two legs of a right triangle and the distance is its hypotenuse: d² = 6² + 8² = 100, so d = 10.
Does the order of the points matter?
No. The gaps are squared, so (x₂ − x₁)² and (x₁ − x₂)² are the same and the distance comes out equal either way.
Can the distance be negative?
No. It is a square root of a sum of squares, so it is 0 when the points are the same and positive otherwise.
Sources
- OpenStax College Algebra 2e, 2.1 The Rectangular Coordinate Systems and Graphs — the distance formula and the midpoint formula (checked October 16, 2026)
- Wikipedia: Euclidean distance — straight-line distance in the plane from the Pythagorean theorem (checked October 16, 2026)