Slope Calculator: Two Points, y = mx + b
This slope calculator finds the slope of a line from two points using rise over run, then gives the equation in y = mx + b form, the percent grade and the angle. It works for algebra homework and for real jobs like a ramp, a driveway or a drainage run measured in feet.
Slope Calculator
-
-
-
-
This slope calculator finds the slope of the line through two points, along with the y-intercept, the line's equation in slope-intercept form and the distance between the points. A graph shows the line and both points.
How to use the Slope Calculator
- Enter the first point as x1 and y1.
- Enter the second point as x2 and y2. The two points must be different.
- Press Calculate Slope.
- Read Slope (m), Y-intercept (b), the Line equation y = mx + b and the Distance between points. A vertical line is reported as an undefined slope with an equation of the form x = constant.
Formula
b = y₁ − m × x₁
y = mx + b d = √((x₂ − x₁)² + (y₂ − y₁)²)
Slope is rise over run: how much y changes for each one-unit step in x. Positive slopes rise to the right, negative slopes fall, and a horizontal line has a slope of 0.
Example
Points (2, 3) and (6, 11): m = (11 − 3) ÷ (6 − 2) = 8 ÷ 4 = 2. b = 3 − 2 × 2 = −1, so the line is y = 2x − 1. The distance between the points is √(16 + 64) = √80 ≈ 8.944272.
Full guide with worked examples: How to Find the Slope of a Line (With Examples)
Frequently asked questions
What does slope mean?
It measures how steep a line is: the change in y divided by the change in x. A slope of 2 means the line rises 2 units for every 1 unit to the right.
What is an undefined slope?
A vertical line has the same x for every point, so the run is 0, and dividing by zero makes the slope undefined. Its equation is x = a constant, such as x = 4.
How do I find the y-intercept from two points?
Find the slope first, then plug one point into b = y − mx. With m = 2 and the point (2, 3), b = 3 − 4 = −1.
How do I convert slope to a percent grade?
Multiply the slope by 100. A slope of 0.08 is an 8% grade, meaning a rise of 8 units over a run of 100.
For 3D points or Manhattan distance, use the Distance Calculator.
Slope from two points and rise over run
How to use it
- Enter the first point (x1, y1) and the second point (x2, y2).
- Read the slope m, which is the change in y divided by the change in x.
- Check the line equation, percent grade and angle below the result.
- Use the graph to see whether the line rises or falls.
More questions
What is the slope formula?
Slope m = (y2 − y1) ÷ (x2 − x1), the rise divided by the run.
What is a 2% slope?
A rise of 2 feet for every 100 feet of run, or about 1/4 inch per foot.
What does a negative slope mean?
The line goes down as you move to the right.
Related tools: How to Find the Slope of a Line (With Examples), Graphing Calculator, Right Triangle Calculator.