A common rafter is the hypotenuse of a right triangle whose legs are the run (level distance) and the rise (vertical height), so its length is √run2 + rise2. On a 6/12 roof with a 12 ft run, the rise is 6 ft and the rafter is √144 + 36 = √180 ≈ 13.42 ft before you add the overhang.
How to use the rafter calculator
- Enter the run. For a gable roof this is half the span (the building's width from outside of wall to outside of wall). A 24 ft wide house has a 12 ft run.
- Choose how you know the slope: as a pitch such as 6 (meaning 6 in 12), as the total rise from the top of the wall to the ridge line, or as an angle in degrees. Switching modes converts the current slope for you.
- Enter the overhang as a level distance, or 0 for none. The calculator turns it into the extra length along the rafter.
- Read the results: the total line length, also in feet, inches and sixteenths, plus the pitch, angle, rise, grade and slope factor, and every step of the arithmetic.
Roof pitch explained
In the US and Canada, roof slope is written as inches of rise per 12 inches of run. A 6/12 roof (say "six in twelve") climbs 6 in for every 12 in it runs horizontally. Since a pitch is just the two legs of a small right triangle, the same triangle, together with the Pythagorean theorem formula, gives every other way of describing the slope:
θ= arctan(x over 12)grade= x over 12 × 100%slope factor= √x2 + 122 over 12The slope factor is the hypotenuse of that small triangle divided by 12: the length of rafter for each unit of run. Multiply any run by it to get the length along the slope. For 6/12 it is √36 + 144 ÷ 12 = √180 ÷ 12 ≈ 1.118, so every foot of run needs about 1.118 ft (13.42 in) of rafter.
A note on words: strictly, pitch is the rise divided by the whole span, so a 6/12 slope is a "1/4 pitch", while slope is rise over run. In everyday use, "6/12 pitch" and "6-in-12 slope" mean the same thing, and that is how the calculator uses the word.
Roof pitch table
| Pitch | Angle | Grade | Slope factor | Rafter per foot of run |
|---|---|---|---|---|
| 1/12 | 4.76° | 8.33% | 1.0035 | 12.04 in |
| 2/12 | 9.46° | 16.67% | 1.0138 | 12.17 in |
| 3/12 | 14.04° | 25% | 1.0308 | 12.37 in |
| 4/12 | 18.43° | 33.33% | 1.0541 | 12.65 in |
| 5/12 | 22.62° | 41.67% | 1.0833 | 13 in |
| 6/12 | 26.57° | 50% | 1.1180 | 13.42 in |
| 7/12 | 30.26° | 58.33% | 1.1577 | 13.89 in |
| 8/12 | 33.69° | 66.67% | 1.2019 | 14.42 in |
| 9/12 | 36.87° | 75% | 1.2500 | 15 in |
| 10/12 | 39.81° | 83.33% | 1.3017 | 15.62 in |
| 11/12 | 42.51° | 91.67% | 1.3566 | 16.28 in |
| 12/12 | 45° | 100% | 1.4142 | 16.97 in |
Two rows come out as whole numbers. A 5/12 roof gives exactly 13 in of rafter per foot of run and a 9/12 roof exactly 15 in, because 5-12-13 and 9-12-15 are Pythagorean triples (the second is the 3-4-5 triangle scaled by 3). A 12/12 roof is a 45° slope, a 45-45-90 triangle, so its slope factor is √2.
Worked examples
Example 1: a 24 ft wide house at 6/12
Span 24 ft, so the run is 12 ft. Pitch 6/12 and a 1 ft overhang.
rise= 12 × 6 over 12 = 6 ftc= √122 + 62 = √180= 6√5 ≈ 13.416 fttail= 1 × 1.118 ≈ 1.118 ftTotal line length ≈ 14.53 ft, or 14 ft 6 7/16 in. This is the default example in the calculator above. (√180 = 6√5 because 180 = 36 × 5; the square root simplifier shows the steps.)
Example 2: find the pitch of a shed roof
A shed roof rises 2 ft over a run of 8 ft, with no overhang.
pitch= 12 × 2 over 8 = 3, so 3/12c= √82 + 22 = √68= 2√17 ≈ 8.25 ftA 3/12 roof (about 14.04°) with rafters about 8.25 ft long, or 8 ft 2 15/16 in. Enter it with the Total rise mode.
Example 3: a wider house with deeper eaves
A 28 ft span (14 ft run) at 4/12 with 18 in (1.5 ft) eaves. The slope factor for 4/12 is √16 + 144 ÷ 12 ≈ 1.0541.
c= 14 × 1.0541 ≈ 14.757 fttail= 1.5 × 1.0541 ≈ 1.581 ftTotal ≈ 16.34 ft, or 16 ft 4 1/16 in.
Example 4: a metric roof given by its angle
A 30° roof with a 4 m run and a 0.5 m overhang. With an angle, the slope factor is 1 ÷ cosθ.
rise= 4 × tan30° ≈ 2.309 mtotal= (4 + 0.5) ÷ cos30°≈ 5.196 mAbout 5.20 m of rafter line length. A 30° roof is roughly a 6.93/12 pitch. To solve any right triangle from an angle and one side, use the right triangle calculator.
From line length to the cut board
The calculator gives the theoretical line length: the hypotenuse from the center of the ridge to the outside of the wall, plus the tail. Turning that into a cut rafter involves a few adjustments that depend on your materials and plans, so treat the following as an outline rather than a framing manual:
- Ridge board. The run is measured to the center of the ridge, but the rafter stops at the ridge board's face. Shorten it by half the ridge thickness measured level, times the slope factor along the rafter. For a 1½ in ridge board on a 6/12 roof that is 0.75 × 1.118 ≈ 0.84 in.
- Birdsmouth. Where the rafter crosses the wall, a notch with a level seat cut and a vertical heel cut lets it sit flat on the top plate. The depth of that notch decides where on the board the line length is laid out.
- Plumb cuts and tail. The ridge end and usually the tail end are cut vertical (plumb) at the roof angle, so the board must be a little longer than the line length. Lumber comes in 2 ft steps, so a 14.53 ft line length usually means a 16 ft board.
Rafter sizes, spacing and allowable spans are a structural question that this math does not answer; they come from span tables and the building code that applies to your project. Hip and valley rafters cross the plan diagonally, so they need the theorem twice, the same idea as the Pythagorean theorem in 3D. For squaring the walls the rafters sit on, see the Pythagorean theorem in construction, and for the trades that use this math daily, jobs that use the Pythagorean theorem.
Frequently asked questions
How do I calculate rafter length?
Find the rise (run × pitch ÷ 12), then use the Pythagorean theorem: rafter = √run2 + rise2. Add the overhang multiplied by the slope factor. For a 10 ft run at 8/12: the rise is 6.67 ft, the rafter is √100 + 44.44 ≈ 12.02 ft, and a 1 ft overhang adds about 1.20 ft.
What does a 6/12 roof pitch mean?
The roof rises 6 in for every 12 in of horizontal run. That is a slope of 50% and an angle of about 26.57°, and each foot of run needs about 13.42 in of rafter.
How do I convert roof pitch to degrees?
Take the arctangent of the rise divided by 12: θ = arctan(x ÷ 12). A 4/12 roof is about 18.43°, 8/12 is about 33.69° and 12/12 is exactly 45°. To go the other way, the pitch is 12tanθ.
Is the overhang measured level or along the rafter?
This calculator takes the overhang as a level distance from the outside of the wall, which is how eaves are usually specified on plans, and multiplies it by the slope factor. If you already know the tail length along the rafter, enter 0 for the overhang and add the tail yourself.
Does it work for hip rafters?
Not directly. A hip rafter runs at 45° in plan, so its run is the common run times √2. For a 12 ft common run at 6/12 the hip's run is about 16.97 ft and its length is √16.972 + 62 ≈ 18 ft. You can enter that run and the rise of 6 ft in Total rise mode.
Keep exploring
- Real-life usesThe Pythagorean Theorem in ConstructionHow builders use the Pythagorean theorem: the 3-4-5 rule for squaring corners and foundations, diagonal checks, stairs, rafters, ramps, braces and field tips.
- CalculatorsLadder Calculator: Length, Height and AngleLadder calculator. Enter any two of ladder length, height on the wall and base distance to get the third and the angle, checked against the 4-to-1 safety rule.
- CalculatorsRectangle Diagonal CalculatorFree rectangle diagonal calculator. Enter any two of length, width and diagonal to get the third, plus the diagonal angle, square mode and full working.
- CalculatorsRight Triangle Calculator and SolverRight triangle solver: enter any two values, such as two sides or a side and an angle, to get all three sides, both angles, area, perimeter, altitude and radii.
- LearnThe Pythagorean Theorem in 3DThe Pythagorean theorem in 3D: find the space diagonal of a box or cube, d = √(l² + w² + h²), with an animated two-step proof, fit problems and 3D distance.
- Real-life usesJobs That Use the Pythagorean TheoremJobs that use the Pythagorean theorem: 12 careers, from electricians and carpenters to pilots and data scientists, each with a real task and its calculation.