Home / Math Calculators / Slope Calculator

Slope Calculator

Find the slope between two points and calculate the line's distance, midpoint, angle of inclination, and equation with clear step-by-step working.

Enter two points

Coordinates can be positive, negative, or decimal values.

Slope is the change in y divided by the change in x. If both points have the same x-coordinate, the line is vertical and its slope is undefined.

Result

Slope (m)
2
The line rises 2 units for every 1 unit moved to the right.
Line equation: y = 2x − 1
Change in y (rise)8
Change in x (run)4
Distance between points8.9443
Midpoint(4, 7)
Angle of inclination63.4349°
Y-intercept−1
Positive slope: the line rises from left to right.

Line diagram

(2, 3)(6, 11)

Calculation steps

  1. Calculate rise: 11 − 3 = 8.
  2. Calculate run: 6 − 2 = 4.
  3. Divide rise by run: 8 ÷ 4 = 2.

How to use the Slope Calculator

  1. Enter the x- and y-coordinates for the first point.
  2. Enter the coordinates for the second point.
  3. Choose how many decimal places to show.
  4. Click Calculate slope to see the slope, line equation, distance, midpoint, and angle.

What is slope?

Slope describes how steep a line is and the direction it moves on a coordinate plane. It is calculated by dividing the vertical change (rise) by the horizontal change (run) between two points.

m = (y₂ − y₁) / (x₂ − x₁) = rise / run

How to interpret slope

  • Positive slope: the line rises as you move from left to right.
  • Negative slope: the line falls as you move from left to right.
  • Zero slope: the line is horizontal.
  • Undefined slope: the line is vertical because the run is zero.

Other formulas

Distance: √((x₂ − x₁)² + (y₂ − y₁)²). Midpoint: ((x₁ + x₂)/2, (y₁ + y₂)/2). Line equation: y = mx + b, where b = y₁ − mx₁.

Worked example

For points (2, 3) and (6, 11), the rise is 11 − 3 = 8 and the run is 6 − 2 = 4. The slope is 8 ÷ 4 = 2. Substituting a point into y = mx + b gives 3 = 2(2) + b, so b = −1 and the line equation is y = 2x − 1.

Frequently asked questions

Can slope be negative?

Yes. A negative slope means y decreases as x increases. For example, a line with slope −3 falls 3 units for every 1 unit moved to the right.

What is the slope of a horizontal line?

A horizontal line has slope 0 because the y-values do not change, so the rise is zero.

Why is the slope of a vertical line undefined?

A vertical line has no horizontal change, so x₂ − x₁ equals zero. Since division by zero is undefined, its slope is undefined.

How do I find slope from two points?

Subtract the first point's y-coordinate from the second point's y-coordinate, then divide by the difference between their x-coordinates using the same point order.

What does a slope of 1 mean?

A slope of 1 means the line rises one unit for every one unit moved to the right.

Does the order of the points matter?

No, as long as you subtract coordinates consistently. Reversing both differences changes the signs of both numerator and denominator, so the slope stays the same.