Slope Calculator

Find the slope of the line through two points, its equation in slope-intercept form y = mx + b, the angle of the line and the grade in percent.

  • 100% free
  • No signup
  • Runs in your browser

Slope through two points

Angle of the line—
Grade (percent)—
Rise Δy / run Δx—

How to use

  1. Enter the coordinates of two points on the line: (x₁, y₁) and (x₂, y₂).
  2. Click Calculate or press Enter.
  3. Read the slope m and the line equation, and in the table the angle of the line, the grade in percent and the rise over run.

Slope formulas

Value Formula
Slope m m = (y₂ − y₁) / (x₂ − x₁)
y-intercept b = y₁ − m × x₁
Angle of the line θ = arctan(m)
Grade (percent) m × 100%

A positive slope rises from left to right, a negative slope falls, a slope of 0 is a horizontal line, and a vertical line has an undefined slope.

Slope, angle and grade

Road signs and ramps usually give the slope as a grade in percent: a 10% grade rises 10 m over 100 m of horizontal distance, an angle of about 5.7°. A 100% grade is a 45° slope, not a vertical wall.

Examples

Example Result
(1, 2) and (3, 6) m = 4 / 2 = 2, y = 2x, angle ≈ 63.43°
(0, 3) and (2, −1) m = −2, y = −2x + 3
(2, 1) and (2, 5) Vertical line x = 2, slope undefined
A ramp rising 1 m over 12 m Grade ≈ 8.33%, angle ≈ 4.76°
Tips: Enter coordinates in the same units. If x₁ = x₂, the line is vertical and slope is undefined.

FAQ

For two distinct points (x₁,y₁) and (x₂,y₂), slope m = (y₂−y₁)/(x₂−x₁). A vertical line has undefined slope because x₂−x₁ = 0.

When the slope is defined, y = mx + b with b = y₁ − m x₁ describes the same line (one of many equivalent forms).

Take the arctangent: θ = arctan(m). A slope of 1 is 45°, and a slope of 0.5 is about 26.57°.

Grade is the slope written as a percentage: a slope of 0.08 is an 8% grade. Both mean rise divided by run.

A horizontal line has a slope of 0. A vertical line has an undefined slope because the run is zero; its equation is x = constant.

Slope is a ratio of vertical change to horizontal change in the same units; keep x and y in consistent units for interpretable results.

Need another tool?

Explore all 61 free tools: calculators, converters, date and time tools, random generators and text utilities.

Browse all tools