Slope of a line

Give two points, or the equation ax + by = c: we find the slope, the equation y = mx + b and the angle.

Slope of a line

I know

Result

2Slope m

Equation
y = 2x
y-intercept
0
Crosses the x-axis at
0
Angle with the x-axis
63.43°

Line graph

y = 2xAB

How it is calculated

  1. Slope m = (y2 − y1) ÷ (x2 − x1) (rise over run).
  2. y-intercept = y1 − m × x1.
  3. From ax + by = c: m = −a ÷ b and the intercept is c ÷ b.
  4. If x1 = x2 (or b = 0), the line is vertical: it has no slope.

Example

Points (1, 2) and (3, 6): m = (6 − 2) ÷ (3 − 1) = 2, equation y = 2x.

Good to know

  • Two identical points do not define a line.
  • The angle is in degrees, between −90° and 90°.

Frequently asked questions

What is this tool used for?

Give two points, or the equation ax + by = c: we find the slope, the equation y = mx + b and the angle.

How is the result calculated?

Slope m = (y2 − y1) ÷ (x2 − x1) (rise over run).

What should I check before using the result?

Two identical points do not define a line.

Updated October 10, 2026

Indicative result. For an important decision, check with a professional.