Distance & Midpoint Calculator

Distance, midpoint, slope and line equation. Enter the values you know and the rest are worked out, with the steps shown.

-5-4-3-2-11234567-2-11234567ΔxΔydP₁(-2, 1)P₂(4, 5)

Loading calculator…

About the distance & midpoint calculator

Enter two points to get the distance between them, the midpoint, the slope and the equation of the line through them. Drag the points on the grid to explore.

It also works in reverse: give a start point plus a distance and direction angle and it finds the end point; give one point and the midpoint and it finds the other.

Formulas

Distanced = √((x₂ − x₁)² + (y₂ − y₁)²)
MidpointM = ((x₁ + x₂)/2, (y₁ + y₂)/2)
Slopem = (y₂ − y₁)/(x₂ − x₁)
Liney = mx + b, b = y₁ − m·x₁

Frequently asked questions

What is the distance formula?

d = √((x₂ − x₁)² + (y₂ − y₁)²), the Pythagorean theorem applied to the horizontal and vertical differences.

How do I find the midpoint?

Average the coordinates: ((x₁ + x₂)/2, (y₁ + y₂)/2).