Slope Calculator

Enter the coordinates of two points. The calculator returns the slope, the equation of the line in y = mx + b form, the angle, the distance between the points and the midpoint.

Type a number and the answer appears straight away.

Your answer

Slope (m)2

Equation of the line
y = 2x
y-intercept (b)
0
Angle from horizontal
63.43 degrees
As a percent grade
200%
Distance between the points
6.7082
Midpoint
(2.5, 5)
Rise and run
6 up for every 3 across

The math behind it: Slope

slope m = (y2 - y1) / (x2 - x1)

For the points (1, 2) and (4, 8), the slope is (8 - 2) / (4 - 1) = 2 and the line is y = 2x. A positive slope rises from left to right, a negative slope falls, a slope of zero is horizontal, and a vertical line has no defined slope.

Common questions

How do I find the slope between two points?

Subtract the first y from the second y, and divide by the second x minus the first x. This is the rise over the run.

What does a slope of 2 mean?

The line goes up 2 units for every 1 unit it moves to the right. As a percent grade that is 200%, and the line makes an angle of 63.43 degrees with the horizontal.

How do I find the equation of a line from two points?

Find the slope m, then put one point into y = mx + b to solve for b. For (0, 3) and (2, 4), m is 0.5 and b is 3, so the line is y = 0.5x + 3.

You might also need

Checked and updated: