Math/Graph mode: slope from two points
Code check (optional)
Updates automatically as you type.
Calculated in your browser; your inputs are not sent to us. Privacy
Calculation details
Review the generated output before relying on it.
This tool runs in your browser. Your calculator inputs and results are never transmitted to us or to ad/affiliate partners. Ads and sponsored links may set third-party cookies to serve and measure them, but they never receive your calculation values. If you explicitly save a scenario, its permitted fields stay in local browser storage until you clear them. See our Privacy Policy.
Use this result
Share the current inputs or ask ChatGPT to explain the calculation in context.
More options
What does this calculator estimate?
Slope is rise over run: degrees = arctan(rise/run), percent = rise/run x 100. A 6/12 pitch is 26.57 degrees or 50 percent. Fill any two of rise, run, and slope and the third is solved. A 1:12 ADA ramp is 4.76 degrees or 8.33 percent, the maximum running slope. Run means horizontal distance, not diagonal surface length. Select the slope format that matches your measurement; percent grade and degrees are not interchangeable.
- Slope degrees = arctan(rise / run) x 180 / pi; slope percent = rise / run x 100 (Source: BoringToolsKit methodology)
- Enter any two of rise, run, and slope; the calculator solves the third (Source: BoringToolsKit methodology)
- The ADA maximum running slope is 1:12, which is 4.76 degrees or 8.33 percent; cross slope is limited to 1:48 (Source: United States Access Board)
- IRC minimum roof slopes: 2:12 for asphalt shingles (double underlayment below 4:12), 3:12 for lapped nonsoldered metal without lap sealant, 1/2:12 for lapped nonsoldered metal with lap sealant, and 1/4:12 for standing-seam systems. Manufacturer instructions and local amendments also apply (Source: ICC IRC R905).
- IPC Table 704.1 minimum drainage fall: 1/4 in per ft up to 2.5 in pipe, 1/8 in per ft for 3-6 in pipe, 1/16 in per ft for 8 in and larger (Source: ICC IPC)
- A 2 percent grade is exactly 0.24 inches per horizontal foot, approximately 1/4 inch per foot. Exactly 1/4 inch per foot is 2.0833 percent (Source: BoringToolsKit methodology).
- A 100 percent grade is 45 degrees because rise equals horizontal run; it does not mean a vertical surface (Source: BoringToolsKit methodology).

