Slope Calculator

Find the slope, angle of inclination, distance, midpoint and line equation from any two points on the coordinate plane. The calculator shows the formula used and the standard form of the resulting line.

Enter two points

Point 1 (x₁, y₁)
Point 2 (x₂, y₂)

Enter two points and press Calculate.

Slope formulas

Slope

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

Slope is "rise over run" — the change in y divided by the change in x between two points.

Angle of inclination

θ = arctan(m)

The angle is measured counterclockwise from the positive x-axis. Horizontal lines have θ = 0°, vertical lines have θ = 90°.

Line equation (point-slope form)

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

Rearranged into slope-intercept form: y = mx + b, where the y-intercept is b = y₁ − m·x₁.

Distance between two points

d = √[(x₂ − x₁)² + (y₂ − y₁)²]

Midpoint

M = ((x₁ + x₂) / 2, (y₁ + y₂) / 2)

Worked examples

Example 1 — Positive slope

Points (1, 2) and (4, 11).

m = (11 − 2) / (4 − 1) = 9 / 3 = 3. θ = arctan(3) ≈ 71.6°.

m = 3, θ ≈ 71.6°

Example 2 — Negative slope

Points (0, 5) and (5, 0).

m = (0 − 5) / (5 − 0) = −1. θ ≈ −45°.

m = −1, θ ≈ −45°

Example 3 — Horizontal line

Points (2, 3) and (7, 3).

m = 0. The line is horizontal (y = 3).

m = 0, θ = 0°

Example 4 — Vertical line

Points (4, 1) and (4, 6).

The x-values are identical, so the slope is undefined. The line is x = 4.

Slope undefined (vertical)

Frequently asked questions

A negative slope means the line goes down as it moves right — y decreases as x increases. Positive slope means it goes up to the right.

The slope is undefined when the two points have the same x-coordinate (vertical line). Dividing by zero in the slope formula produces an undefined value. Vertical lines are written as x = k, not y = mx + b.

The angle θ measured from the positive x-axis is θ = arctan(m). For example, m = 1 corresponds to 45°, and m = √3 corresponds to 60°.