Skip to content

Mathematics · Algebra

Slope, Distance & Midpoint Calculator — Line Through Two Points

Enter two points to get the slope (as a fraction when possible), the distance between them, the midpoint, the angle of the line, and its equation as y = mx + c and Ax + By = C, with the x- and y-intercepts. Vertical and horizontal lines are handled.

Your inputs

Quick start — try a typical case

Your result Live

Slope (m)

4/3

Rise 8 over run 6 = 1.3333333

Distance
10 — √(6² + 8²)
Midpoint
(5, 7)
Equation
y = 1.3333333x + 0.33333333
Standard Form
4x − 3y = −1
Angle With the x-axis
53.1301°
Intercepts
x-intercept -0.25 · y-intercept 0.33333333
Perpendicular Slope
-0.75

How this is calculated

m = (y₂ − y₁) ÷ (x₂ − x₁) · d = √((x₂ − x₁)² + (y₂ − y₁)²) · midpoint = ((x₁ + x₂)/2, (y₁ + y₂)/2) · y = mx + c, c = y₁ − m·x₁

m
Slope (gradient): rise over run

The slope is how far the line rises for each step to the right: the change in y divided by the change in x. The distance between the points comes from Pythagoras, the midpoint is the average of the coordinates, and putting the slope and one point into y = mx + c gives the line's equation.

Assumptions & sources

  • Points in a flat x–y plane.
  1. 1Mathematics, Classes 9–11 — Circles, Triangles, Trigonometry and Coordinate Geometry — NCERT

Calculator ID MATH-SLOPE-001 · version 1.0.0

Common questions

What's the slope between (2, 3) and (8, 11)?

(11 − 3) ÷ (8 − 2) = 8/6 = 4/3.

What does an undefined slope mean?

The line is vertical — x doesn't change, so you'd divide by zero.

How are perpendicular slopes related?

They multiply to −1: a line of slope 4/3 is perpendicular to one of slope −3/4.