Math · Every step shown

Slope Calculator

Slope, line equation, distance and midpoint from two points. Free, with the full step-by-step solution and no login.

Enter your numbers

Press Solve with steps to see the answer and how to get it.

Job: Graphing
Your answer

Press Solve with steps to see the answer and every step.

How it works, examples and FAQ

Slope measures steepness: m = (y2 − y1) ÷ (x2 − x1), which is rise over run.

Once you have m, the y-intercept is b = y1 − m × x1, giving the line y = mx + b.

Example: points (1, 2) and (4, 8). Rise = 6, run = 3, so m = 2. Then b = 2 − 2 × 1 = 0, so the line is y = 2x.

We also give you the distance, √(run² + rise²), and the midpoint, the average of the two x's and the two y's.

What if the line is vertical?
The run is 0 and you cannot divide by 0, so the slope is undefined. The equation is x = a constant.

What does a negative slope mean?
The line goes down as you move to the right.

What if the line is horizontal?
The rise is 0, so the slope is 0 and the equation is y = a constant.

More math calculators

Snap a photo of a problem →   All math tools →   All calculators →

These calculators show the method as well as the answer, so you can learn the steps and check your own work. Answers are rounded to six decimal places. If a result ever looks wrong, tell us on the Contact page with the numbers you entered.

Save or print your results

On a phone, choose Save as PDF on the next screen to keep a copy.