Slope Calculator

Compute the slope, distance, and angle of incline of a line — from two points, or from one point with a known slope (or angle) and distance.

First point (x₁, y₁)
Second point (x₂, y₂)

What is slope?

The slope (or gradient) of a line describes its steepness, incline, or grade. It is defined as the ratio of the vertical change (rise) to the horizontal change (run) between any two points on the line:

m = (y₂ − y₁) / (x₂ − x₁)
= tan(θ)
mslope of the line·θangle of incline from the x-axis·(x₁, y₁), (x₂, y₂)two points on the line
  • A line is increasing and goes upward left-to-right when m > 0.
  • A line is decreasing and goes downward left-to-right when m < 0.
  • A line is horizontal (constant y) when m = 0.
  • A vertical line has an undefined slope, because the denominator (x₂ − x₁) is zero.

Slope is often called “rise over run”. Civil engineers use it to describe the grade of a road or ramp, geographers use it for terrain, and it's a building block of linear equations, calculus derivatives, and regression lines.

Slope, step by step

Pick the workflow that matches the information you already have: two points, or one point plus a known slope (or angle) and a distance. Both cases produce the same right-triangle picture — Δx and Δy along the axes, and the line segment d as the hypotenuse.

From two points → slope, distance, angle

With both endpoints known, slope is the rise divided by the run, distance uses the Pythagorean theorem on Δx and Δy, and the angle of incline is the arctangent of the slope.

m = Δy/Δx · d
= √(Δx² + Δy²) · θ
= atan(m)
Δxx₂ − x₁·Δyy₂ − y₁
Δx (run)Δy (rise)d
Example
Given
(3, 4) and (6, 8)
Substitute
m = 4/3 · d
= √25 · θ
= atan(4/3)
Answer
m ≈ 1.333 · d = 5 · θ ≈ 53.13°

One point + slope + distance → second point (two directions)

Converting slope to an angle gives a unit direction (cos θ, sin θ). Moving distance d along that direction from P₁ gives one candidate for P₂; moving the same distance in the opposite direction gives the other. Both lie on the same line.

x₂ = x₁ ± d·cos(θ) · y₂
= y₁ ± d·sin(θ)
P₁dir 1dir 2
Example
Given
P₁ = (1, 1), m = 0.75, d = 5
Substitute
θ = atan(0.75) ≈ 36.87° · cos θ
= 0.8 · sin θ
= 0.6
Answer
P₂ = (5, 4) or (−3, −2)

Vertical lines have undefined slope

When x₁ equals x₂ the denominator of the slope formula becomes zero, so the slope is undefined. The line is written as x = constant, the angle of incline is 90°, and only the distance d = |y₂ − y₁| is meaningful.

x₁ = x₂ ⇒ slope undefined · θ
= 90°
x = cslope undefined
Example
Given
(3, 1) and (3, 7)
Substitute
Δx = 0 · Δy
= 6
Answer
x = 3 · d = 6 · θ = 90°

Worked example — the (3, 4) to (6, 8) line

Slope, distance, and angle from two points

P₁ = (3, 4)
P₂ = (6, 8)
m = (8 − 4)/(6 − 3)
= 4/3 ≈ 1.3333
d = √((6 − 3)² + (8 − 4)²)
= √(9 + 16)
= √25
= 5
θ = atan(4/3) ≈ 53.13°

So the segment from (3, 4) to (6, 8) has slope 4/3, length 5, and rises at about 53.13° from the horizontal — a 133.3% grade.

Slope and angle — common values

Angle θSlope m = tan(θ)Grade %Ratio (rise : run)
00%0 : 1
15°0.267949192426.79%≈ 1 : 3.73
30°0.577350269257.74%1 : √3
45°1100%1 : 1
60°1.732050808173.21%√3 : 1
75°3.732050808373.21%≈ 3.73 : 1
90°undefinedvertical

Where slope shows up in real life

