Kulkalotar
Math & Conversion

Slope of a Line Calculator (y = mx + b)

Find the slope, y-intercept, and equation of the line through two points.

Slope (m)
2.000
y-intercept (b)
-1.000
Equation
y = 2.000x − 1.000

What this calculates

Two points define a line. From them you can derive slope (steepness), y-intercept (where the line crosses the y-axis), and the full slope-intercept equation y = mx + b. Vertical lines (x₁ = x₂) have undefined slope.

Formula & how it works

Slope m = (y₂ − y₁) / (x₂ − x₁). y-intercept b = y₁ − m × x₁. Equation: y = mx + b.

Worked example

Points (2, 3) and (6, 11). m = (11−3)/(6−2) = 2. b = 3 − 2·2 = −1. Equation: y = 2x − 1.

Frequently asked questions

What if x₁ = x₂?

Vertical line — slope undefined. Equation is x = x₁.

Negative slope?

Line goes down left-to-right. Magnitude is the steepness.

Parallel & perpendicular?

Parallel: same slope, different intercept. Perpendicular: slopes multiply to −1 (e.g., 2 and −½).

Last updated:

Related calculators