Percentages and Math

Slope Calculator

Find slope from two points, a rise and run, an angle or a percent grade, with the line equation, grade, angle and exact fraction.

Your numbers

You know

Result

Slope (m)

2

Rises left to right

Slope (m = rise / run)
2
Slope as a fraction
2
Percent grade
200%
Angle from horizontal
63.4349 degrees
Rise per 12 of run
24
Distance between points
8.944272
Midpoint
(3, 6)
Line equation
y = 2x
y-intercept
0
x-intercept
0
How this was calculated
  1. Slope = rise / run = 8 / 4 = 2.
  2. Angle = arctan(slope) = 63.4349 degrees. Percent grade = slope x 100 = 200%.
  3. y-intercept: b = y1 - m x1 = 2 - 2 x 1 = 0.
  4. Distance = sqrt(dx^2 + dy^2) = sqrt(4^2 + 8^2) = 8.944272.

Calculated using SumPanda.com · https://sumpanda.com/slope-calculator/

Results are estimates for general information. Verify important figures before relying on them.

Next step

How to use the slope calculator

  1. Choose what you know: two points, a rise and run, an angle of incline, or a percent grade.
  2. Enter the values. For two points, type x1, y1, x2 and y2. Negative numbers and decimals are fine.
  3. Read the slope, the exact fraction when one exists, the percent grade and the angle from horizontal.
  4. In two-point mode you also get the line equation, both intercepts, the distance between the points and the midpoint.

Formula

Slope m = rise / run = (y2 - y1) / (x2 - x1)

Percent grade = m x 100

Angle = arctan(m)

Line equation: y = m x + b, where b = y1 - m x1

Distance = sqrt((x2 - x1)^2 + (y2 - y1)^2)

A vertical line has run 0, so its slope is undefined. The exact fraction is reduced with whole-number arithmetic on the digits you typed, so 0.3 over 0.2 is exactly 3/2 with no floating-point drift.

Worked example

For the points (1, 2) and (5, 10), the rise is 8 and the run is 4, so the slope is 2. That is a 200 percent grade and an angle of 63.4349 degrees.

The y-intercept is 2 - 2 x 1 = 0, so the line is y = 2x, the distance between the points is sqrt(80) = 8.944272, and the midpoint is (3, 6).

For the points (0, 4) and (2, 0), the slope is -2 and the line is y = -2x + 4, which crosses the x-axis at 2. A rise of 0.3 over a run of 0.2 gives the exact fraction 3/2, and a grade of 25 percent equals the fraction 1/4 and an angle of 14.0362 degrees.

Slope, grade and angle

Slope is a ratio. A slope of 1 rises one unit for every unit of run and is a 45 degree angle. Roads and ramps often use percent grade, which is the slope times 100, while roofs use rise per 12 inches of run, shown here as "Rise per 12 of run". For roof pitch with materials, see the roofing calculator.

Special cases

The tool handles the edge cases that trip up quick formulas.

  • Vertical lines (run of 0) report an undefined slope and the equation x = constant, with no y-intercept, instead of dividing by zero.
  • Horizontal lines have slope 0 and equation y = constant.
  • Two identical points are rejected, because they do not define a line.
  • Angles of incline must be between -89.99 and 89.99 degrees, since 90 degrees is vertical.

Related tools

The Pythagorean theorem calculator finds the length of a sloped side from rise and run, and the triangle calculator solves a full triangle.

Assumptions and limits

  • Coordinates and distances can be in any consistent unit, and the result has no unit for slope and angle.
  • Values are limited to a magnitude of 1e12 so that arithmetic stays exact and readable.
  • Decimal values are read as typed (no exponent notation) and the exact fraction uses up to the digits provided.
  • Angles are in degrees measured from the positive x-axis, with negative values for downward slopes.
  • Everything runs in your browser. Nothing you enter is sent anywhere.

Formulas reviewed October 10, 2026. See the calculation methodology for how SumPanda rounds, tests and sources its formulas.

Frequently asked questions

How do you find the slope between two points?

Subtract the y values to get the rise, subtract the x values to get the run, and divide. For (1, 2) and (5, 10) that is 8 divided by 4, which is 2. The order of the points does not matter if you use the same order for both differences.

What is the slope of a vertical line?

It is undefined, because the run is zero and division by zero has no value. The calculator says so and gives the line as x equals a constant.

How do I convert slope to percent grade?

Multiply the slope by 100. A slope of 0.25 is a 25 percent grade, which corresponds to an angle of about 14.04 degrees.

What does a negative slope mean?

The line falls as you move to the right. The angle is negative and the percent grade is negative as well.

What is the difference between slope and angle?

Slope is rise over run. Angle is the inverse tangent of the slope. A 100 percent grade is a slope of 1 and a 45 degree angle, while angles grow more slowly than grade at steep inclines.