Advertisement

📈 Slope Calculator

Enter two coordinate points to calculate the slope (gradient), y-intercept, line equation, angle of inclination, distance between the points, and midpoint.

Point 1 (x₁, y₁)

Point 2 (x₂, y₂)

Slope Formulas

Slope: m = (y₂ − y₁) / (x₂ − x₁)
Y-intercept: b = y₁ − m × x₁
Line equation: y = mx + b
Angle: θ = arctan(m) [in degrees]
Distance: d = √((x₂−x₁)² + (y₂−y₁)²)
Midpoint: M = ((x₁+x₂)/2, (y₁+y₂)/2)

Worked Example — Points (1, 2) and (4, 8)

m = (8 − 2) / (4 − 1) = 6 / 3 = 2
b = 2 − 2 × 1 = 0
Equation: y = 2x
Angle: arctan(2) ≈ 63.43°
Distance: √((4−1)² + (8−2)²) = √(9+36) = √45 ≈ 6.708
Midpoint: ((1+4)/2, (2+8)/2) = (2.5, 5)

Frequently Asked Questions

Slope (m) measures how steep a line is — the ratio of vertical change (rise) to horizontal change (run) between any two points on the line. A larger absolute value means a steeper line.

Use the formula m = (y₂ − y₁) / (x₂ − x₁). Subtract the y-coordinates and divide by the difference in x-coordinates. For example, points (2, 3) and (6, 11): m = (11−3)/(6−2) = 8/4 = 2.

The y-intercept (b) is the point where the line crosses the y-axis (where x = 0). Once you have the slope, calculate it as b = y₁ − m × x₁ using either of the two given points.

Slope-intercept form is y = mx + b, where m is the slope and b is the y-intercept. It makes it easy to graph a line — start at (0, b) on the y-axis, then move right 1 unit and up m units.

Related Calculators