Slope Calculator
Find the slope between two points and the line equation in slope-intercept and point-slope form, plus angle, distance and midpoint, step by step.
Slope
Cartesian coordinates in consistent units. The two points must differ. Angle is the signed arctangent of the slope, between −90° and 90°; a vertical line is shown at 90°. This is not a geodesic distance calculation.
Formula checked · NumberSwift · Review process
How this calculator works
A line through two distinct points has slope equal to its vertical change divided by its horizontal change. The same coordinates determine its equation, midpoint and point-to-point distance. Vertical lines are represented by x = constant, with an undefined slope; horizontal lines have zero slope. The working states the rise and run explicitly.
Formula
m = (y₂ − y₁) / (x₂ − x₁); b = y₁ − mx₁; distance = √((Δx)² + (Δy)²); midpoint = ((x₁+x₂)/2, (y₁+y₂)/2).
Assumptions & limitations
Cartesian coordinates in consistent units. The two points must differ. Angle is the signed arctangent of the slope, between −90° and 90°; a vertical line is shown at 90°. This is not a geodesic distance calculation.
Worked example
Points (1,2) and (3,6) give rise 4, run 2 and slope 2. The line is y = 2x, midpoint (2,4), and distance √20 ≈ 4.4721.
Useful next calculations
Choose a related task to continue with the right assumptions:
Common questions
What happens when x coordinates are equal?
The line is vertical. Its slope is undefined because the run is zero, and its equation is x = that coordinate.
Can the slope be negative?
Yes. A line descending as x increases has a negative slope.
Why are identical points rejected?
One point lies on infinitely many lines. Two distinct points are required to determine a unique line.