Slope Calculator

The slope, or gradient, of a line measures how steep it is: the change in y divided by the change in x, often called rise over run. This slope calculator finds the slope through two points as an exact fraction, then gives the line's equation, its angle with the x-axis and the perpendicular slope.

Try:

How to use the slope calculator

  1. Enter the coordinates of the first point (x₁, y₁).
  2. Enter the coordinates of the second point (x₂, y₂).
  3. Press Calculate to see the slope and the equation of the line.

Formula

m=y2−y1x2−x1m = \frac{y_2 - y_1}{x_2 - x_1}
y=mx+cy = mx + c

Worked example: (1, 2) and (4, 8)

  • x₁: 1
  • y₁: 2
  • x₂: 4
  • y₂: 8

✓ Answer checked

m=2m = 2
Equation of the line
y=2xy = 2x
Angle with the x-axis
≈63.4349∘\approx 63.4349^\circ
Perpendicular slope
−12-\frac{1}{2}
−6−4−224681012246810(1, 2)(4, 8)run 3rise 6
Slope = rise ÷ run = 6 ÷ 3 = 2.
Step-by-step working (4 steps)
  1. Use the slope formula Slope formula

    Slope is rise over run: the change in y divided by the change in x.

    m=y2−y1x2−x1m = \frac{y_2 - y_1}{x_2 - x_1}
  2. Substitute

    Put the coordinates in.

    m=8−24−1=63m = \frac{8 - 2}{4 - 1} = \frac{6}{3}
  3. Simplify

    A positive slope means the line goes up from left to right.

    m=2m = 2
  4. Find the y-intercept Slope-intercept form

    Substitute one point into y = mx + c and solve for c.

    c=2−2×1=0c = 2 - 2 \times 1 = 0
Formulas used
m=y2−y1x2−x1m = \frac{y_2 - y_1}{x_2 - x_1}
y=mx+cy = mx + c
How this was checked
  • ✓ Both points satisfy the equation of the line.

Frequently asked questions

How do I find the slope between two points?

Subtract the y-values, subtract the x-values in the same order, and divide. For (1, 2) and (4, 8): (8 − 2) ÷ (4 − 1) = 2.

What does a negative slope mean?

The line goes down from left to right.

What is the slope of a vertical line?

It is undefined, because the change in x is 0 and you cannot divide by 0.

Related calculators

Related guides