Do Utility
Menu

Slope Calculator

Find the slope between two points, the y-intercept and the line equation in slope-intercept form. Also shows the angle, percent grade and distance.

Point 1

Point 1

Point 2

Point 2

Slope (m)

Fill in the fields to see your result.

  • Nothing you type is stored or sent
  • Results update as you type
  • Free, no limits or sign-up

How it works

Slope measures how steep a line is: how much it rises (or falls) for every step to the right. Two points are enough to describe the whole line.

  1. Type the x and y of the first point.
  2. Type the x and y of the second point.
  3. Read the slope, the equation in y = mx + b form, the angle, the percent grade and the distance — with a small graph of your line.

The formulas

Formula

m = (y₂ − y₁) ÷ (x₂ − x₁) b = y₁ − m × x₁

Angle = arctan(m), percent grade = m × 100, and distance = √((x₂ − x₁)² + (y₂ − y₁)²).

Worked examples

Example

A rising line

Points (1, 2) and (3, 6).

m = (6 − 2) ÷ (3 − 1) = 2, b = 2 − 2 × 1 = 0, so y = 2x. Angle 63.43°, distance 4.47.

Example

A falling line

Points (0, 5) and (2, 1).

m = (1 − 5) ÷ (2 − 0) = −2, b = 5, so y = −2x + 5.

What the slope tells you

Slope Line Example
Positive Rises left to right m = 2
Negative Falls left to right m = −2
Zero Horizontal y = 3
Undefined Vertical x = 2

Frequently asked questions

Quick answers to the questions people ask most.

How do I find the slope between two points?

Subtract the y-values and divide by the difference of the x-values — rise over run. For (1, 2) and (3, 6) that is (6 − 2) ÷ (3 − 1) = 2.

How do I find b, the y-intercept?

Once you have the slope m, plug one point into y = mx + b and solve for b. With m = 2 and the point (1, 2), 2 = 2 × 1 + b, so b = 0.

What does an undefined slope mean?

If both points have the same x-value, the line is vertical. Run is zero and you can't divide by zero, so the slope is undefined and the equation is x = that value.

How do I turn a slope into a percent grade or an angle?

Percent grade is the slope × 100 — a slope of 0.08 is an 8% grade. The angle is the arctangent of the slope; a slope of 1 is 45°.

What is the slope of a horizontal line?

Zero. Both points have the same y-value, so there is no rise, and the equation is simply y = that value.