Slope Calculator

Find the slope between two points, with the angle and the line's equation.

Last updated 2026-11-27 · How we calculate this

Enter Two Points

How far across the first point is. Minus signs and decimals are fine.
How far up the first point is.
How far across the second point is. It must differ from x₁.
How far up the second point is.

Slope

Enter two points to see the slope.

The two points must have different x-values: a vertical line has no defined slope, and the page says so instead of giving a number. Each box accepts up to four decimal places. Results are rounded to four decimal places, and angles are measured from the horizontal, between −90° and 90°.

Quick Answer

Slope is rise over run: subtract the y-values, subtract the x-values in the same order, and divide. From (1, 2) to (5, 5) the rise is 5 − 2 = 3 and the run is 5 − 1 = 4, so the slope is 3 ÷ 4 = 0.75.

How to Use This Calculator

Enter two points on the line as x and y values: x is how far across and y is how far up. The calculator gives the slope as a decimal and as a fraction, the rise and run behind it, the angle the line makes with the horizontal, the percent grade used for roads and ramps, and the equation of the line in slope-intercept form. Decimals and negative numbers are fine.

  1. Enter x₁ and y₁ for the first point.
  2. Enter x₂ and y₂ for the second point.
  3. Read the slope, the angle and the percent grade.
  4. Use the equation of the line and the y-intercept for graphing.

The Formula

Slope m = (y₂ − y₁) ÷ (x₂ − x₁) · y-intercept b = y₁ − m × x₁

The rise is how far the line goes up (or down, when negative) between the two points, and the run is how far it goes across. Dividing rise by run gives the slope, the change in y for each 1 step in x. The angle comes from the inverse tangent of the slope, and the percent grade is the slope × 100. The y-intercept, where the line crosses the y-axis, is found by putting one point and the slope into y = mx + b.

Worked Example

From (1, 2) to (5, 5): rise 3, run 4, so the slope is 3/4 = 0.75. The angle is 36.8699°, the grade is 75%, and the line is y = 0.75x + 1.25.

From (−2, 7) to (3, −3): rise −10, run 5, so the slope is −2 and the line falls. The y-intercept is 3, giving y = −2x + 3.

A wheelchair ramp at the ADA maximum of 1 : 12 rises 1 inch for every 12 inches across. Its slope is 0.0833, a grade of 8.33% and an angle of 4.7636°.

From (2, 4) to (6, 4): the rise is 0, so the slope is 0 and the line is the horizontal line y = 4.

Frequently Asked Questions

What does a negative slope mean?

The line goes down as you read from left to right. A slope of −2 means y drops 2 for every 1 step to the right. In everyday terms it is a falling trend, such as a balance that shrinks each month or a road heading downhill.

Why is the slope of a vertical line undefined?

A vertical line has no run: both points have the same x-value, so the slope would mean dividing the rise by 0, which has no answer. A horizontal line is the opposite case, with a rise of 0 and a slope of exactly 0. Its equation is simply y = a number.

How do I turn a slope into an angle or a percent grade?

For percent grade, multiply the slope by 100, so 0.08 is an 8% grade. For the angle in degrees, take the inverse tangent (tan⁻¹ on a calculator) of the slope. The two are not proportional: a 100% grade is 45°, not 90°, because it means rising 1 for every 1 across.

What is slope-intercept form?

It is the equation y = mx + b, where m is the slope and b is the y-intercept, the y-value where the line crosses the vertical axis. Knowing both lets you draw the line straight away: start at b on the y-axis, then step across 1 and up m, again and again.

How does roof pitch relate to slope?

Roof pitch is written as rise per 12 inches of run, so a 6/12 pitch rises 6 inches for every 12 across. That is a slope of 0.5, a 50% grade and an angle of about 26.57°. Enter (0, 0) and (12, 6) to see any pitch this way.

Does it matter which point I enter first?

No, as long as you keep each point's x and y together. Swapping the points flips the sign of both the rise and the run, and the two minus signs cancel, so the slope is the same. Mixing them up, such as taking y₂ − y₁ but x₁ − x₂, gives the wrong sign.

Sources: OpenStax, Elementary Algebra 2e, 4.4 Understand Slope of a Line; U.S. Access Board, Guide to the ADA Standards, Chapter 4: Ramps and Curb Ramps