Find the slope of a line through two points, plus the angle of incline, distance, midpoint, y-intercept and the line equation y = mx + b. Free and instant.

P₁ P₂ Δx Δy
x₁
y₁
x₂
y₂
Slope (m)
Angle of incline
Distance
Midpoint
Y-intercept (b)
Line equation
Slope m = (y₂ − y₁) / (x₂ − x₁). When x₂ = x₁ the line is vertical and the slope is undefined. The angle is measured from the horizontal.

About Slope Calculator

The slope calculator finds the slope of the line through two points using m = (y₂ − y₁) / (x₂ − x₁), the familiar rise-over-run formula. Enter the coordinates of point 1 and point 2 and the slope appears immediately.

It goes well beyond the slope alone: you also get the angle of incline measured from the horizontal, the straight-line distance between the points, their midpoint, the y-intercept b and the full line equation in y = mx + b form. When both x-values are equal, the tool correctly reports a vertical line with undefined slope.

Students use it for coordinate-geometry homework, and it is just as useful for grading driveways, ramps and roofs expressed as coordinates. Free and instant, right in your browser.

How to use Slope Calculator

  1. Enter the coordinates of point 1: x₁ and y₁.
  2. Enter the coordinates of point 2: x₂ and y₂.
  3. Read the slope m and the angle of incline.
  4. Check the distance, midpoint, y-intercept and the equation y = mx + b.

Frequently asked questions

For every 1 unit you move right along the x-axis, the line rises 2 units. Negative slopes fall from left to right, and a slope of 0 is a horizontal line.

When x₂ equals x₁, the line is vertical and the formula would divide by zero. A vertical line has no defined slope, so the tool labels it explicitly instead of showing an error.

The angle is the arctangent of the slope, measured from the horizontal. A slope of 1 corresponds to 45°, and steeper slopes approach 90°.

Once the slope m is known, the intercept comes from rearranging the line equation: b = y₁ − m·x₁. That value completes the equation y = mx + b shown in the results.

The distance formula, √((x₂ − x₁)² + (y₂ − y₁)²), which is the Pythagorean theorem applied to the horizontal and vertical differences.

Need help?
Found an issue with this tool? Let our team know.
Report an issue

Add this free tool to your own website — copy and paste the code below.