How to Calculate the Slope of a Line

Slope is one of the most fundamental concepts in algebra and geometry. It measures the steepness and direction of a line, and it appears in everything from graphing equations to understanding rates of change in data science and physics.

Slope is defined as "rise over run"—how much a line goes up (or down) for every unit it moves to the right.

The Slope Formula

Given two points (x₁, y₁) and (x₂, y₂) on a line:

m = (y₂ − y₁) / (x₂ − x₁)

Where m is the slope.

Step-by-Step Example

Find the slope of the line passing through (2, 3) and (6, 11).

  1. Identify your points: (x₁, y₁) = (2, 3) and (x₂, y₂) = (6, 11)
  2. Calculate rise: y₂ − y₁ = 11 − 3 = 8
  3. Calculate run: x₂ − x₁ = 6 − 2 = 4
  4. Divide: m = 8 ÷ 4 = 2

The slope is 2, meaning for every 1 unit you move right, the line rises 2 units.

Interpreting Slope

Slope ValueMeaning
m > 0Line goes up left to right (positive slope)
m < 0Line goes down left to right (negative slope)
m = 0Horizontal line (no rise)
UndefinedVertical line (no run, x₁ = x₂)
m = 145° angle
m > 1Steeper than 45°

Real-World Applications

Slope appears in countless real-world scenarios:

  • Road grades: A 6% grade means 6 feet of rise for every 100 feet of run (slope = 0.06)
  • Roof pitch: A 4/12 pitch means 4 inches of rise for every 12 inches of horizontal run
  • Data analysis: In linear regression, slope tells you how much Y changes per unit of X
  • Physics: Velocity is the slope of a position-time graph

Special Cases

If x₁ = x₂ (both points have the same x-coordinate), the line is vertical, and the slope is undefined—you can't divide by zero.

If y₁ = y₂, the slope is 0 and the line is perfectly horizontal.

Use our slope calculator to find the slope between any two points instantly.