Mihsaba›Math›Slope Calculator

Slope Calculator

Find slope, rise, run, angle, line equation, midpoint and distance from two points, with explicit handling for vertical lines.

Share this free calculator

Send this tool to someone who needs the calculation.

How to use

The slope calculator turns two coordinate points into the main properties of their straight line: rise, run, slope, inclination angle, percent grade, line equation, y-intercept, midpoint and point-to-point distance.

  1. Enter the two coordinate pairs without mixing x and y between points.
  2. The calculator finds Δy and Δx.
  3. When Δx is non-zero it computes slope and the y=mx+b equation.
  4. For a vertical line it labels slope undefined and reports x = constant instead of dividing by zero.

How it is calculated

m = (y₂ − y₁) ÷ (x₂ − x₁); for non-vertical lines b = y₁ − m x₁, so y = mx + b

Example

For points (1, 2) and (5, 10), Δy = 8 and Δx = 4, so m = 2. The intercept is 0, the line is y = 2x, and the point-to-point distance is √80 ≈ 8.9443.

Important notes

Zero slope is horizontal; a vertical line has undefined slope, not zero slope. Percent grade here is the direct mathematical m×100. Road, roof or accessibility standards can add direction and domain-specific conventions, so the number alone should not be treated as a compliance result.

Worked examples and interpreting results

The line through (1,2) and (3,6) rises four units over a horizontal run of two, giving slope 2 and equation y=2x. Slope is vertical change divided by horizontal change.

Worked examples and interpreting results
CaseCalculationResult
Slope(6 − 2) ÷ (3 − 1)2
Y-intercept2 − 2 × 10

How to check the result

Equal x coordinates give a vertical line with undefined slope, not zero slope. Zero slope describes a horizontal line. Reverse the point order in both numerator and denominator to preserve the result.

Frequently asked questions

Does a vertical line have slope zero?

No. Its run is zero, so slope is undefined. A horizontal line has slope zero.

Does swapping the two points change slope?

No. Both rise and run change sign, leaving their ratio unchanged.

What is the inclination angle?

For a non-vertical line it is arctan(m), the angle associated with the line’s slope relative to the horizontal axis.