Math utility

Slope Calculator

Enter two coordinate points to calculate the slope of the line between them. See the rise, run, reduced fractional slope, direction, and line equations when defined.

Enter values and select Calculate.

Slope formula

m = (y₂ − y₁) / (x₂ − x₁). The numerator is the rise and the denominator is the run.

How to find slope between two points

  1. Subtract the first y-coordinate from the second to find the rise.
  2. Subtract the first x-coordinate from the second to find the run.
  3. Divide rise by run and reduce the fraction when possible.

Positive, negative, zero and undefined slope

  • A positive slope rises from left to right.
  • A negative slope falls from left to right.
  • A horizontal line has zero slope because its rise is 0.
  • A vertical line has undefined slope because its run is 0.

Slope 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.

Slope-intercept form

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.