Coordinate geometry

Slope calculator

Enter two distinct points to find rise over run, exact and decimal slope, line direction and equation, distance, and midpoint.

Point 1
Point 2

How to calculate slope from two points

For points (x₁, y₁) and (x₂, y₂), slope is m = (y₂ − y₁) / (x₂ − x₁). The numerator is the vertical change, or rise; the denominator is the horizontal change, or run. Positive slope rises from left to right, negative slope falls, and zero slope is horizontal.

Vertical and identical points need separate handling

When x₂ − x₁ equals zero but the y-values differ, division by zero makes slope undefined and the line is vertical. Its equation is x = x₁. When both coordinates match, the two entries describe only one point, so they cannot identify one unique line.

Exact fractions and decimal coordinates

The calculator reads entered decimal coordinates as exact base-10 fractions, performs the rise/run reduction with integer arithmetic, and displays a reduced slope fraction. A decimal approximation is included when the result is not an integer. Distance uses the Pythagorean formula and is therefore approximate when it contains an irrational square root.

Line equations

For a nonvertical line, the calculator derives the intercept from b = y₁ − mx₁ and reports slope-intercept form y = mx + b. Point-slope form preserves the first entered point. Equivalent equations may look different after algebraic rearrangement while still describing the same line.

Check that coordinates use the same scale and units. The result describes an ideal straight line between mathematical points; it does not account for measurement uncertainty, map projection, curvature, or physical tolerances.