Slope Calculator
Enter two points. You get the slope, midpoint, distance, and the line equation.
Smart Tips
• Slope is rise over run: (y₂ − y₁) / (x₂ − x₁).
• If the x-coordinates match and the y-coordinates do not, the line is vertical and the slope is undefined.
• The same point twice does not determine a line. Enter two different points.
• Distance is the straight-line distance formula, not a road distance.
The Formula
Rise divided by run
((x₁ + x₂) / 2, (y₁ + y₂) / 2)
√((x₂ − x₁)² + (y₂ − y₁)²)
From y = mx + b, when m exists
A vertical line is written x = constant. The page does not divide by zero in that case. A horizontal line has slope 0 and equation y = constant. Fractions in the equation are reduced.
Key Insights
Vertical lines
A run of 0 would mean dividing by zero. The slope is reported as undefined and the equation is x = the shared x-coordinate.
Two points, one line
Two different points determine one line. The midpoint and the distance are reported with the slope.
Not a route
The distance is the straight segment between the points. It is not driving distance and it does not follow roads.
Reduced slope
When the coordinates are whole numbers or decimals, the slope is a reduced fraction, such as 4/3, and the equation uses that fraction.
Frequently Asked Questions
Note:Distance is the straight-line distance between the two points, not a driving distance. A vertical line has an undefined slope, and the page does not divide by zero.