Calculators

Slope Calculator

Find the slope of a line through two points, plus the line equation. Shows rise over run and the steps.

Slope Calculator

run 2 rise 4
Slope: 2 · Line: y = 2x − 1 (y2 − y1) / (x2 − x1) = (5 − 1) / (3 − 1) = 4 / 2 = 2.

What Slope Means

Slope measures how steep a line is - how much it climbs for every step you take to the right. People call it “rise over run”: the rise is how far the line goes up, and the run is how far it goes across.

m=riserun=y2y1x2x1m = \frac{\text{rise}}{\text{run}} = \frac{y_2 - y_1}{x_2 - x_1}

A bigger number means a steeper line. A positive slope climbs from left to right, a negative slope falls, a zero slope is flat, and a straight-up vertical line has no slope at all - its run is zero, and you cannot divide by zero. The graph by the calculator plots your two points and draws the rise and run as a little right triangle, so you can see exactly where the number comes from.

The Formula

m=y2y1x2x1=riserunb=y1mx1m = \frac{y_2 - y_1}{x_2 - x_1} = \frac{\text{rise}}{\text{run}} \qquad b = y_1 - m x_1

How to Use It

  1. Enter the coordinates of point 1 (x1, y1) and point 2 (x2, y2).
  2. Read the slope and the line equation.

Worked Examples

Point 1Point 2SlopeLine
(1, 1)(3, 5)2y = 2x − 1
(0, 0)(4, 2)0.5y = 0.5x
(2, 5)(6, 5)0y = 5
(3, 1)(3, 7)undefinedvertical line

FAQ

How do you calculate slope?

Divide the rise by the run: y2y1x2x1\frac{y_2 - y_1}{x_2 - x_1}. For (1, 1) and (3, 5): 42=2\frac{4}{2} = 2.

What does a negative slope mean?

The line goes down from left to right. A positive slope goes up.

Why is the slope of a vertical line undefined?

The run (x2 − x1) is zero, and dividing by zero is undefined. A horizontal line has a slope of 0 instead, because the rise is zero.