How to use the distance and midpoint calculator
- Type the coordinates of the two points, (x₁, y₁) and (x₂, y₂). Negatives and decimals are allowed.
- Press Calculate. The distance and the midpoint appear at the top.
- Read the numbered steps for each answer and check the graph, which shows the segment as the hypotenuse of a right triangle.
The distance formula
The distance between two points on the coordinate plane is
d = √((x₂ − x₁)² + (y₂ − y₁)²)
This is the Pythagorean theorem in disguise. Draw a horizontal line from one point and a vertical line from the other and you get a right triangle. Its legs are the horizontal change Δx = x₂ − x₁ and the vertical change Δy = y₂ − y₁, and the distance you want is the hypotenuse, so d² = (Δx)² + (Δy)². You can explore that triangle on its own with the Pythagorean theorem calculator.
Example: the distance between (1, 2) and (4, 6).
Δx = 4 − 1 = 3 and Δy = 6 − 2 = 4.
d² = 3² + 4² = 9 + 16 = 25.
d = √25 = 5.
Because the differences are squared, their signs do not matter — the distance from A to B is the same as from B to A, and a distance is never negative.
Exact answers: simplifying the radical
Most of the time d² is not a perfect square. Then the exact answer is a square root, simplified by pulling out any perfect-square factor.
Example: the distance between (−1, 2) and (5, −1).
Δx = 6 and Δy = −3, so d² = 36 + 9 = 45.
45 = 9 × 5, so d = √45 = √9 · √5 = 3√5 ≈ 6.708204.
Teachers usually want the exact form 3√5; the decimal is useful for measuring. The square root calculator shows how to simplify any radical.
The midpoint formula
The midpoint is the point exactly halfway between two points. Its coordinates are the averages of the endpoints’ coordinates:
M = ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2)
Example: the midpoint of (1, 2) and (4, 6) is ((1 + 4) ÷ 2, (2 + 6) ÷ 2) = (2.5, 4).
Notice that you add the coordinates for the midpoint but subtract them for the distance — mixing these up is the most common mistake.
Finding a missing endpoint
If you know one endpoint A and the midpoint M, the other endpoint is B = (2·Mx − Ax, 2·My − Ay). For A = (1, 2) and M = (2.5, 4), B = (5 − 1, 8 − 2) = (4, 6).
Where these formulas are used
- Geometry proofs: show that a triangle is isosceles (two equal side lengths) or that diagonals bisect each other (same midpoint).
- Circles: the radius is the distance from the centre to a point on the circle, and the centre is the midpoint of a diameter.
- Maps and games: straight-line distance between two grid positions.
- Lines: a perpendicular bisector passes through the midpoint. Find the slope of the segment with the slope calculator.
Frequently asked questions
What is the distance formula?
For points (x1, y1) and (x2, y2), d = √((x2 − x1)² + (y2 − y1)²). Subtract the coordinates, square both differences, add them and take the square root.
What is the midpoint formula?
The midpoint is ((x1 + x2) ÷ 2, (y1 + y2) ÷ 2): average the two x-coordinates and average the two y-coordinates.
How is the distance formula related to the Pythagorean theorem?
The horizontal and vertical changes between the points are the legs of a right triangle and the distance is its hypotenuse, so d² = (Δx)² + (Δy)², which is a² + b² = c².
Does it matter which point is first?
No. The differences are squared in the distance formula and the coordinates are added in the midpoint formula, so swapping the points gives the same answers.
How do I write the distance in simplest radical form?
Factor the number under the square root and take out any perfect squares. For example √45 = √(9 × 5) = 3√5.
Can the distance between two points be negative?
No. Distance is always zero or positive. It is zero only when the two points are the same.