Slope Calculator
Slope (m) = 0
The Slope Formula
Slope measures how steep a line is — the ratio of vertical change to horizontal change between two points. For points (x₁, y₁) and (x₂, y₂), the slope is m = (y₂ − y₁) / (x₂ − x₁), often remembered as "rise over run." A positive slope rises left to right, a negative slope falls, a slope of zero is a horizontal line, and a vertical line (where x₁ = x₂) has an undefined slope because you'd be dividing by zero.
From Slope to a Full Equation
Once you know the slope, the point-slope form y − y₁ = m(x − x₁) lets you write the line's full equation in slope-intercept form, y = mx + b, where b is the y-intercept. This calculator solves for b automatically by substituting one of your points back into the equation. The angle of inclination shown above is simply arctan(m), the angle the line makes with the positive x-axis.
Slope Versus Distance
Slope only describes direction and steepness, not how far apart the two points actually are — that's a separate calculation using the Pythagorean theorem: d = √((x₂−x₁)² + (y₂−y₁)²). If you need that distance on its own for other pairs of coordinates, try the distance calculator, or for slope-adjacent right-triangle geometry, the right triangle calculator.
Frequently Asked Questions
What does it mean if the slope is undefined?
A slope is undefined when the two points share the same x-coordinate, making the line perfectly vertical. Since slope is calculated as change in y divided by change in x, a zero denominator makes the ratio impossible to compute - the calculator flags this as 'Undefined' and reports the line as x = (that constant x-value) instead of a y = mx + b equation.
How do I find the equation of a line from two points?
First calculate the slope m = (y2 - y1) / (x2 - x1), then plug one of the points and the slope into the point-slope form y - y1 = m(x - x1) and solve for y to get slope-intercept form, y = mx + b. This calculator performs that substitution automatically and displays the resulting equation.