Math & Grades

Slope Calculator

Slope, line equation and angle from two points.

Runs entirely in your browser. Nothing you type is sent to our servers.

About the Slope Calculator

Slope measures how steep a line is: how far it rises for every step to the right. It shows up in algebra, in physics graphs of distance against time, and in real life as the grade of a road or a wheelchair ramp.

Enter two points and this calculator gives the slope as a simplified fraction and a decimal, then builds the equation of the line in slope-intercept and point-slope form. It also handles the special cases: a horizontal line has slope 0 and a vertical line has an undefined slope.

How to use it

  1. Enter the coordinates of the first point (x₁, y₁).
  2. Enter the coordinates of the second point (x₂, y₂). The order of the points does not change the slope.
  3. Read the slope, then follow the steps for rise, run, y-intercept and equation.
  4. Use the graph to check that the line passes through both points.

The formula

m = (y₂ − y₁) ÷ (x₂ − x₁) = rise ÷ run

The y-intercept is b = y₁ − m × x₁, which gives the line y = mx + b. The angle with the x-axis is arctan(m), and the grade as a percent is m × 100.

Worked examples

A rising line

Points (2, 3) and (6, 11): rise = 8, run = 4, m = 8 ÷ 4 = 2. b = 3 − 2 × 2 = −1, so the line is y = 2x − 1.

A negative fraction

Points (−1, 4) and (3, 1): rise = −3, run = 4, m = −3/4. b = 4 − (−3/4)(−1) = 13/4, so y = −(3/4)x + 13/4.

A vertical line

Points (5, 1) and (5, 9): run = 0, so the slope is undefined and the line is x = 5.

Frequently asked questions

What does a negative slope mean?

The line falls as you move to the right. A positive slope rises, a slope of 0 is flat, and a larger number means a steeper line.

Why is the slope of a vertical line undefined?

The run is 0, and dividing by zero has no answer. A horizontal line is different: its rise is 0, so its slope is exactly 0.

Does it matter which point I enter first?

No. Swapping the points flips the sign of both the rise and the run, so the slope stays the same.

What is point-slope form?

y − y₁ = m(x − x₁). It is the quickest way to write a line when you know one point and the slope.

How do I find the distance between the two points?

Use the Distance Calculator. It uses the same rise and run with the Pythagorean theorem.