Slope calculator

Slope, line equation, intercepts and distance from two points. Free, no sign-up.

Point 1Point 2
Drag to pan, scroll to zoomOpen in graphing calculator
Quick answer

Enter two points and the calculator finds the slope m = (y₂ − y₁)/(x₂ − x₁), the equation of the line in slope-intercept form y = mx + b and point-slope form, both intercepts, the distance and midpoint between the points, and the angle of the line, all graphed.

How to use the slope calculator

  1. Enter the coordinates of the first point (x₁, y₁).
  2. Enter the second point (x₂, y₂).
  3. Read the slope, the line equation in two forms and both intercepts.
  4. Check the graph: the red line passes through both blue points.

Example

Through (1, 2) and (4, 8): m = (8 − 2)/(4 − 1) = 2. Then b = 2 − 2·1 = 0, so the line is y = 2x. Learn more in the slope guide and slope-intercept form guide.

Frequently asked questions

What is the slope formula?

m = (y₂ − y₁) / (x₂ − x₁): the change in y divided by the change in x.

What if both x-values are the same?

The line is vertical and its slope is undefined. Its equation is x = that value.