Slope Calculator
Slope, line equation, distance, midpoint and a graph from two points.
Calculate
How to use this calculator
Type the coordinates of two points. The calculator gives the slope, the equation of the line, the intercepts, the distance and midpoint between the points, and a graph.
How it's calculated
Slope m = (y₂ − y₁) / (x₂ − x₁), which is rise over run. The line is y = mx + c where c = y₁ − m × x₁. The distance between the points is √((x₂ − x₁)² + (y₂ − y₁)²) and the angle is the inverse tangent of m.
Worked example
Points (2, 1) and (6, 4): m = (4 − 1) / (6 − 2) = 3/4. Then c = 1 − (3/4)(2) = −1/2, so y = 3x/4 − 1/2.
Frequently asked questions
What if the line is vertical?
If x₁ = x₂ the bottom of the slope fraction is 0, so the slope is undefined and the line is x = a number.
What does a negative slope mean?
The line goes downhill from left to right.
Related tools
Last updated October 2026. Results are for learning and guidance; always check important work. Calculations run in your browser and are not stored.