Slope Calculator

Enter the coordinates of two points:

The formula

Slope (m) is the change in y divided by the change in x between two points: m = (y2 − y1) ÷ (x2 − x1). It describes how steep a line is and which direction it runs — positive slopes rise left to right, negative slopes fall.

Worked example

Take the points (1, 2) and (4, 11). Slope = (11 − 2) ÷ (4 − 1) = 9 ÷ 3 = 3. The calculator also derives the y-intercept (b) from y = mx + b: 2 = 3(1) + b, so b = −1, giving the full line equation y = 3x − 1. Enter those four coordinates and the tool returns exactly that.

Reading the slope value

A slope of 3 means y increases by 3 for every 1-unit increase in x — a steep, fast-rising line. A slope of 0.5 rises more gradually. A slope of 0 is a flat horizontal line. A slope of −2 falls as x increases.

Vertical lines

When both points share the same x-value (x1 = x2), the denominator becomes zero and slope is mathematically undefined — the line is vertical. The calculator detects this case and reports "undefined" instead of dividing by zero, which would otherwise return Infinity or NaN.