Slope Calculator

Calculate line slope, angle, y-intercept, and distance between two points.

Point 1 (x₁, y₁)
Point 2 (x₂, y₂)
Slope (m)
2
y = 2x
Angle
63.4349°
Percent grade
200%
Distance
6.7082
Midpoint
(2.5, 5)
Point-slope form
y − 2 = 2(x − 1)
Standard form
2x − y = 0

Measuring a roof rather than a graph? The roof pitch calculator works in rise per 12 and gives rafter lengths, and the slope percentage calculator converts grades for ramps and paths.

Rise over run, and what the sign tells you

Slope measures steepness as m = (y₂ − y₁) / (x₂ − x₁) — the vertical change divided by the horizontal. Keep the points in the same order in both the numerator and the denominator; swapping one but not the other flips the sign and is the standard slip. A positive slope rises left to right, a negative one falls.

The two special cases confuse people in opposite directions. A horizontal line has slope 0, because nothing rises. A vertical line has undefined slope, because the run is zero and division by zero is not a number — it is not "infinite slope", it simply does not exist. Parallel lines share a slope; perpendicular lines have slopes multiplying to −1, so a slope of 2 is perpendicular to −½.

Once you have a slope and a point, point-slope form y − y₁ = m(x − x₁)gives the line immediately, and rearranges to y = mx + b. Slope is also the concrete ancestor of the derivative: the gradient of a straight line is constant, and calculus extends the same idea to curves by taking the slope at a point.

Frequently Asked Questions

What is the slope formula?

m = (y₂ - y₁) / (x₂ - x₁), representing the rise over run between two points (x₁, y₁) and (x₂, y₂).

How do I convert slope to an angle or a percent?

The angle is the arctangent of the slope: θ = arctan(m), so a slope of 1 is 45° and a slope of 0.5 is about 26.57°. The percent grade is the slope times 100, so a slope of 0.05 is a 5% grade. A 100% grade is 45°, not vertical.

What are point-slope form and standard form?

Point-slope form, y − y₁ = m(x − x₁), writes the line from one known point and the slope. Standard form, Ax + By = C, uses whole numbers with A not negative; for the line through (0, 3) and (2, 0) it is 3x + 2y = 6. All three forms describe the same line.

How do I calculate slope?

Rise over run: (y2 - y1) / (x2 - x1). A positive slope rises left to right, negative falls, zero is horizontal. A vertical line has an undefined slope because the run is zero, not an infinite one.

What is slope-intercept form?

y = mx + b, where m is the slope and b the y-intercept. Given a point and a slope, point-slope form y - y1 = m(x - x1) is usually quicker and rearranges into slope-intercept form directly.