Slope Calculator
Enter two points to find the slope between them and the equation of the line that passes through both.
How slope and the line equation are calculated
Slope (m) measures how steep a line is — the ratio of vertical change to horizontal change between two points: m = (y2−y1) / (x2−x1). A positive slope rises left to right, a negative slope falls, and a slope of 0 is a horizontal line.
Once you know the slope, the full line equation in slope-intercept form (y = mx + b) follows by solving for the y-intercept: b = y1 − m×x1, using either of the original points.
Frequently asked questions
Why is a vertical line's slope undefined?
Slope is rise divided by run; a vertical line has zero horizontal change (run = 0), and division by zero is undefined — vertical lines are instead described by an equation like x = 3.
What does a slope of 0 mean?
A slope of 0 means the line is perfectly horizontal — there's no vertical change as x increases.
Does it matter which point I label as point 1?
No — swapping the two points flips the sign of both the rise and the run, so the ratio (the slope) comes out exactly the same.