Skip to content

Slope Calculator

Calculate slope, angle, distance, and line equation from two points or a point and slope. Includes visual graph.

Slope (m) = 1
y = x - 1
Δx
4
Δy
4
Angle (θ)
45°
Distance
5.6569
Y-Intercept
-1
Grade (%)
100%
(3, 2)(7, 6)

Slope Formula

The slope of a line through two points (x1, y1) and (x2, y2) is:

m = (y2 - y1) / (x2 - x1) = Δy / Δx

Slope is also equal to the tangent of the angle of incline: m = tan(θ)

Types of Slope

  • Positive slope: Line rises from left to right (m > 0)
  • Negative slope: Line falls from left to right (m < 0)
  • Zero slope: Horizontal line (m = 0)
  • Undefined slope: Vertical line (Δx = 0)

Slope-Intercept Form

The equation of a line in slope-intercept form is y = mx + b, where:

  • m = slope of the line
  • b = y-intercept (where the line crosses the y-axis)

Given slope m and a point (x1, y1), find b: b = y1 - m · x1

Point-Slope Form

An alternative form using a known point and slope:

y - y1 = m(x - x1)

Distance Between Two Points

The distance between (x1, y1) and (x2, y2) uses the Pythagorean theorem:

d = √(Δx² + Δy²)

Percent Grade

Grade is slope expressed as a percentage, commonly used for roads, ramps, and construction:

Grade (%) = (rise / run) × 100 = slope × 100

  • A 5% grade rises 5 feet for every 100 feet horizontally
  • ADA-compliant ramps require a maximum 8.33% grade (1:12 ratio)
  • Steep roads are typically 6-10% grade

Grade, Angle, and Ratio Conversion Table

Slope is expressed three ways in the real world: percent grade, angle in degrees, and the "1 in N" ratio. This table converts between them for common values, with a note on where each shows up.

Grade (%)AngleRatio (1:N)Typical Context
1%0.6°1:100Minimum drainage fall for patios and pipes
2%1.1°1:50Maximum cross slope for accessible paths
3%1.7°1:33Gentle graded road
4%2.3°1:25Easy walking ramp
5%2.9°1:20Max walkway grade before a ramp is required
6%3.4°1:16.7Interstate highway maximum sustained grade
7%4.0°1:14.3Steep mountain road
8.33%4.8°1:12Maximum ADA wheelchair ramp
10%5.7°1:10Steep hill, low gear for trucks
15%8.5°1:6.7Very steep driveway
20%11.3°1:5Steep ski run or hiking trail
25%14.0°1:4Severe grade, rare on public roads
50%26.6°1:2Moderate roof pitch
100%45.0°1:1Rise equals run — a true 45 degree slope

Understanding the Terms

Rise

The vertical change between two points — how far the line goes up or down. In the slope fraction it is the numerator, the change in y.

Run

The horizontal change between the same two points — how far the line travels sideways. It is the denominator of the slope, the change in x.

Gradient

Another name for slope, common in engineering and geography. A gradient can be stated as a decimal, a percent grade, or a ratio, but all describe rise over run.

Y-Intercept

The point where the line crosses the vertical axis, the b in y = mx + b. It is the value of y when x equals zero.

Percent Grade

Slope written as a percentage, found by multiplying rise over run by 100. Road signs and ramp codes use grade because it is easy to read at a glance.

Example

Find the slope between (3, 2) and (7, 6):

  • Δx = 7 - 3 = 4
  • Δy = 6 - 2 = 4
  • m = 4 / 4 = 1
  • θ = arctan(1) = 45°
  • d = √(16 + 16) = 5.6569
  • y-intercept: b = 2 - 1(3) = -1
  • Equation: y = x - 1

Related Math Calculators

Related Calculators

Frequently Asked Questions

What is slope?

Slope measures the steepness and direction of a line. It is the ratio of vertical change (rise) to horizontal change (run) between two points: m = (y2 - y1) / (x2 - x1).

What does a negative slope mean?

A negative slope means the line goes downward from left to right. A positive slope goes upward, zero slope is horizontal, and undefined slope is vertical.

How do I find the equation of a line?

Use slope-intercept form: y = mx + b, where m is the slope and b is the y-intercept. Calculate m from two points, then solve for b by substituting one point.

What is percent grade?

Percent grade is slope expressed as a percentage: grade = slope × 100. A 6% grade means the surface rises 6 feet for every 100 feet of horizontal distance.

What is the slope of a horizontal line?

A horizontal line has slope 0. The rise (change in y) is zero while the run (change in x) is non-zero, so m = 0 / run = 0.

How can I tell if two lines are parallel?

Two lines are parallel when they have equal slopes and different y-intercepts. For example, y = 3x + 1 and y = 3x - 5 are parallel because both have slope 3.

What is the slope of a line perpendicular to slope 2?

Perpendicular slopes are negative reciprocals. A line with slope 2 is perpendicular to a line with slope -1/2. Multiply the two slopes together and you get -1.

How do I find slope from a standard-form equation like 3x + 4y = 12?

Rearrange into slope-intercept form y = mx + b. Subtract 3x from both sides: 4y = -3x + 12, then divide by 4: y = (-3/4)x + 3. The slope is -3/4.