Slope Calculator
Find the slope, distance, and equation of the line through two points.
Enter the coordinates of two points to find the slope, line equation, distance, midpoint, and angle of incline.
Point 1 (x₁, y₁)
Point 2 (x₂, y₂)
Slope (m)
Line Equation
Distance
Midpoint
Angle of Incline
Δx (run)
Δy (rise)
The Slope Formula
The slope of a line measures how steep it is. It is calculated as the ratio of the vertical change (rise) to the horizontal change (run) between two points on the line:
m = rise / run = (y₂ − y₁) / (x₂ − x₁)
For example, for the points (1, 2) and (4, 8), the slope is (8 − 2) / (4 − 1) = 6 / 3 = 2. This means the line rises 2 units for every 1 unit it moves to the right.
Positive, Negative, Zero and Undefined Slopes
- Positive slope: the line rises from left to right (m > 0).
- Negative slope: the line falls from left to right (m < 0).
- Zero slope: the line is horizontal (m = 0), because y₂ = y₁.
- Undefined slope: the line is vertical, because x₂ = x₁ makes the run zero, so division is impossible.
Point-Slope vs Slope-Intercept Form
Once you know the slope, there are two common ways to write the line equation:
- Slope-intercept form: y = mx + b, where b is the y-intercept (b = y₁ − m·x₁).
- Point-slope form: y − y₁ = m(x − x₁), useful when you know one point and the slope.