Skip to content
The Calculatorz
Coordinate geometry

Slope and Line Equation Calculator

Find slope, intercepts and the line equation through two Cartesian-coordinate points.

The two points must be distinct. A vertical line has undefined slope and equation x = constant rather than y = mx + b.

Coordinates of two distinct points

Two points

How to use this calculator

Enter two different points. The calculator reports slope-intercept form for nonvertical lines and a constant-x equation for vertical lines.

Formula

Slope m = (y₂ − y₁) ÷ (x₂ − x₁). Intercept b = y₁ − mx₁. Line equation: y = mx + b.

Calculator credits

Calculator developmentJulia Edwards

Editorial supervision

Expert reviewIfrahMSc Mathematics

Published byThe Calculatorz

Last updated

Read how we research, test, review and correct our calculators in our editorial policy.

Frequently asked questions

What does a positive slope mean?

The line rises as x increases. A negative slope means it falls.

Why is vertical slope undefined?

Its change in x is zero, so the slope formula would divide by zero.

Can both points be the same?

No. One point alone does not define a unique line direction.

What do parallel and perpendicular slopes look like?

Parallel lines have equal slopes. Perpendicular lines have slopes that multiply to −1, such as 2 and −1/2.

What is point-slope form?

Point-slope form is y − y₁ = m(x − x₁). It writes a line using its slope and one point, and can be rearranged into y = mx + b.

How do I find the slope from two points?

Divide the change in y by the change in x. For (1, 2) and (4, 11), the slope is (11 − 2) ÷ (4 − 1) = 3, and the line is y = 3x − 1.

References & methodology sources

These sources support the calculator’s formula, definitions, thresholds, units or result interpretation.

  1. Marecek, L., Anthony-Smith, M., & Honeycutt Mathis, A. (2020). Intermediate algebra 2e. OpenStax. View source
  2. Abramson, J. (2021). College algebra 2e. OpenStax. View source
  3. Abramson, J. (2021). Precalculus 2e. OpenStax. View source
  4. International Organization for Standardization. (2019). ISO 80000-2: Quantities and units—Part 2: Mathematics. View source
  5. Stewart, J., Clegg, D. K., & Watson, S. (2021). Calculus: Early transcendentals (9th ed.). Cengage. View source