Home / Slope Calculator

Slope Calculator

Enter two points and the calculator returns the slope, the y-intercept, the equation of the line, and the distance between the points, with each step shown.

Chris Terry
By Chris Terry, Editor
Updated June 20, 2026

Two points

Point 1 is (x1, y1); point 2 is (x2, y2).

Results

Slope (m)--
Y-intercept (b)--
Equation--
Distance--
Enter two points to see the steps.

How to find the slope of a line

Slope measures how steep a line is. It is the change in y divided by the change in x between any two points on the line, often called rise over run.

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

From the slope you can build the full equation of the line in slope-intercept form, y = mx + b, where b is the y-intercept found with b = y₁ - m x₁. The straight-line distance between the two points comes from the distance formula.

Worked example: (1, 2) and (4, 8)

Step 1. Slope m = (8 - 2) / (4 - 1) = 6 / 3 = 2.
Step 2. Y-intercept b = 2 - (2)(1) = 0.
Step 3. Equation: y = 2x + 0, or simply y = 2x.
Step 4. Distance = sqrt((4-1)² + (8-2)²) = sqrt(9 + 36) = sqrt(45), about 6.708.

For more on slope and linear equations, see Wolfram MathWorld on the line.

More free math tools

Solve quadratics, simplify radicals, and more.

Good to know

Frequently asked questions

What is the slope formula?

Slope m = (y2 - y1) / (x2 - x1). It is the change in y divided by the change in x between two points on the line.

How do you find the y-intercept?

Once you have the slope m, use b = y1 - m times x1. The intercept b is where the line crosses the y-axis.

What does a slope of zero mean?

A slope of zero is a flat, horizontal line. An undefined slope, where x1 equals x2, is a vertical line.

How is the distance between two points found?

With the distance formula, sqrt((x2 - x1)^2 + (y2 - y1)^2), which comes straight from the Pythagorean theorem.

Chris Terry
About the author
Chris Terry
Editor, Encore Editorial

Editor at Encore Editorial, Chris Terry sets the editorial standards here and turns dense topics into plain English. He has written widely on education, finance, and consumer markets.