Slope Calculator

Enter two coordinate points (x₁, y₁) and (x₂, y₂) to find the slope, line equation y = mx + b, x-intercept, y-intercept, distance between the points, and angle of inclination. Full working is shown for each calculation.

Enter two coordinate points above to calculate slope

How It Works

Given two points (x₁, y₁) and (x₂, y₂), the slope and line equation are found as follows:

Step 1 — Calculate the slope (gradient):
m = (y₂ − y₁) / (x₂ − x₁) = rise / run

Example: Points (2, 3) and (6, 11)
Rise = 11 − 3 = 8
Run = 6 − 2 = 4
m = 8 / 4 = 2

Step 2 — Find the y-intercept (b):
Substitute one point into y = mx + b
b = y₁ − m × x₁
b = 3 − 2 × 2 = −1
Line equation: y = 2x − 1

Step 3 — Find the x-intercept (where y = 0):
0 = mx + b → x = −b/m
x = −(−1)/2 = 0.5

Step 4 — Distance between points:
d = √((x₂−x₁)² + (y₂−y₁)²) = √(4² + 8²) = √(16+64) = √80 ≈ 8.944

Step 5 — Angle of inclination:
θ = arctan(|m|) = arctan(2) ≈ 63.43°

Special cases: vertical lines (x₁ = x₂) have undefined slope; horizontal lines (y₁ = y₂) have slope = 0.

Frequently Asked Questions

What does slope mean?

Slope (m) measures the steepness and direction of a line: how much y changes for each unit increase in x. A positive slope goes up left-to-right; negative goes down; zero is horizontal; undefined is vertical. The slope is also called gradient or "rise over run."

What is y = mx + b?

This is slope-intercept form. m is the slope and b is the y-intercept (where the line crosses the y-axis). It is the most common way to write a linear equation because you can read the slope and y-intercept directly.

What if the slope is undefined?

If x₁ = x₂ (the two points share the same x-coordinate), the line is vertical and the slope is undefined — division by zero. Vertical lines are written as x = constant rather than y = mx + b.

What is the angle of inclination?

The angle of inclination is the angle the line makes with the positive x-axis, measured in degrees. It equals arctan(|m|) for non-vertical lines and ranges from 0° (horizontal) to just under 90° (nearly vertical). A slope of 1 gives a 45° angle.

Can I enter negative coordinates?

Yes. The calculator handles any real number coordinates, including negatives and decimals.