Skip to content
CalculatPage

Slope Calculator

Enter two points to get the slope, the equation of the line, the y-intercept, its angle and the distance between points.

Updated November 2026 · How we build calculators

Result

Your result will appear here

Enter your numbers, then press Calculate.

How the Slope Calculator works

Slope is the change in y divided by the change in x. The intercept comes from b = y₁ − m × x₁. A vertical line has an undefined slope.

Formula used

m = (y₂ − y₁) ÷ (x₂ − x₁)

y = mx + b

Angle = arctan(m)

Step-by-step example

Using the default values in the calculator above:

  1. x₁: 1
  2. y₁: 2
  3. x₂: 5
  4. y₂: 10

The calculator then applies the formula above and returns:

  • Slope (m): 2 (y = 2x + 0)
  • Rise (Δy) / Run (Δx): 8 / 4
  • y-intercept (b): 0
  • Angle of incline: 63.4349°
  • Distance between points: 8.9442719
  • Midpoint: (3, 6)

What-if scenarios

Each table changes one input and keeps everything else at the calculator's default values.

If you change “x₁”
x₁Slope (m)
0.51.7777778
0.751.8823529
1 (default)2
1.52.2857143
22.6666667
If you change “y₁”
y₁Slope (m)
12.25
1.52.125
2 (default)2
31.75
41.5

Slope (m) for different x₁ and y₁

Every other input is left at its default value.

Slope (m): x₁ (rows) by y₁ (columns)
x₁1234
0.521.77777781.55555561.3333333
0.752.11764711.88235291.64705881.4117647
12.2521.751.5
1.52.57142862.285714321.7142857
232.66666672.33333332

Tips and background

A roof pitch of 6/12 has a slope of 0.5. Slope as a percentage is slope × 100, used for roads and wheelchair ramps.

Slope = rise over run

Slope m = (y₂ − y₁) ÷ (x₂ − x₁). Between (1, 2) and (5, 10) the rise is 8 and the run is 4, so m = 2. The line is y = 2x, with intercept 0. A horizontal line has slope 0 and a vertical line has an undefined slope.

Slope in everyday life

Roads and ramps use slope as a percentage (slope × 100); roofs use pitch such as 6/12 (slope 0.5). In the US, an ADA ramp is limited to a 1:12 slope. See the stair calculator and roofing calculator for construction uses, or find lengths with the distance calculator.

What do positive, negative and zero slopes look like?

PointsSlopeLine
(0, 0) and (12, 1)about 0.0833Rises gently
(2, 5) and (6, 5)0Flat
(1, 7) and (3, 1)-3Falls steeply
(3, 1) and (3, 9)undefinedVertical, x = 3

The first line rises 1 unit over 12, an angle of about 4.76 degrees.

How do slope, grade and angle differ?

Slope is rise divided by run. Grade writes the same number as a percentage, so a slope of 0.0833 is about an 8.3% grade. The angle is a third measure and is not proportional to either: a slope of 1, or 100% grade, is 45 degrees. Use the same units for rise and run. For ramps, roofs and stairs, local building and accessibility rules set the limits, so check them before building.

Common mistakes to avoid with the Slope Calculator

  • Subtracting the coordinates in different orders for rise and run.
  • Treating a vertical line's slope as zero.
  • Mixing up slope with the angle in degrees.

Frequently asked questions

What does slope mean?

How steeply a line rises or falls: rise over run.

What is the slope of a horizontal line?

Zero.

How do I find a perpendicular slope?

Take the negative reciprocal: −1/m.

How do I find the equation of a line from two points?

Find the slope, then use y = mx + b, solving b with one of the points.

What is a perpendicular slope?

The negative reciprocal: if m = 2, the perpendicular slope is −1/2.