Slope Calculator — Graph, Steps & Practice
Calculate slope and line equation from two points with a draggable graph, worked steps, examples and a practice question.
Point coordinates
Use positive, negative or decimal coordinates.
Explore the graph
Drag the blue or orange point, or edit coordinates with your keyboard. The plot rescales to fit both points.
Try different cases
How is slope calculated?
m = (y₂ − y₁) / (x₂ − x₁)For (1, 2) and (3, 8), the rise is 6 and the run is 2, so the slope is 3. Subtract coordinates in the same order in the numerator and denominator.
A positive slope rises and a negative slope falls from left to right. Horizontal lines have zero slope; vertical lines have undefined slope. Identical points do not define a unique line.
For a nonvertical line, y = mx + b where b = y₁ − mx₁. The displayed signed angle is arctan(m), between −90° and 90°.
Check your understanding
A = (2, 3), B = (4, 7)