gizmobench
BrowseDaily

Slope Calculator

Find the slope of a line from two points, a rise and run, one point plus its slope, or the coefficients of an equation. The graph shows its rise-and-run triangle at equal scale on both axes. Read the slope, y-intercept, angle, percent grade and three equation forms, or switch to Grade & angle and Roof pitch for direct conversions. Each result has a copy button.

run 4rise 3(0, 0)(4, 3)
Two points · slope = rise / run0.75slope36.87° · 75% grade · distance 5
Mode
Point 1
Point 2

The line through (x₁, y₁) and (x₂, y₂). Slope is the rise between them over the run between them.

  • Sloperise / run
    0.75
  • Y-interceptb in y = mx + b
    0
  • Angledegrees above horizontal, arctan of the slope
    36.8698976458°
  • Percent gradeslope × 100
    75%
  • Distancebetween the two points, √(rise² + run²)
    5
  • Equationy = mx + b, to four places
    y = 0.75x + 0
  • Point-slope formusing the first point, coefficients to four places
    y - 0 = 0.75(x - 0)
  • Standard formAx + By = C, B normalized to 1; four places
    -0.75x + y = 0
  • Perpendicular slopenegative reciprocal, −1 / m
    -1.33333333333
  • Pitchrise per 12 of run
    9:12
The same line in several forms. Slope is rise divided by run. The angle is the arctangent of the slope, in degrees above horizontal, so 45 degrees is a slope of 1. Percent grade is the slope times 100, the number a road sign uses. Distance is the straight length between the two points, from Pythagoras. The equation is the slope-intercept form y = mx + b, with b where the line crosses the y axis. And a roof pitch is the same slope written as the rise per 12 of run, so 6:12 is a slope of 0.5, a 50% grade and an angle of 26.57 degrees. A vertical line has no slope at all: the run is 0, and the tool says so instead of printing infinity.

Common questions

Why does it say the slope is undefined?
Because the two points have the same x, so the line is vertical and the run between them is 0. Slope is rise divided by run, and dividing by 0 has no value, so a vertical line has no slope: it is not infinite, it is undefined. The tool says so and gives the line's equation in the only form it has, x = that number. A horizontal line is the opposite case: its rise is 0, so its slope is exactly 0 and its equation is y = a constant.
What is the difference between percent grade and degrees?
They measure the same tilt on different scales. Percent grade is the slope times 100: a rise of 3 over a run of 4 is a slope of 0.75 and a 75% grade. Degrees is the angle the line makes with horizontal, which is the arctangent of the slope: that same line sits at 36.87 degrees. The two are not proportional. A 100% grade is 45 degrees, not 90, and the grade climbs without limit as the angle nears 90. Road signs use percent; roofs and ramps are usually quoted in degrees or as a pitch.
How do I read a roof pitch like 6:12?
As the rise per 12 of run: a 6:12 roof climbs 6 inches for every 12 inches it goes across, which is a slope of 0.5, a 50% grade and an angle of 26.57 degrees. Switch to Roof pitch and type 6:12, 6/12 or just 6, and the tool gives all of those. Type an angle instead and it gives the pitch. A pitch typed with a different run, say 4:18, is kept as typed for the distance and rewritten as rise per 12 in the Pitch row.
What does a negative slope mean?
The line falls as you move to the right. From (0, 4) to (4, 0) the rise is -4 over a run of 4, so the slope is -1, the angle is -45 degrees and the grade is -100%. The sign only says which way the line leans; its steepness is the size of the number, so -1 is exactly as steep as 1. The order you type the points in does not matter: (4, 0) to (0, 4) is the same line and gives the same slope.
How does it find the slope-intercept form?
The slope m is (y₂ − y₁) / (x₂ − x₁), and the y-intercept b is y₁ − m × x₁. For (1, 1) and (4, 3), the Equation row reads y = 0.6667x + 0.3333. The Y-intercept row shows b separately. Equation coefficients round to four decimal places, so a very small nonzero coefficient can display as zero; use the separate numeric rows for more digits.
What is the distance row?
The straight-line length between the two points, from Pythagoras: the square root of rise squared plus run squared. A rise of 3 over a run of 4 gives a distance of exactly 5. In roof mode it is the length along the slope for the rise and run typed, so 6:12 gives 13.4164 in the same units as the 6 and the 12.
How do I convert percent slope to degrees, or degrees to percent?
Choose Grade & angle and enter the percent without the percent sign. The angle is arctan(percent / 100): a 2% slope is about 1.14576°, 5% is 2.86241°, and 100% is 45°. Choose Angle for the reverse direction; percent grade = 100 × tan(angle). The angle is measured from horizontal and must be between −90° and 90°; vertical slopes are undefined.
How do I calculate a 1 in 12, 1:20 or 1:100 slope?
In Rise and run, enter rise 1 and run 12, 20 or 100. A 1:12 rise-to-run ratio is 8.33333% and about 4.76364°; 1:20 is 5%, and 1:100 is 1%. Ratio notation can be ambiguous: if a drawing specifies horizontal:vertical rather than rise:run, reverse the entries. A 2:1 horizontal-to-vertical ratio means rise 1 and run 2, not rise 2 and run 1.
How do I convert an eighth of an inch per foot to slope?
Put rise and run in the same units. For 1/8 inch per foot, enter rise 0.125 and run 12 in Rise and run: the grade is 1.04167% and the angle is about 0.596809°. For a quarter inch per foot, use 0.25 and 12. Numeric fields accept decimals, not fraction expressions. These conversions describe supplied dimensions; they do not select a required drainage or ramp slope.
Can I find slope from a graph or a table?
Read two distinct points from a straight-line graph or two rows from a linear table, then enter their x and y values in Two points. The graph here displays the resulting line; it does not import or read a graph image. For more than two rows, first check that the rise divided by run stays constant. If the points are noisy, use Linear Regression Calculator for a fitted slope rather than treating one pair as the whole dataset.
How do I find a perpendicular slope?
The Perpendicular slope row gives −1 / m for a nonzero slope m. A slope of 2 has perpendicular slope −0.5. A horizontal line has a vertical perpendicular, whose slope is undefined. To write a perpendicular line through a particular point, put that reciprocal slope and the point into Point + slope.
Can this find the slope of a secant or tangent?
For a secant, calculate the two curve points first and enter them in Two points; the result is the average slope between them. This tool does not evaluate a function or differentiate it to find a tangent slope. Partial Derivative Calculator can produce a derivative formula; a numerical slope at a chosen point still requires evaluating that formula.

Double-precision geometry from your numbers. Equations round coefficients to four decimal places; other readings show up to twelve significant digits. This calculates a line's geometry, not structural capacity or construction compliance.