Math utility

Slope Calculator

Calculate the slope of a line from two coordinate points. The result shows rise, run, direction, an exact reduced fraction when available, and useful line forms.

Enter values and select Calculate.

Formula and worked example

m = (y₂ − y₁) / (x₂ − x₁). A zero run produces an undefined vertical slope; a zero rise with nonzero run produces slope 0.

For (1, 2) and (3, 6), rise = 6 − 2 = 4 and run = 3 − 1 = 2, so m = 4/2 = 2.

Calculations use full internal precision and trim insignificant trailing zeros for display. Confirm any rounding rule required by a course, workplace, publication, or technical standard.

How to use it

Enter x₁ and y₁ for the first point.

Enter x₂ and y₂ for a distinct second point.

Calculate and review the signed rise and run.

Use the line-form output only when it matches the coordinate convention required for your work.

Vertical, horizontal, and identical points

When x₁ = x₂ but the y-values differ, the line is vertical and its slope is undefined; the equation is x = constant.

When y₁ = y₂ and the x-values differ, the line is horizontal and its slope is 0.

Two identical points do not determine a unique line, so the calculator returns a validation message rather than calling the line vertical.

Line forms

For a finite slope, point-slope form is shown as y − y₁ = m(x − x₁).

Slope-intercept form uses b = y₁ − mx₁ and is shown as y = mx + b.

Integer rise and run are reduced by their greatest common divisor for an exact fractional slope.

Methodology and limits

This deterministic calculator uses the formula shown above and strict finite-number parsing. It does not evaluate expressions, execute entered text, call a remote calculation service, or claim to replace instruction or professional review.