Slope Calculator

Calculate slope (m) given two points (x1,y1) and (x2,y2).

Enter coordinates of two points.

What This Calculator Does

Slope describes how steep a line is and which direction it runs — how much y changes for every step along x. Give this tool two points on a line and it calculates that slope directly, including correctly flagging the one case where slope isn't a number at all: a perfectly vertical line.

How to Use It

Enter the X and Y coordinates for Point 1 and Point 2, and the result reports the slope (m) between them. This calculator returns the slope value only — it doesn't construct a slope-intercept (y = mx + b) or point-slope equation from your two points, so if you need the full line equation, you'll need to build it yourself from the slope and one of your points.

The Formula

Slope = (y₂ − y₁) ÷ (x₂ − x₁) — the change in y divided by the change in x, often described as "rise over run." When x₁ and x₂ are equal, that division would be by zero, which is mathematically undefined; rather than throwing an error, the calculator recognizes this case and reports it directly as a vertical line with undefined slope, since that's the correct mathematical description of what's happening geometrically.

A Worked Example

Between (1, 2) and (3, 6): slope = (6 − 2) ÷ (3 − 1) = 4 ÷ 2 = 2 — for every 1 unit moved right, the line rises 2 units. A line can just as easily fall: between (0, 10) and (5, 0), slope = (0 − 10) ÷ (5 − 0) = −10 ÷ 5 = −2, a negative slope showing the line drops as x increases. And between (2, 2) and (2, 9), where x doesn't change at all, the calculator returns "Vertical line (undefined slope)" instead of a number, since (9 − 2) ÷ (2 − 2) would require dividing by zero.

FAQ

How is slope calculated?
Slope = (y₂ − y₁) ÷ (x₂ − x₁). Enter your two points and the calculator finds the slope.
Does it show the line equation, not just the slope?
No, this calculator returns the slope value only — it does not display a slope-intercept or point-slope equation.