Slope is not just a classroom idea — you meet it every day, even when nobody calls it “slope”. Any time something goes up or down as something else changes, a slope is quietly doing the work behind the scene.

  • Roads and ramps. A road sign that says “8% grade” is telling you the slope of the hill. The road rises 8 metres for every 100 metres you drive forward.
  • Roofs and stairs. Builders talk about “pitch” for roofs and “rise over run” for stairs. Both are slope, just with different names.
  • Wheelchair ramps. Access rules usually cap the slope at 1 : 12 — for every 1 unit of rise you need at least 12 units of run, so the ramp is gentle enough to use safely.
  • Money and business. On a chart of price over time, the slope tells you how fast a value grows or drops. A steeper slope means faster change.
  • Science and data. In a straight-line trend line, the slope is the “rate” — kilometres per hour, cost per unit, degrees per minute, and so on.

How to use this calculator

The calculator has three simple modes. Pick the one that matches the numbers you already have, fill in the boxes, and press Calculate. Every answer comes with a full step-by-step working so you can follow the math, not just copy the result.

  1. Two Points — enter (x₁, y₁) and (x₂, y₂). The calculator gives you slope, distance between the points, angle of incline, grade %, and the reduced rise : run ratio.
  2. One Point + Slope — enter one point, a distance d, and either the slope m or the angle θ. The calculator finds the second point in both directions along the line.
  3. Equation — paste an equation like y = 6x − 22 or 2x + 3y = 12. The calculator reads it, pulls out the slope and intercepts, and shows the full derivation.

Below the answer you get seven sections — Answer, Point-Slope Form, Slope-Intercept Form (with the full algebra expansion), Y-Intercept, X-Intercept, a graph with points marked, and Standard Form. You can hide any section you don’t need by clicking “Hide” on its heading.

Common mistakes to avoid

  • Flipping rise and run. The formula is (y₂ − y₁) / (x₂ − x₁), not the other way around. Always put the change in y on top.
  • Mixing up the point order. You can start with either point, but you must be consistent — if y₂ comes from point 2, then x₂ must come from point 2 as well.
  • Forgetting the sign. A line falling to the right has a negative slope. Missing the minus sign turns a downhill line into an uphill line.
  • Dividing by zero. If x₁ = x₂ the line is vertical and the slope is undefined — not zero. Zero slope means horizontal.
  • Confusing slope with angle. A slope of 1 is a 45° incline, not a 100° or “100%” incline. Grade % and angle in degrees are two different numbers.
  • Rounding too early. If you round the slope before finding the y-intercept, small rounding errors get multiplied and the final equation drifts. Keep the exact fraction until the last step.

Features of this calculator

  • Two independent modes: from two known points, or from one point with slope/angle and distance
  • Reports slope m, distance d, and angle θ in both degrees and radians
  • Slope also shown as a percentage (grade) and as a reduced rise:run ratio
  • Handles vertical (undefined slope) and horizontal (m = 0) lines cleanly
  • In one-point mode, returns both possible positions for P₂ (forward and backward along the line)
  • Interactive SVG diagram showing Δx, Δy, and the line as the hypotenuse
  • Copy, PDF, print and image export of the result
  • Full step-by-step working with formulas, substitutions, and answer

Frequently asked questions

+What is slope?

Slope measures how steep a line is and which way it tilts. It's the ratio of rise (Δy) to run (Δx) between any two points on the line: m = (y₂ − y₁) / (x₂ − x₁).

+What does a negative slope mean?

A negative slope means the line falls as you move to the right — y decreases while x increases. The larger the absolute value, the steeper the descent.

+What is an undefined slope?

When x₁ = x₂ the two points lie on a vertical line and the denominator of the slope formula becomes 0. Division by zero is undefined, so vertical lines have no numeric slope; they're written x = constant instead.

+How is the angle of incline calculated?

Since m = tan(θ), the angle is θ = atan(m). A slope of 1 is exactly 45°; slopes above 1 climb steeper than 45°, and slopes below 1 climb shallower.

+What's the difference between slope and grade %?

Grade percent is just slope × 100. A road with slope 0.08 has an 8% grade — meaning it rises 8 units for every 100 units travelled horizontally.

+Can one point, a slope, and a distance define the second point?

Yes — but only up to direction. Along the same line you can travel distance d either forward or backward from P₁, so there are two valid second points. The calculator shows both.

Related calculators