Slope Calculator

Find the slope, y-intercept, equation, angle and distance from two points on a line.

Your result will appear here

Fill in the fields and press Calculate.

Give two points and this calculator finds the slope of the line through them — how steep it is and which way it tilts — along with the y-intercept, the full equation y = mx + b, the angle of incline, and the distance between the points.

How is it calculated?

Slope is rise over run

Slope (m) is the change in y divided by the change in x:

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

SlopeMeaning
PositiveLine rises left to right
NegativeLine falls left to right
ZeroHorizontal line
UndefinedVertical line (x₁ = x₂)

A vertical line has no slope — the run is zero, so the division is undefined.

From slope to the full line

Once you have the slope, the y-intercept (b) is where the line crosses the y-axis: b = y₁ − m·x₁. Together they give the slope-intercept equation y = mx + b. The angle of incline is arctan(m), and the straight-line distance between the points is √((x₂−x₁)² + (y₂−y₁)²) — the Pythagorean theorem again.

Worked example

For the points (1, 2) and (3, 6): the slope is (6 − 2) ÷ (3 − 1) = 4 ÷ 2 = 2. The y-intercept is 2 − 2×1 = 0, so the line is y = 2x. Its angle of incline is arctan(2) ≈ 63.4°, and the distance between the two points is √(2² + 4²) = √20 ≈ 4.47.

FAQ

How do I calculate the slope between two points?+

Divide the change in y by the change in x: m = (y₂ − y₁) ÷ (x₂ − x₁). For (1, 2) and (3, 6) that’s (6 − 2) ÷ (3 − 1) = 2. The tool also gives the y-intercept and full equation.

What does the slope tell me?+

How steep the line is and its direction. A positive slope rises from left to right, a negative one falls, zero is flat, and a larger absolute value is steeper. A slope of 2 means y increases by 2 for every 1 that x increases.

What is the y-intercept?+

The point where the line crosses the y-axis, i.e. the value of y when x = 0. It’s found with b = y₁ − m·x₁ and is the “b” in the slope-intercept equation y = mx + b.

Why is the slope sometimes undefined?+

When the two points share the same x value, the line is vertical and the run (x₂ − x₁) is zero. Dividing by zero is undefined, so a vertical line has no slope — the calculator flags this instead of returning a number.

How is the angle of the line found?+

By taking the arctangent of the slope: angle = arctan(m), in degrees. A slope of 1 is a 45° incline, a slope of 0 is horizontal (0°), and steeper slopes approach 90°.