Slope Calculator
Find the slope of a line from two points, plus the y-intercept, the equation y = mx + b, the angle, and the distance between the points.
Point 1
Point 2
Slope (m)
2
rise ÷ run = 6 ÷ 3
Equation of the line
y = 2x + 0
y-intercept (b)
0
Angle from horizontal
63.434949°
Distance between points
6.708204
Slope m = (y₂ − y₁) ÷ (x₂ − x₁). The y-intercept comes from b = y₁ − m·x₁, giving the line y = mx + b. The distance between the points is √((x₂ − x₁)² + (y₂ − y₁)²).
Frequently Asked Questions
How do I find the slope of a line from two points?
Slope is rise over run: m = (y₂ − y₁) ÷ (x₂ − x₁). Subtract the y-coordinates and divide by the difference of the x-coordinates. For the points (1, 2) and (4, 8), m = (8 − 2) ÷ (4 − 1) = 6 ÷ 3 = 2.
How do I find the equation of a line through two points?
First find the slope m, then use the point-slope relationship to get the y-intercept: b = y₁ − m·x₁. The line is y = mx + b. This calculator outputs the full equation in slope-intercept form automatically.
What is the y-intercept?
The y-intercept is the y-value where the line crosses the y-axis (where x = 0). In the equation y = mx + b, it is the constant b. The calculator computes it from the slope and one of your points.
Why is the slope of a vertical line undefined?
A vertical line has two points with the same x-value, so the run (x₂ − x₁) is zero. Dividing the rise by zero is undefined, which is why vertical lines have no slope. The calculator detects this and reports the line as x = constant.
How do I find the distance between two points?
Use the distance formula, which comes from the Pythagorean theorem: distance = √((x₂ − x₁)² + (y₂ − y₁)²). The calculator shows this distance along with the slope and equation.