Bills, Percentages & Everyday Math · Math
How to Calculate Slope from Two Points
Subtract the y values and x values separately, divide rise by run, and treat a zero run as an undefined vertical slope.
Slope measures vertical change relative to horizontal change. The Slope Calculator accepts two points or a rise and run and also reports the angle in degrees.
Use the slope formula
For points (x₁, y₁) and (x₂, y₂), calculate:
rise = y₂ − y₁
run = x₂ − x₁
slope = rise ÷ run
Both axes must use consistent units. A negative slope falls as x increases; a zero slope is horizontal.
Work an example
For (1, 2) and (3, 6), the rise is 6 − 2 = 4 and the run is 3 − 1 = 2. The slope is 4 ÷ 2 = 2. If you enter rise 6 and run 12, the slope is 0.5 and the angle is about 26.565°.
Handle a vertical line
When x₂ − x₁ = 0, the line is vertical and division by zero is undefined. Report an undefined slope instead of treating it as an infinite decimal. This mathematical result is not a roof pitch, stair compliance check, or structural design conclusion.
FAQs
What does rise over run mean?
Rise is the change in y; run is the change in x. Divide rise by run after subtracting the coordinates in the same order.
Can slope be negative?
Yes. A negative slope means y decreases as x increases.
What is the slope of a vertical line?
It is undefined because the run is zero.