Algebra

Slope & Line Equation

Given two points, this tool computes the slope m = (y₂ − y₁)/(x₂ − x₁), the y-intercept, and the equation of the line in both slope-intercept (y = mx + b) and point-slope forms. Vertical and horizontal lines are detected automatically.

Slope & Line Equation

Slope, intercept and line equation through two points.

Try:
Answery = 3x − 1
  1. PointsP₁(1, 2), P₂(4, 11)
  2. Slopem = (y₂ − y₁)/(x₂ − x₁) = (11 − 2)/(4 − 1) = 3
  3. y-interceptb = y₁ − m·x₁ = 2 − 3·1 = -1
  4. Slope-intercepty = 3x − 1
  5. Point-slopey − 2 = 3(x − 1)

Worked examples

Key terms

Frequently asked questions

How is slope calculated?

Slope is the change in y divided by the change in x: m = (y₂ − y₁)/(x₂ − x₁).

What about a vertical line?

If the two x-values are equal the slope is undefined; the tool returns the vertical line x = constant.

Which line forms are given?

Both the slope-intercept form y = mx + b and the point-slope form y − y₁ = m(x − x₁).