Measure rise and run in the field with a level, laser or string line
Start by choosing the direction you want to measure, such as down a proposed drain or across a ramp. Run is the horizontal separation of the endpoints, not the length of a tape laid against the sloping surface. With a spirit level, hold the reference horizontal and measure the vertical gap between its free end and the surface below. Use the horizontal measuring length as run and the gap as rise or fall. A taut string between stakes, checked with a line level, provides a similar reference over a longer distance. Keep the string from sagging and take measurements from consistent points on the stakes.
A laser level lets you compare endpoint elevations against a common horizontal plane without stretching a string across the work. If the laser setup stays fixed, the difference between staff readings gives the elevation change; measure horizontal run separately. Record which endpoint is higher before entering the values, because a larger staff reading usually means lower ground. For a 2 percent finish grade over 10 horizontal feet, the required drop is 2.4 inches. Check intermediate points as well as the endpoints: an average slope can be correct while a local hollow still holds water. Repeat the measurements after compaction or finishing, when the final surface elevation can differ from the initial layout.
Percent grade, degrees and drainage targets are different measurements
Percent grade describes vertical change for a given horizontal distance, while degrees describe the angle above horizontal. Their relationship is curved, so doubling the percent does not generally double the angle. A 25 percent grade is 14.04 degrees; a 100 percent grade is 45 degrees because rise and run are equal. A vertical line is not 100 percent: its run is zero and slope is undefined. Select the correct input format before copying a result from a drawing or digital level. The same distinction applies to roof pitch, where the number describes rise relative to a fixed horizontal run rather than an angle.
For drainage, direction and continuity matter alongside the calculated grade. Positive drainage away from a foundation means the finished surface falls toward an appropriate outlet instead of toward the wall. A typical 2 percent finish-grade target equals exactly 0.24 inches of fall per foot, often described approximately as 1/4 inch per foot. That rounded phrase actually represents 2.0833 percent, so it should not replace an exact limit. Nor is 2 percent a universal allowance beside a foundation: adopted grading rules, soil, paving and the drainage design can require something different. Surface grading and sanitary pipe fall are separate checks. For pipework, use the diameter-based IPC values rather than borrowing a landscaping target.
Read roof pitch as rise over 12, then check the roof covering
Roofers commonly express roof slope as rise per 12 units of horizontal run because the ratio can be measured with a level and ruler. A 6:12 roof rises 6 inches across 12 horizontal inches, giving 50 percent grade or 26.57 degrees. A 3:12 roof is 25 percent or 14.04 degrees. These are alternative descriptions of the same geometry, not different levels of precision or different roof types. Measuring along a rafter gives the diagonal length, which is longer than horizontal run and will understate slope if substituted into rise divided by run. State the ratio convention when sharing a measurement, particularly when older plans use pitch to mean rise divided by full span.
Roof-covering limits depend on the specific assembly, not a single rule for every material. IRC R905 permits asphalt shingles at 2:12 and steeper, with double underlayment below 4:12. For lapped nonsoldered metal, the cited minimum is 3:12 without applied lap sealant and 1/2:12 with applied lap sealant. Standing-seam systems have a separate 1/4:12 minimum in the cited provision. Do not confuse that standing-seam figure with the sealed-lap figure. Manufacturer instructions, approved assemblies and local amendments can impose additional restrictions. A slope check cannot confirm flashing, underlayment, fasteners or the suitability of a particular product, so compare the calculated pitch with the instructions for the actual roof system.
How this calculator works
Formula
degrees = arctan(rise / run) x 180 / pi; percent = rise / run x 100; slope length = sqrt(rise^2 + run^2). Reverse: rise = run x (percent / 100); run = rise / (percent / 100). From two points: m = (y2 - y1) / (x2 - x1). From percent to degrees: degrees = arctan(percent / 100) x 180 / pi. Roof rise per 12 units of horizontal run = 12 x rise / run. Inches of fall per horizontal foot = 12 x percent / 100.
Worked example
A 6 rise over a 12 run: 26.57 degrees, 50 percent, slope length 13.42. An ADA ramp at exactly 1:12: 4.76 degrees, 8.33 percent, verdict PASS. A 2:12 asphalt roof: MARGINAL, double underlayment required (IRC R905.2.2). A 4 in drain at 1/8 in per ft: PASS under IPC Table 704.1. Points (0,2) to (4,0): slope -0.5, y = -0.5x + 2. A 2 percent finish grade over 10 horizontal feet needs 2.4 inches of fall. A 25 percent grade is 14.04 degrees and 3:12 roof pitch. A 100 percent grade is 45 degrees and 12:12 roof pitch.
Sources
- United States Access Board — ADA accessibility standards: ramp slope
- BoringToolsKit — Calculation methodology
- United States Department of Justice — 2010 ADA Standards for Accessible Design, ramp running slope and cross slope
- International Code Council — International Plumbing Code, Table 704.1: slope of horizontal drainage piping
- International Code Council — 2021 International Residential Code, R905: requirements for roof coverings
Assumptions to verify
- Run is the horizontal distance; rise is vertical. Slope length is the hypotenuse of the two.
- Rise and run are converted to the same units before computing; mixed units are supported.
- Code verdicts cover the slope criterion only; they do not establish full compliance (ADA cross slope, landings, materials, and local amendments are separate).
- Driveway and road figures are typical guidance ranges, not legal limits; local rules govern.
- Roof pitch is expressed here as rise per 12 units of horizontal run, the common roofing convention; historic geometric pitch can instead refer to rise divided by full span.
- A typical 2 percent finish-grade target is not a universal foundation-drainage requirement, an ADA cross-slope allowance or a substitute for a drainage design.
- Fall describes the magnitude of a drop in the intended drainage direction; coordinate-mode slope retains its mathematical sign.
Frequently asked questions
How do you convert percent slope to degrees?
degrees = arctan(percent / 100), with the inverse tangent evaluated in degree mode. If your calculator returns radians, multiply by 180/pi. A 25 percent grade is arctan(0.25) = 14.04 degrees; 100 percent is 45 degrees, not 90.
What is a 1:12 ADA ramp slope in degrees and percent?
arctan(1/12) = 4.76 degrees, or 8.33 percent. It is the ADA maximum running slope for new construction; cross slope is limited to 1:48.
How much fall per foot does a drain pipe need?
IPC Table 704.1: 1/4 in per foot for pipe up to 2.5 in, 1/8 in per foot for 3-6 in pipe, and 1/16 in per foot for 8 in and larger.
Is run the horizontal distance?
Yes. Run is measured horizontally; rise is vertical. The diagonal is the slope length, sqrt(rise^2 + run^2), which this calculator also reports.
How do I calculate slope from two points?
m = (y2 - y1) / (x2 - x1). Example: (0,2) to (4,0) gives (0-2)/(4-0) = -0.5, which is -50 percent or -26.57 degrees. Vertical lines (same x) have an undefined slope.
What pitch is 25 percent?
A 25 percent grade rises 1 unit per 4 units of run, which is a 3:12 pitch and arctan(0.25) = 14.04 degrees.
How do I measure slope with a level or string line?
Hold a level horizontally with one end touching the higher point and measure the vertical gap at the lower end. Divide that gap by the horizontal measuring length, using matching units. A taut string leveled between stakes provides the same horizontal reference. Do not use diagonal ground distance as run.
Is 2 percent slope the same as 1/4 inch per foot?
Approximately, not exactly. A 2 percent slope is 0.24 inches per horizontal foot; 1/4 inch per foot is 2.0833 percent. Over 10 horizontal feet, a 2 percent grade drops 2.4 inches. Use the exact required ratio when checking a code limit rather than a rounded percentage.
Why is a 100 percent grade only 45 degrees?
Percent grade divides rise by horizontal run and multiplies by 100. Equal rise and run therefore give 100 percent, while arctan(1) gives 45 degrees. As a line approaches vertical, its horizontal run approaches zero and its grade grows without bound. A vertical line has undefined slope.
What slope should ground have away from a foundation?
The surface should carry water away from the building toward an appropriate outlet, without low spots that trap it. A 2 percent finish grade is a common planning target for some surfaces, not a universal foundation requirement. Check locally adopted grading rules, surface material and the site drainage plan; foundation-adjacent soil can require a steeper fall.
Why do roofers use pitch instead of degrees?
Rise per 12 units of horizontal run can be checked directly with a level and ruler and compared with roof-covering instructions. A 6:12 roof rises 6 inches over 12 horizontal inches, equivalent to 50 percent or 26.57 degrees. The same roof must not be entered as 6 degrees or 6 percent.
Cite this tool
BoringToolsKit. “Slope Calculator.” boringtoolskit.com/slope-calculator/. Free to reference in articles, syllabi, and answer posts with a link.
Privacy: Inputs and results stay in this browser. Any future sponsored recommendation or advertisement will be clearly labeled and kept separate from the calculation.