Stats & Algebra
Interactive graph

Slope Calculator

Slope, equation and graph of a line from two points — or from one point and a slope.

Your numbers
What do you know?
First point (x₁, y₁)
Second point (x₂, y₂)
Try

Works instantly in your browser — nothing is uploaded, and the URL keeps your numbers so you can share the exact worked example.

Slope examples, worked

Each row is computed by the same engine as the calculator above — enter any pair to see the full working and graph.

Slope examples, worked
Two pointsSlope (m)DecimalEquation of the line
(1, 2) and (5, 5)3/40.75y = (3/4)x + 5/4
(−2, 5) and (4, 1)−2/3−0.6667y = −(2/3)x + 11/3
(0, 0) and (2, 6)33y = 3x
(2, 1) and (5, 3)2/30.6667y = (2/3)x − 1/3
(0, 3) and (4, 0)−3/4−0.75y = −(3/4)x + 3
(−1, −4) and (3, 4)22y = 2x − 2
(1.5, 2) and (3.5, 7)5/22.5y = (5/2)x − 7/4
(2, 3) and (6, 3)00y = 3
(3, −1) and (3, 6)Undefined—x = 3

Slopes are exact; decimals are rounded to four places.

Studying statistics or linear algebra? See every tool in the Stats & Algebra hub — variance, interpolation, RREF and eigenvectors, cross-linked.

Slope is rise over run

Slope measures how steep a line is: how far it goes up (the rise, Δy) for each step it goes across (the run, Δx). Between (1, 2) and (5, 5) the line rises 3 while running 4, so m = 3/4 — up three for every four to the right.

A positive slope climbs from left to right, a negative slope falls, and the bigger the number (ignoring its sign), the steeper the line.

Zero slope vs undefined slope

These are the two special cases. A horizontal line has a rise of 0, so its slope is 0 and its equation is y = c. A vertical line has a run of 0, and since you can't divide by zero its slope is undefined; its equation is x = c, and it has no y = mx + b form at all.

Three ways to write the same line

Slope-intercept form, y = mx + b, shows the slope and where the line crosses the y-axis. Point-slope form, y − y₁ = m(x − x₁), is quickest to write when you know one point and the slope. Standard form, Ax + By = C, uses whole numbers only and is handy for intercepts and for solving systems of equations.

To get from point-slope to slope-intercept, expand the bracket and move y₁ across. To get to standard form, multiply through by the denominators to clear fractions and move the x-term to the left.

Slope, angle and grade

The same steepness can be described three ways. The slope is the ratio rise ÷ run. The angle is tan⁻¹ of the slope — 3/4 is about 36.87°. The grade is the slope as a percentage, so 3/4 is a 75% grade. Ramps, roofs and roads usually quote grade or pitch rather than angle.

Frequently asked questions