Slope & Distance Calculator

Slope, distance and midpoint between two (x, y) points.

Slope
Distance
Midpoint
Line equation
How this works
Slope m = (y₂ − y₁) ÷ (x₂ − x₁) Distance d = √((x₂ − x₁)² + (y₂ − y₁)²) Midpoint = ( (x₁+x₂)÷2 , (y₁+y₂)÷2 )
  • A slope of 0 is a horizontal line; a vertical line (x₁ = x₂) has an undefined slope, since division by zero is not possible.
  • Distance is just the Pythagorean theorem applied to the horizontal and vertical gaps between the two points.
  • The line equation is given in slope-intercept form, y = mx + b, where b is found by substituting one point back in.
What does a negative slope mean?

The line falls from left to right — as x increases, y decreases. A positive slope rises left to right; a slope of zero is flat.

Why is the slope "undefined" for some points?

When both points share the same x-coordinate, the line between them is vertical, and slope (change in y over change in x) would require dividing by zero — mathematically undefined, not zero.

How is the midpoint useful?

It is the exact centre point of the line segment joining the two points — the average of their x-coordinates and the average of their y-coordinates.

Keep going
Triangle Calculator Solve a triangle from three sides or two sides and an angle. Quadratic Equation Calculator Roots, discriminant and vertex of ax² + bx + c = 0. Ratio Calculator Simplify a ratio, or solve a proportion for a missing value.