Slope Calculator
Slope, equation and graph of a line from two points — or from one point and a slope.
- Slope m
- 3/4
- Slope-intercept
- y = (3/4)x + 5/4
- Point-slope
- y − 2 = (3/4)(x − 1)
- Standard form
- 3x − 4y = −5
- y-intercept
- (0, 1.25)
- x-intercept
- (−5/3, 0)
- Rise Δy
- 3
- Run Δx
- 4
- Angle θ
- 36.87° · 0.6435 rad
- Grade
- 75%
- Distance d
- 5
- Midpoint
- (3, 3.5)
Rises 3 for every 4 to the right — slope 3/4. The line y = (3/4)x + 5/4 crosses the y-axis at (0, 1.25).
- P₁
- (1, 2)
- P₂
- (5, 5)
- y-intercept
- (0, 1.25)
- x-intercept
- (−5/3, 0)
Drag across the graph, or focus it and use ← →, to read off points on the line.
The working
9 stepsLabel the two points
Either point can be P₁ — swapping them flips the sign of both the rise and the run, so the slope comes out the same.
- P₁ = (x₁, y₁)
- (1, 2)
- P₂ = (x₂, y₂)
- (5, 5)
Find the rise and the run
The rise is how far up (or down) you go from P₁ to P₂; the run is how far across.
Δy = y₂ − y₁ = 5 − 2 = 3Δx = x₂ − x₁ = 5 − 1 = 4Divide the rise by the run
Slope is rise over run: m = Δy ÷ Δx.
m = Δy/Δx = 3/4= 0.75
Find the y-intercept b
Put P₁ into y = mx + b and solve for b — it's where the line crosses the y-axis.
b = y₁ − m·x₁ = 2 − (3/4) × 1 = 2 − 3/4 = 5/4- Slope-intercept form
- y = (3/4)x + 5/4
Write the point-slope and standard forms
Standard form Ax + By = C uses whole numbers with no common factor and A positive.
- Point-slope
- y − 2 = (3/4)(x − 1)
- Standard form
- 3x − 4y = −5
Find where it crosses the axes
y-intercept: x = 0 gives y = b = 5/4, so (0, 1.25)x-intercept: y = 0 gives x = −b ÷ m = (−5/4) ÷ (3/4) = −5/3, so (−5/3, 0)Turn the slope into an angle and a grade
The angle is measured anticlockwise from the positive x-axis; the grade is the slope as a percentage, as on road signs.
θ = tan⁻¹(m) = tan⁻¹(3/4) = 36.87° = 0.6435 radgrade = m × 100% = 75%Measure the distance and find the midpoint
d = √(Δx² + Δy²) = √(4² + 3²) = √25 = 5Pythagoras on the rise/run triangle.
M = ((x₁ + x₂)/2, (y₁ + y₂)/2) = ((1 + 5)/2, (2 + 5)/2) = (3, 3.5)Check with the second point
Put x₂ into the equation — it should give back y₂.
y = (3/4) × 5 + 5/4 = 15/4 + 5/4 = 5 ✓
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.
| Two points | Slope (m) | Decimal | Equation of the line |
|---|---|---|---|
| (1, 2) and (5, 5) | 3/4 | 0.75 | y = (3/4)x + 5/4 |
| (−2, 5) and (4, 1) | −2/3 | −0.6667 | y = −(2/3)x + 11/3 |
| (0, 0) and (2, 6) | 3 | 3 | y = 3x |
| (2, 1) and (5, 3) | 2/3 | 0.6667 | y = (2/3)x − 1/3 |
| (0, 3) and (4, 0) | −3/4 | −0.75 | y = −(3/4)x + 3 |
| (−1, −4) and (3, 4) | 2 | 2 | y = 2x − 2 |
| (1.5, 2) and (3.5, 7) | 5/2 | 2.5 | y = (5/2)x − 7/4 |
| (2, 3) and (6, 3) | 0 | 0 | y = 3 |
| (3, −1) and (3, 6) | Undefined | — | x = 3 |
Slopes are exact; decimals are rounded to four places.
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.