Slope Calculator

Find slope, line equation, intercept and inclination from two points or a point and slope, plus distance and midpoint for two points.

Solve for

Slope

2

  • Line equationy = 2x + 0
  • Y-intercept0
  • Inclination (0–180°)63.43494882°
  • Perpendicular slope-0.5
  • Distance8.94427191
  • Midpoint(3, 6)

How this was calculated

Slope = (y₂ − y₁) / (x₂ − x₁).

For a nonvertical line, y-intercept = y₁ − mx₁. Coincident points do not determine a unique line.

Formula and method

Slope m = (y₂−y₁)/(x₂−x₁), intercept b = y₁−mx₁ and the line is y = mx+b. For two points, distance is √((x₂−x₁)²+(y₂−y₁)²), and midpoint averages each coordinate.

Worked example

Points (1,2) and (5,10) give slope 8/4 = 2, line y = 2x and midpoint (3,6). Their distance is √80 ≈ 8.94427191; a perpendicular line has slope −1/2.

Inputs and limitations

A vertical line has undefined slope and equation x = constant. A horizontal line has slope zero and a vertical perpendicular. Two identical points do not specify a unique line. Inclination is reported between 0° and 180°, independent of point order.

Last updated . Results are estimates for informational purposes only.