Slope Calculator

Calculate the slope and intercept from two points on a line.

Enter values to calculate.

Enter two points

Enter (x1, y1) and (x2, y2). The calculator reports the slope and y-intercept of the line through the points. The x values must differ for a finite slope.

Formula

Slope m equals (y2 − y1) divided by (x2 − x1). After finding m, use b = y1 − mx1 to write the line as y = mx + b. A vertical line has an undefined slope and cannot be written in this slope-intercept form.

Worked example

The points (1, 2) and (5, 10) produce a slope of 2 and an intercept of 0, so the line is y = 2x.

Frequently asked questions

Frequently Asked Questions About Online Calculators

What if the x values are equal?

The line is vertical and its slope is undefined.

Can the slope be negative?

Yes. A negative slope means y decreases as x increases.

Does point order matter?

No, if both points are entered correctly; reversing both differences gives the same slope.

Instant results No signup required Standard formulas Free to use