Slope calculator
Type the coordinates of two points and the calculator gives the slope of the line through them, its angle, the distance between the points, the midpoint and the equation of the line. Vertical lines are handled too.
Runs in your browser: nothing you enter is sent anywhere.
Frequently asked questions
How do I calculate the slope between two points?
Divide the change in y by the change in x, m = (y₂ − y₁) ÷ (x₂ − x₁). For (1, 1) and (4, 7) the slope is 6 ÷ 3 = 2.
What is the slope of a vertical line?
It has no value, because the change in x is 0 and you cannot divide by zero. A vertical line has the equation x = c, and the calculator shows its angle as 90°.
What does a slope of zero or a negative slope mean?
A slope of 0 is a horizontal line. A positive slope rises from left to right and a negative slope falls. The angle with the x-axis is arctan(m), between −90° and 90°.
How is the line equation y = mx + b found?
First get the slope m, then the intercept b = y₁ − m × x₁. With m = 2 and the point (1, 1), b = 1 − 2 = −1, so the line is y = 2x − 1.