Slope Calculator

Enter two points to find the slope (rise over run), the angle of incline, the slope-intercept equation y = mx + b, the distance between the points, and their midpoint.

P₁ ( , ) P₂ ( , )
Slope (m)
Equation
Angle of incline
Distance
Midpoint
Percent grade

How to Find the Slope of a Line

Enter the coordinates of two points to see the slope and the full working.

1

Find the rise and the run

Subtract to get the rise (the change in y, y₂ − y₁) and the run (the change in x, x₂ − x₁) between your two points.

2

Divide rise by run

The slope is m = rise ÷ run. A positive result rises left to right, a negative one falls, zero is horizontal, and a run of zero makes the slope undefined (a vertical line).

3

Build the equation of the line

Using the slope and one point, the calculator finds the intercept b = y₁ − m·x₁ and writes the line as y = mx + b. Need the halfway point or the length? The Midpoint Calculator and the Pythagorean Theorem Calculator cover those directly.

Frequently Asked Questions

How do you find the slope between two points?
The slope measures how steep a line is: it is the change in y divided by the change in x between two points. Take your two points (x₁, y₁) and (x₂, y₂), subtract to get the rise (y₂ − y₁) and the run (x₂ − x₁), then divide rise by run. For example, from (1, 2) to (3, 6) the rise is 4 and the run is 2, so the slope is 4 ÷ 2 = 2. This calculator does the subtraction and division for you and shows each step.
What is the slope formula?
The slope formula is m = (y₂ − y₁) / (x₂ − x₁), often remembered as "rise over run". The numerator is the vertical change between the two points and the denominator is the horizontal change. As long as the two x-values differ, this ratio gives a single number m that describes the line's steepness and direction.
What does a negative, zero, or undefined slope mean?
A positive slope means the line rises from left to right, and a negative slope means it falls. A slope of zero means the line is perfectly horizontal — the y-values never change. An undefined slope happens when the run is zero (the two points share an x-value): the line is vertical, and dividing by zero is undefined, so vertical lines have no numeric slope and are written as x = a instead.
How do you write the equation of a line from its slope?
Once you know the slope m and one point, use slope-intercept form y = mx + b. Find b, the y-intercept, by rearranging: b = y₁ − m·x₁. Substitute the slope and that intercept back in to get the full equation. This calculator computes the slope, the intercept, and the finished y = mx + b equation automatically from the two points you enter.