What this calculator does
Find out how steep a roof is in every common form, and how long its rafters need to be. In North America, roofers describe steepness as a pitch. That's how many inches the roof rises for every 12 inches it runs across, written as 4/12, 6/12 or 12/12. Engineers and product sheets often use an angle in degrees instead. Some plans give the slope as a percentage.
All three describe the same steepness. They convert into one another through the tangent of the roof angle, which is just the rise divided by the run.
Enter any of the three, or a rise and run you measured. The calculator gives you the others, plus the pitch factor. That's the number that turns the flat area a roof covers into its true sloped surface area.
Add the building's width and the eave overhang to get the rafter length for a gable roof (two equal slopes meeting at a center ridge). These numbers are estimates for planning. Local building codes and the roofing maker's instructions set rafter sizes, spans and the lowest pitch each roofing material allows.
Where it's used
Why this math matters outside the classroom:
- Pitch to angle. A 6/12 roof rises 6 in per 12 in of run, which is arctan(0.5) ≈ 26.6°.
- Rafter length. With a 24 ft span each side runs 12 ft, so a 6/12 rafter is √(12² + 6²) ≈ 13.4 ft before overhang.
- Slope percent. A 4/12 pitch is a 33.3% slope, the form some product specifications use for a minimum roof slope.
- Solar panels. Solar installers convert a roof's pitch to degrees to know the tilt of panels mounted flush to it.
- Shed building. DIY shed builders pick a pitch, then use the rafter length to choose which lumber length to buy.
Grade level and standards: Grades 9–10; Common Core State Standards for Mathematics HSG.SRT.C.8. © Copyright 2010. National Governors Association Center for Best Practices and Council of Chief State School Officers. All rights reserved.
How to use it
- Choose whether you know the pitch, the angle, the slope percentage or a rise and run.
- Enter that value.
- To get the rafter length, leave the rafter box ticked. Then enter the building span and how far the eave sticks out, measured flat. Untick the box to convert only.
- Read the pitch, angle, slope, pitch factor and rafter length.
What the inputs mean
- Pitch: rise per 12 of run
- For a 6/12 roof enter 6.
- Rise
- Measure the rise and run in the same unit. Here's a quick way: hold a level flat against the rafter and mark 12 in along it. Then measure straight up from that mark. That number is the pitch.
- Building span (wall to wall)
- The full width the roof covers, from the outside of one wall to the outside of the other. On a gable roof, each rafter covers half of it.
- Eave overhang (horizontal)
- How far the eave sticks out past the wall, measured flat. The calculator turns it into a sloped length with the same pitch factor.
Formula and method
pitch = 12 × rise ÷ run = 12 × tan(angle) = 12 × slope % ÷ 100 angle = arctan(pitch ÷ 12) slope % = pitch ÷ 12 × 100 pitch factor = √(1 + (pitch ÷ 12)²) rafter length = (span ÷ 2 + overhang) × pitch factor
Rise is how far the roof goes up, and run is how far it goes across. Rise divided by run is the tangent (tan) of the roof angle, so every conversion goes through that one number. Arctan works backward, turning that number into an angle. Slope percent is the same number times 100, and the pitch is the same number times 12.
The pitch factor is how long the sloped line is for each foot it runs across. It comes from the Pythagorean theorem, the rule for the sides of a right triangle. Multiply a flat run by it to get the sloped length. Multiply the flat area a roof covers by it to get the roof's surface area. The span is the full width of the building, and the overhang is how far the eave sticks out.
Worked example
A gable roof has a 6/12 pitch, spans 24 ft wall to wall and has a 1 ft horizontal overhang.
- Angle: arctan(6 ÷ 12) = 26.57°.
- Slope: 6 ÷ 12 × 100 = 50%.
- Pitch factor: √(1 + 0.5²) = 1.1180.
- Rafter run: 24 ÷ 2 = 12 ft; the ridge sits 12 × 0.5 = 6 ft above the wall plates.
- Rafter length: (12 + 1) × 1.118034 = 14.534 ft, or about 174.41 in.
Result: A 6/12 roof is 26.57° or 50% slope, and each rafter is about 14.53 ft long including the overhang.
Understanding the result
Low pitches, below about 4/12, limit which roofing materials you can use. Very low slopes need membrane systems (continuous waterproof sheets). Pitches above about 9/12 are usually too steep to walk on safely without staging (a work platform).
To estimate roof area, multiply the flat area the roof covers, including overhangs, by the pitch factor. A 6/12 roof has about 11.8% more surface than the ground area it covers.
Assumptions and limitations
- Both sides of the gable have the same pitch, and the ridge sits in the middle of the span.
- The overhang is measured flat, from the face of the wall to the end of the rafter tail.
- The rafter length is the ideal line length, measured along the top edge.
- It doesn't subtract half the ridge board's thickness. It also doesn't lay out the plumb cuts, birdsmouth seats (the notch where a rafter sits on the wall) or tail cuts.
- Hip and valley rafters run at a different angle when seen from above, so they need their own factor.
- Rafter sizes, spans and minimum pitches depend on loads and local codes. This tool doesn't check them.
Frequently asked questions
How do I convert a roof pitch to degrees?
Divide the pitch by 12 and take the arctangent (the button marked tan⁻¹ on most calculators). A 6/12 roof is arctan(0.5) = 26.57°, a 4/12 roof is 18.43°, and a 12/12 roof is exactly 45°.
What is a pitch factor used for?
It turns flat measurements into sloped ones. Multiply a rafter's flat run by it to get the rafter length. Or multiply the roof's flat footprint by it to get the area to cover with sheathing and shingles.
Is slope the same as pitch?
They describe the same steepness, written in different ways. Slope is often written as a percentage or a ratio such as 1:2. In North American roofing, pitch means inches of rise per 12 inches of run. A 6/12 pitch is a 50% slope.
How do I measure the pitch of an existing roof?
Hold a level flat against the underside of a rafter or on the roof surface, and mark 12 inches along it. Then measure straight up from that mark to the rafter or roof. That measurement in inches is the pitch. You can also enter any rise and run you measured.
How this calculator is checked
Method: Tangent relationship between rise, run and angle; pitch factor and rafter length from the Pythagorean theorem. The calculation is covered by automated tests with known reference values and edge cases. Last updated 2026-10-18. Found a problem? Tell us.
Embed this calculator
Put this Roof Pitch Calculator on your own website or blog for free. Paste this code where you want it to appear: