Slope Calculator

Slope, full line equation, angle, distance and midpoint from two points — with the working shown.

Two points on the line

Point 1 (x₁, y₁)

Point 2 (x₂, y₂)

Slope (m)

—

Line equation—
Angle of incline—
Distance between points—
Midpoint—
Perpendicular slope—
—

The slope formula

Slope measures steepness as rise over run: m = (y₂ − y₁) ÷ (x₂ − x₁). Positive slope rises left-to-right, negative slope falls, zero is horizontal, and a vertical line (x₂ = x₁) has undefined slope — this calculator flags that case instead of dividing by zero.

From slope to the full line

Once you have m, the y-intercept is b = y₁ − m·x₁, giving the slope-intercept equation y = mx + b. The angle of incline is arctan(m) in degrees, the distance uses the Pythagorean theorem √(Δx² + Δy²), and a perpendicular line has slope −1/m (the negative reciprocal).

Related calculators

A few habits prevent most slope mistakes: keep the point order consistent — if y₂ comes first in the numerator, x₂ must come first in the denominator — and watch signs when coordinates are negative, since subtracting a negative adds. Parallel lines share the same slope; perpendicular lines have slopes that multiply to −1. In applied settings slope is a rate: on a distance–time graph it's speed, on a cost–quantity graph it's unit cost, and a road “grade” of 6% is simply a slope of 0.06 expressed as a percentage.

Frequently asked questions

What is the slope formula?
m = (y₂ − y₁) ÷ (x₂ − x₁) — the change in y divided by the change in x between two points, often called rise over run.
What does an undefined slope mean?
A vertical line has x₂ = x₁, so the run is zero and the division is undefined. Its equation is written x = c instead of y = mx + b.
How do I find the y-intercept from two points?
First compute the slope m, then plug either point into b = y − m·x. That b is where the line crosses the y-axis, completing y = mx + b.
What is the slope of parallel and perpendicular lines?
Parallel lines have equal slopes. Perpendicular lines have slopes that are negative reciprocals — if one is 3/2, the other is −2/3 — so their product is −1.

How ListCalc calculates · Report an error

Guides & articles