Slope Calculator

Find the slope, y-intercept, line equation, distance and angle between two points.

Slope (m)
2

Positive slope: the line rises left to right.

The two points and the line through themy
Datay = 2x
246811.522.533.54(1, 2)(4, 8)x
Equation of the line
y = 2x
y-intercept (b)
0
Distance between points
6.708204
Angle of inclination
63.4349
Midpoint
(2.5, 5)
Show the working
  1. Rise Δy = y₂ − y₁ = 8 − 2 = 6
  2. Run Δx = x₂ − x₁ = 4 − 1 = 3
  3. Slope m = Δy ÷ Δx = 6 ÷ 3 = 2
  4. Intercept b = y₁ − m·x₁ = 2 − 2 × 1 = 0
  5. Distance = √(Δx² + Δy²) = √(9 + 36) = 6.7082039
  6. Angle = arctan(m) = 63.4349°

Runs entirely in your browser. Nothing you enter is uploaded.

Formula

m = (y₂ − y₁) ÷ (x₂ − x₁)b = y₁ − m·x₁ → y = mx + bd = √((x₂ − x₁)² + (y₂ − y₁)²)θ = arctan(m)

How it works

Slope measures how steep a line is: how much it rises (or falls) for every one unit you move to the right. It is often remembered as “rise over run”. A slope of 2 means the line goes up 2 units for each 1 unit across.

Once you have the slope, the y-intercept b tells you where the line crosses the y-axis. Plug either point into y = mx + b and solve for b. Together, m and b give the slope-intercept form of the line.

The distance between the points comes from the Pythagorean theorem, treating the run and rise as the two legs of a right triangle. The angle of inclination is the angle the line makes with the positive x-axis.

Frequently asked questions

What does an undefined slope mean?

If both points have the same x-coordinate, the run is zero and you would be dividing by zero. The line is vertical and its equation is x = constant.

Does the order of the points matter?

No. Swapping the points flips the sign of both the rise and the run, so their ratio — the slope — stays the same.

How do I write the point-slope form?

Use y − y₁ = m(x − x₁). With m = 2 and the point (1, 2), that is y − 2 = 2(x − 1), which simplifies to y = 2x.

esc