Choose how to enter the slope and enter a value. The run and rise below can be left blank (if you enter one, the rise, run and length along the slope for it are calculated too).
Table of Contents
-
What you can do on this page
-
What is this calculation used for?
-
How to Use
-
Formulas and figures
-
Symbols and terms
-
Good to know before you start
-
How to calculate it in Excel
-
How to calculate it in Google Sheets
-
How to calculate it in Python
-
How to write it in LaTeX and other math languages (copy and paste)
-
How to have ChatGPT do the calculation
-
DataChef Features
-
Related Features
-
NumberChef Calculators List
What you can do on this page
- Enter a slope in any one form, as a percent grade (%), an angle (degrees), a roof pitch (x/12), a ratio (1/12, 1/48 and so on) or a rise and run, and all the other forms are calculated at once
- Enter a run (horizontal distance), and you get the rise at that slope and the length along the slope (the length of material you actually need)
- Enter a rise, and you get the run needed to reach it at that slope (the length of a ramp or a pipe)
- The slope is drawn as a right triangle, so you can see where the run, rise, sloped side and angle are
- A plain-language explanation of the formulas and copy-and-paste formulas for Excel, Google Sheets and Python are all on this page
What is this calculation used for?
Under the ADA Standards for Accessible Design, a ramp's running slope may be no steeper than 1:12 (1 in of rise for every 12 in of run). To climb a 24 in rise at this slope, the run needed is \(24 \times 12 = 288\) in (24 ft), and the ramp surface is about 24.08 ft long.
If there is not enough room, a steeper 1:8 slope would need only 16 ft, but the angle becomes about 7.1° and the ADA allows it only in limited cases (existing sites with a rise of 3 in or less). The right slope depends on the use, the users and the rules that apply, so for public facilities check the ADA Standards and your local building code with an architect.
Drain pipes and yard drains need a gentle downward slope so water flows by itself. US plumbing codes commonly require at least 1/4 in per foot for drain pipes 3 in or smaller, which is 1/48, or about 2.08%. For 10 ft of pipe, the two ends need a drop of \(10 \times 0.25 = 2.5\) in.
The longer the pipe, the more drop it needs, so checking "is the outlet low enough?" before you lay the pipe prevents finding out after backfilling that the slope is too flat. The right slope depends on the pipe size and use, so follow your local plumbing code and the manufacturer's instructions.
US roofs are described by pitch, such as a "6/12 pitch" (rising 6 in for every 12 in of run). As an angle that is \(\arctan 0.5 \approx 26.57^\circ\), and as a percent grade it is 50%.
For a shed roof with an 8 ft run at a 4/12 pitch, the rise is \(8 \times 4 \div 12 \approx 2.67\) ft (32 in), and the length along the roof (a guide to the rafter length) is \(\sqrt{8^{2} + 2.67^{2}} \approx 8.43\) ft. Each roofing material has a minimum slope; asphalt shingles, for example, need at least 2/12, with extra underlayment below 4/12. Converting the slope before choosing materials speeds up planning.
A "6% grade" sign means a hill that rises 6 ft for every 100 ft of horizontal distance, which is only about 3.4°. A 10% grade is about 5.7°, not 10°. On a bicycle, grades of 8–10% feel quite steep, so this helps when choosing a route.
Railways in Europe and Japan give grades in per mille (‰); 25‰ rises 25 m for every 1,000 m (2.5%, about 1.4°). US railroads use percent, and a main line grade of about 2% is already considered steep. The angle is small, but for a heavy train it is a big load, which is why railways measure grades so finely.
Patios and driveways are usually finished with a slight slope so rainwater does not puddle; about 1/4 in per foot (about 2%) is a common guide. A 10 ft deep patio at this slope drops \(10 \times 0.25 = 2.5\) in from front to back. The International Residential Code also asks the ground to fall at least 6 in within the first 10 ft away from a house foundation (5%).
On the other hand, a walkway or driveway that is too steep gets slippery in the rain or scrapes the bottom of cars, so check the slope (as a percent and an angle) from the rise and run before you design it.
A slope is "height ÷ base", which is exactly \(\tan\theta\) of a right triangle. Finding "what angle is a 1:12 slope?" is one of the most everyday uses of the inverse trigonometric function \(\arctan\) from high school math.
Finding the length along the slope from the run and rise is the Pythagorean theorem from middle school. Check for yourself that the formulas in your textbook connect to the real sizes of ramps and roofs.
Formulas and figures
Symbols and terms
Symbols
| \(i\) | eye | The slope (rise ÷ run). It is said to come from the first letter of "inclination", and civil engineering drawings sometimes write slopes as \(i\). It is a plain number with no unit, equal to \(\tan\theta\). |
| \(h\) | aitch | The rise. From the first letter of "height". It is, for example, the height of a step, the height of a roof from eave to ridge, or the difference in height between the two ends of a pipe. |
| \(L\) | ell | The run (horizontal distance). This page uses the first letter of "length". It is the length of the slope seen from directly above, not the length along the slope (\(s\)). |
| \(p\) | pee | The percent grade. From the first letter of "percent". \(p = i \times 100\) means "it rises \(p\) for every 100 of run". |
| \(x\) | ex | The roof pitch. \(x = i \times 12\) means "it rises \(x\) for every 12 of run", written x/12 (for a 6/12 pitch, \(x = 6\)). |
| \(n\) | en | The denominator of the ratio \(1/n\). \(n = L \div h = 1 \div i\) means "it rises 1 for every \(n\) of run" (for 1:12, \(n = 12\)). |
| \(\theta\) | theta | The angle of the slope from the horizontal (the angle of inclination). The Greek letter theta, often used for angles. Found with \(\theta = \arctan i\). |
| \(s\) | ess | The length along the slope (the hypotenuse). This page uses the first letter of "slope". Found with \(s = \sqrt{L^{2} + h^{2}}\). |
| \(\tan\) | tangent | The tangent, the value "height ÷ base" of a right triangle. The slope \(i\) is exactly \(\tan\theta\). |
| \(\arctan\) | arctangent, inverse tangent | The arctangent. It returns "the angle whose \(\tan\) is this value", and is also written \(\tan^{-1}\). Use it to find the angle from a slope. |
| \(\sqrt{\ }\) | square root | The square root, "the positive number that gives this number when squared". It is used to find the hypotenuse with the Pythagorean theorem (example - \(\sqrt{25} = 5\)). |
| \(\approx\) | approximately equal to | The symbol for "approximately equal". It is used when a value that does not divide evenly, or the result of \(\arctan\), is rounded to a decimal. |
Terms
| slope | How much it goes up (or down) for the horizontal distance covered, found as rise ÷ run. The same slope can be shown in many forms, as a percent grade (%), a roof pitch (x/12), per mille (‰), a ratio (1/n) or an angle (°). |
| rise | The height difference between the start and end of a slope, such as the height of a step, the height of a roof from eave to ridge, or the difference in height between the inlet and outlet of a pipe (also called the fall or drop). |
| run | The horizontal distance from the start to the end of a slope, seen from directly above. It is always shorter than the length measured along the slope. In slope calculations, the rise is divided by this run. |
| hypotenuse | The longest side of a right triangle, opposite the right angle. In a slope diagram it is the slope itself, and its length is the length along the slope. |
| length along the slope | The actual length measured along the slope (the length of the hypotenuse). It is the length of material you actually need, such as ramp boards, roof rafters and pipe. It is found from the run and rise with the Pythagorean theorem. |
| percent grade | A way to give a slope as "how much it rises for every 100 of run". It is used on road signs (such as "6% grade") and in site grading plans. Slope × 100. |
| per mille | Parts per thousand (symbol ‰). Railways in Europe and Japan give grades such as "25‰", which rises 25 m for every 1,000 m of run. Slope × 1000 (25‰ = 2.5%). |
| roof pitch | The US way to give roof slopes, as the rise in inches for every 12 in (1 ft) of run, written x/12 or "x in 12". A 4/12 pitch is 33.3% (about 18.4°) and a 6/12 pitch is 50% (about 26.6°). Since it is a ratio, it works the same whatever the size of the roof. |
| 12/12 pitch | A roof pitch that rises 12 for every 12 of run. The angle is 45° and the percent grade is 100%. |
| slope ratio | A way of writing a slope that rises 1 for every n of run as 1/n (or 1:n), as in a 1:12 ramp or a 1/48 drain (1/4 in per foot). The larger n is, the gentler the slope. |
| angle of inclination | The angle of a slope from the horizontal. It is the slope given as an angle (°), found from the slope \(i\) with \(\arctan\). Note that percent grade and angle are not proportional (10% is about 5.7°, but 100% is 45°). |
| tangent | The trigonometric ratio \(\tan\). It is "height ÷ base" of a right triangle, which is the slope itself. |
| arctangent | The inverse of \(\tan\) (\(\arctan\)). It returns "the angle whose \(\tan\) is this value". On a scientific calculator it is the \(\tan^{-1}\) key, and in Excel it is the ATAN function. |
| Pythagorean theorem | The theorem that in a right triangle, base squared + height squared = hypotenuse squared. It is used to find the length along the slope from the run and rise. |
| drainage slope | A gentle slope given to floors, the ground and pipes so that water flows away by itself. In the US it is often given in inches per foot, such as 1/4 in per foot for small drain pipes and patios (about 2%). |
Good to know before you start
Here is what helps you use the calculation on this page with real understanding, not just by pressing the button.
If you get stuck, going back over these topics is the quickest way forward.
| Ratios and percents (Grade 6) |
|
| Fractions, decimals and reciprocals (Grades 5–6) |
|
| Converting units of length (Grades 4–5) |
|
| Right triangles and the Pythagorean theorem (Grade 8) |
|
| Trigonometry, tan and inverse trig functions (Geometry, Precalculus) |
|
How to calculate it in Excel
| Rise h (in) | 24 |
| Run L (in) | 288 |
| Slope i | =B1/B2 |
| Slope i | 0.5 |
| Percent grade p (%) | =B1*100 |
| Roof pitch x (x/12) | =B1*12 |
| Per mille (‰) | =B1*1000 |
| Rise h (in) | 24 |
| Run L (in) | 288 |
| Denominator n (slope 1/n) | =B2/B1 |
| Slope i | =1/12 |
| Angle θ (°) | =DEGREES(ATAN(B1)) |
| Rise h (ft) | 2 |
| Slope i | =1/12 |
| Run L (ft) | =B1/B2 |
| Length along the slope s (ft) | =SQRT(B3^2+B1^2) |
B3 of the first table is about 0.0833 (= 1/12), the second table gives 50, 6 and 500, B3 of the third table is 12, and B2 of the fourth table is about 4.76.
"ATAN" is the function for the arctangent (arctan). It returns the answer in radians, so "DEGREES" turns it into degrees. "SQRT" is the square root and "^2" means squared.
The fifth table finds the run of 24 ft as "rise ÷ slope" and the length along the slope, about 24.08 ft, with the Pythagorean theorem. To find the rise from a run instead, change the formula in B3 to "=run*B2".
How to calculate it in Google Sheets
| Rise h (in) | 24 |
| Run L (in) | 288 |
| Slope i | =B1/B2 |
| Slope i | 0.5 |
| Percent grade p (%) | =B1*100 |
| Roof pitch x (x/12) | =B1*12 |
| Per mille (‰) | =B1*1000 |
| Rise h (in) | 24 |
| Run L (in) | 288 |
| Denominator n (slope 1/n) | =B2/B1 |
| Slope i | =1/12 |
| Angle θ (°) | =DEGREES(ATAN(B1)) |
| Rise h (ft) | 2 |
| Slope i | =1/12 |
| Run L (ft) | =B1/B2 |
| Length along the slope s (ft) | =SQRT(B3^2+B1^2) |
How to calculate it in Python
import math
rise = 2 # rise h (ft)
run = 24 # run L (ft)
gradient = rise / run # slope i (= tan θ)
percent = gradient * 100 # percent grade (%)
permille = gradient * 1000 # per mille (‰)
pitch = gradient * 12 # roof pitch (x/12)
denominator = run / rise # the n in the ratio 1/n
angle_deg = math.degrees(math.atan(gradient)) # angle (°). atan returns radians, so convert to degrees
hypotenuse = math.sqrt(run ** 2 + rise ** 2) # length along the slope (ft)
print(f"Slope: {gradient:.4f}")
print(f"Percent grade: {percent:.2f} %")
print(f"Per mille: {permille:.2f} ‰")
print(f"Roof pitch: {pitch:.2f}/12")
print(f"Ratio: 1/{denominator:.1f}")
print(f"Angle: {angle_deg:.2f} °")
print(f"Length along the slope: {hypotenuse:.3f} ft")
# The other way around: the run needed from a slope and a rise
target_gradient = 1 / 12 # target slope (1:12)
rise2 = 2 # rise (ft)
run2 = rise2 / target_gradient
print(f"Run needed to climb {rise2} ft at a 1:12 slope: {run2:.3f} ft")
How to write it in LaTeX and other math languages (copy and paste)
i = h ÷ L
i = \frac{h}{L}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>i</mi>
<mo>=</mo>
<mfrac><mi>h</mi><mi>L</mi></mfrac>
</mrow>
</math>
i = h / L
h/L
i := h/L;
i = h/L;
i = h/L
p = i × 100, x = i × 12
p = 100\,i,\quad x = 12\,i
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>p</mi><mo>=</mo><mn>100</mn><mo>⁢</mo><mi>i</mi>
<mo>,</mo>
<mi>x</mi><mo>=</mo><mn>12</mn><mo>⁢</mo><mi>i</mi>
</mrow>
</math>
p = 100 i, x = 12 i
{100*i, 12*i}
p := 100*i; x := 12*i;
p = 100*i; x = 12*i; % i is the slope (run i = h/L; first)
p = 100i, x = 12i
n = L ÷ h
n = \frac{L}{h}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>n</mi>
<mo>=</mo>
<mfrac><mi>L</mi><mi>h</mi></mfrac>
</mrow>
</math>
n = L / h
L/h
n := L/h;
n = L/h;
n = L/h
θ = arctan(i)
\theta = \arctan i
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>θ</mi>
<mo>=</mo>
<mi>arctan</mi>
<mo>⁡</mo>
<mi>i</mi>
</mrow>
</math>
theta = arctan(i)
ArcTan[i]*180/Pi
theta := arctan(i)*180/Pi;
theta = atand(i); % i is the slope (run i = h/L; first)
θ = tan^(-1)(i)
h = L × i, L = h ÷ i, s = √(L² + h²)
h = L\,i,\quad L = \frac{h}{i},\quad s = \sqrt{L^{2} + h^{2}}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>h</mi><mo>=</mo><mi>L</mi><mo>⁢</mo><mi>i</mi>
<mo>,</mo>
<mi>L</mi><mo>=</mo><mfrac><mi>h</mi><mi>i</mi></mfrac>
<mo>,</mo>
<mi>s</mi><mo>=</mo>
<msqrt><msup><mi>L</mi><mn>2</mn></msup><mo>+</mo><msup><mi>h</mi><mn>2</mn></msup></msqrt>
</mrow>
</math>
h = L i, L = h / i, s = sqrt(L^2 + h^2)
{L*i, h/i, Sqrt[L^2 + h^2]}
h := L*i; L := h/i; s := sqrt(L^2 + h^2);
h = L*i; L = h/i; s = sqrt(L^2 + h^2); % i is the slope (run i = h/L; first)
h = Li, L = h/i, s = √(L^2 + h^2)
How to have ChatGPT do the calculation
You are a slope calculation assistant for construction and civil engineering. Do the following calculation by actually running Python code, and base your answer only on the numbers from the execution result (do not answer by mental math or guessing). A ramp climbs a rise of 24 in over a run of 24 ft. Find each of the following: 1. The slope (rise ÷ run, with both in the same units) 2. The percent grade (%), per mille (‰) and roof pitch (x/12) 3. The n in the ratio 1/n 4. The angle (degrees; use arctan and convert radians to degrees) 5. The length along the slope (Pythagorean theorem) Show the formulas you used and the numbers from the execution result.
How to Use
-
1Enter your numbersType the numbers you want to calculate with into the input fields
-
2CalculatePress the "Calculate" button
-
3Check the resultThe result appears on the spot. The same page also explains the idea behind the calculation and the formula
DataChef Features
No technical knowledge required.
Intuitive and user-friendly operation.
Can be used without registering personal information.
Automatic file deletion by clicking "download".
and rapid file conversion.
No attribution required.
No need to contact us for commercial use permission.
