Slope Calculator

Slope Calculator

Find slope, angle, and equation from two points.

Last updated: June 2026 | By Patchworkr Team

Points

Point 1 x is required.

Slope is rise divided by run. Vertical lines have undefined slope because the run is zero.
Results
Enter two points to calculate the slope.

What is Slope?

Slope is the ratio of vertical change to horizontal change between two distinct points. It tells us how steep a line is and whether it rises or falls left to right.

The formula is m = (y2 - y1) / (x2 - x1). If the x-values are equal, the line is vertical and the slope is undefined.

Formula

Rise
rise = y2 - y1
Run
run = x2 - x1
Slope
m = rise / run

Example

For points (2, 3) and (5, 9), rise = 6 and run = 3.

m = 6 / 3 = 2
b = 3 - 2(2) = -1
y = 2x - 1
angle = arctan(2) ≈ 63.43°

FAQ

What if the points are identical?

There is no unique slope because the line is not defined from one point.

Can slope be negative?

Yes. A negative slope means the line falls from left to right.

What if x1 equals x2?

The line is vertical and the slope is undefined.

Does blank input count as zero?

No. Blank input is treated as missing, not zero.

Related Tools