Rafter Length Calculator: Length, Angles and How Many Rafters
A 24 ft wide, 30 ft long gable building with a 6/12 pitch, a 1.5 in ridge board and a 12 in overhang needs 46 rafters at 16 in on center. Each has a run of 11' 11 1/4" (half the span less half the ridge board), so a line length of 13' 4 3/16" (run × pitch factor 1.118) plus 1' 1 7/16" of overhang along the slope: 14' 5 9/16" in all, which takes 16 ft boards. The plumb cut is 26.57° off square, and the ridge sits 5' 11 5/8" above the wall plate. This is a geometry and material estimate; the rafter size and spacing come from your code's span tables.
Figures based on the sources listed belowUpdated How we calculate
Buy 46 rafters.
Buy 46 rafters
30 linear ft + 0% waste = 30 linear ft
- Rafter length with overhang (cut length along the rafter): 14' 5 9/16"
- Line length (ridge to the seat): 13' 4 3/16"
- Overhang along the rafter: 1' 1 7/16"
- Boards to buy (next stock length that fits): 46 boards (each 16 ft)
- Plumb cut and seat cut (off square across the board): plumb 26.57°, seat 63.43°
- Height of the ridge above the wall plate: 5' 11 5/8", to the rafter line
- Rafters (a pair at each spacing mark, plus the end): 46 rafters, 23 on each side
- Birdsmouth seat cut depth limit, 2 × 8 (IRC: a notch at the end may remove at most 1/4 of the depth): 1 13/16", measured square to the rafter edge
- Lumber to buy, 2 × 8 (nominal size): 982 board feet
How this number is calculated
30 linear ft (no waste added) ÷ 0.652 linear ft per rafter = 46 rafters
Shopping list
- Speed square (rafter square)
- Framing square
- Framing nailer
- Hurricane ties (rafter to plate)
- Circular saw
- Chalk line
Your project
- Building length (for the rafter count) × building span (outside of wall to outside of wall): 30 × 24 ft
- Roof type: Gable: two slopes meeting at a ridge
- Roof pitch (rise per 12 in of run, x/12): 6
- Ridge board thickness: 1.5 in
- Overhang (horizontal): 12 in
- Rafter spacing: 16 in on center (about 40 cm)
- Rafter lumber size: 2 × 8 (7.25 in deep)
- Waste: Exact count (0%)
Also pick up
- Speed square (rafter square)
- Framing square
- Framing nailer
- Hurricane ties (rafter to plate)
- Circular saw
- Chalk line
Reopen this calculation: /calculators/rafter-length/?s=eyJyb29tIjp7Imxlbmd0aEZ0IjozMCwid2lkdGhGdCI6MjR9LCJkZWR1Y3Rpb25zIjpbXSwid2FzdGVQY3QiOjAsInBhcmFtcyI6eyJzaGFwZSI6MCwicGl0Y2giOjYsInJpZGdlSW4iOjEuNSwic2hlZEFsbG93YW5jZUluIjowLCJvdmVyaGFuZ0luIjoxMiwic3BhY2luZ0luIjoxNiwibHVtYmVyV2lkdGhJbiI6OH19
Show diagram
Saved projects
No saved projects yet.
Rafter length per foot of run: 3/12 to 12/12
| Pitch (rise in 12) | Angle | Pitch factor | Rafter length per 1 ft of run | Per 1 ft of run (mm) |
|---|---|---|---|---|
| 3/12 | 14.04° | 1.0308 | 1' 3/8" | 314 |
| 4/12 | 18.43° | 1.0541 | 1' 5/8" | 321 |
| 5/12 | 22.62° | 1.0833 | 1' 1" | 330 |
| 6/12 | 26.57° | 1.118 | 1' 1 7/16" | 341 |
| 7/12 | 30.26° | 1.1577 | 1' 1 7/8" | 353 |
| 8/12 | 33.69° | 1.2019 | 1' 2 7/16" | 366 |
| 9/12 | 36.87° | 1.25 | 1' 3" | 381 |
| 10/12 | 39.81° | 1.3017 | 1' 3 5/8" | 397 |
| 11/12 | 42.51° | 1.3566 | 1' 4 1/4" | 413 |
| 12/12 | 45° | 1.4142 | 1' 5" | 431 |
Common rafter length by span and pitch
| Span (wall to wall) | 4/12 pitch | 6/12 pitch | 8/12 pitch |
|---|---|---|---|
| 20 ft | 10' 5 11/16" | 11' 1 5/16" | 11' 11 5/16" |
| 22 ft | 11' 6 3/8" | 12' 2 3/4" | 13' 1 3/4" |
| 24 ft | 12' 7" | 13' 4 3/16" | 14' 4 3/16" |
| 26 ft | 13' 7 5/8" | 14' 5 9/16" | 15' 6 9/16" |
| 28 ft | 14' 8 5/16" | 15' 7" | 16' 9" |
| 30 ft | 15' 8 15/16" | 16' 8 7/16" | 17' 11 7/16" |
| 32 ft | 16' 9 5/8" | 17' 9 13/16" | 19' 1 7/8" |
| 34 ft | 17' 10 1/4" | 18' 11 1/4" | 20' 4 1/4" |
| 36 ft | 18' 10 7/8" | 20' 11/16" | 21' 6 11/16" |
Birdsmouth seat cut depth limit by rafter size
| Rafter size | Actual depth | Seat cut depth limit | In mm |
|---|---|---|---|
| 2 × 6 | 5.5 in | 1 3/8" | 34.9 mm |
| 2 × 8 | 7.25 in | 1 13/16" | 46 mm |
| 2 × 10 | 9.25 in | 2 5/16" | 58.7 mm |
| 2 × 12 | 11.25 in | 2 13/16" | 71.4 mm |
Stock lengths used for the buying length
| Stock length | Longest rafter it covers |
|---|---|
| 8 ft | 8' 0" |
| 10 ft | 10' 0" |
| 12 ft | 12' 0" |
| 14 ft | 14' 0" |
| 16 ft | 16' 0" |
| 18 ft | 18' 0" |
| 20 ft | 20' 0" |
Methodology & assumptions
Enter the span (outside of wall to outside of wall, across the rafters), the building length (along the ridge, used only for the count), the pitch and the overhang. For a gable roof the run is half the span less half the ridge board thickness (a 1.5 in ridge board takes 3/4 in off each rafter). For a shed roof the run is the span less a high-side wall allowance: 0 in measures to the outside face of the high wall, and a wall or ledger thickness (3.5 in for a 2 × 4 wall) stops at its inside face. The line length is the run × the pitch factor √(1 + (rise ÷ 12)²), the hypotenuse of the roof triangle, and the overhang along the rafter is the horizontal overhang × the same factor; the total is their sum, measured along the rafter and ignoring the style of tail cut. The roof angle is atan(rise ÷ 12): the plumb cut is that many degrees off a square cut across the board, and the seat (level) cut is its complement, 90° less that angle. The ridge height above the plate is the run × rise ÷ 12, to the rafter's line at the ridge; the ridge board's own depth and the birdsmouth are not added or taken off. The count is (floor(building length ÷ spacing) + 1) × 2 for a gable roof (a pair at every spacing mark, plus the end pair) and floor(building length ÷ spacing) + 1 for a shed roof, with the spares you choose, rounded up; outlookers, hip and valley rafters and doubled rafters at openings are not counted. The buying length is the first stock length of 8, 10, 12, 14, 16, 18 or 20 ft that is at least the total length; the lengths available at your yard vary. The birdsmouth line shows the IRC limit on a notch at the end of a member, one-fourth of its depth, on the actual depth of the 2 × size you pick (5.5, 7.25, 9.25 and 11.25 in); a common older rule of thumb of one-third is larger than the code figure and is not used here. Rafter size, grade, spacing, collar ties, ridge beams and uplift ties are structural and code matters (the IRC R802 span tables, or an engineer), so the size field only sets the board feet and the notch limit and never says a size is adequate. The metric toggle shows lengths in mm and m.
- International Residential Code (ICC), R802.7.1 Sawn lumber, which refers cuts and notches in rafters to R502.8.1: a notch at the end of a member may not exceed one-fourth of the depth of the member. Checked against code-text summaries; confirm the section and any local amendment in your adopted edition
- International Residential Code (ICC), Chapter 8 Roof-Ceiling Construction, section R802 and its rafter span tables: where the size, grade and spacing of rafters are set (not calculated here)
- Voluntary Product Standard PS 20, American Softwood Lumber Standard (NIST / American Lumber Standard Committee): dressed sizes of 1 1/2 × 5 1/2, 7 1/4, 9 1/4 and 11 1/4 in for nominal 2 × 6, 2 × 8, 2 × 10 and 2 × 12
- Pitch factor √(1 + (rise ÷ 12)²) and the common rafter run of half the span less half the ridge board: the Pythagorean theorem on the roof triangle, as in framing guides and the framing square rafter tables
- Stock lengths of 8 to 20 ft in 2 ft steps for dimension lumber: typical retail availability, which varies by region and yard (estimate)
How to calculate a common rafter
- Measure the span and the pitch. Measure the building from the outside of one wall to the outside of the other, across the rafters, and find the pitch as the rise in inches over 12 in of run, for example 6/12.
- Work out the run. For a gable roof, take half the span and subtract half the ridge board thickness. For a shed roof, take the span less any high-side wall allowance.
- Multiply by the pitch factor. Multiply the run by √(1 + (rise ÷ 12)²) to get the line length from the ridge to the outside of the wall, and the horizontal overhang by the same factor.
- Add the overhang and pick the board. Add the two for the total rafter length and choose the next stock length of 8, 10, 12, 14, 16, 18 or 20 ft that is at least that long.
- Mark the cuts and count the rafters. Mark the plumb cut at atan(rise ÷ 12) off square and the seat cut at its complement, keeping the birdsmouth within the code limit. Count (floor(length ÷ spacing) + 1) × 2 rafters for a gable roof.
Worked examples
| Project | Result |
|---|---|
| 24 × 30 ft building, gable roof, 6/12 pitch, 1.5 in ridge board, 12 in overhang, 16 in on center | 46 rafters, each 14' 5 9/16" long, so 16 ft boards; ridge 5' 11 5/8" above the plate |
| 12 × 20 ft shed roof, 4/12 pitch, 3.5 in high-side wall allowance, 16 in overhang, 16 in on center | 16 rafters, each 13' 8 15/16" long, so 14 ft boards; the high end is 3' 10 13/16" above the low plate |
| 30 × 40 ft building, gable roof, 8/12 pitch, 3 in ridge board, 12 in overhang, 24 in on center, 10% spares | 47 rafters (42 plus spares), each 19' 15/16" long, so 20 ft boards |
Frequently asked questions
- How do I calculate the length of a common rafter?
- Find the run, multiply by the pitch factor and add the overhang along the slope. For a gable roof the run is half the span less half the ridge board thickness, and the pitch factor is √(1 + (rise ÷ 12)²). For the example, the run is 11' 11 1/4", the factor at 6/12 is 1.118, so the line length is 13' 4 3/16"; the 12 in overhang adds 1' 1 7/16" along the rafter, for 14' 5 9/16". The table on this page lists the length per foot of run for 3/12 to 12/12.
- Why does the ridge board change the rafter length?
- The rafters meet the ridge board's faces, not its centre line, so each one is short by half the board's thickness, measured level. A 1.5 in ridge board takes 3/4 in off the run, which is about 0.84 in off the rafter at 6/12. That is why the run is half the span less half the ridge thickness.
- What are the plumb cut and seat cut angles?
- The roof angle is atan(rise ÷ 12): 26.57° at 6/12. The plumb cut (the vertical cut at the ridge and at the tail) is that many degrees off a square cut across the board, and the seat (level) cut of the birdsmouth is the complement, 63.43° off square. On a speed square, set the pivot to the pitch number (6 here) and mark along the edge for the plumb cut.
- How deep can I cut the birdsmouth?
- The IRC limits a notch at the end of a rafter to one-fourth of its depth (R802.7.1 refers to R502.8.1), so a 2 × 8, which is 7.25 in deep, can have a seat cut up to 1 13/16" deep, measured square to the rafter's edge. You may see one-third quoted as a rule of thumb, but that is more than the code figure, so this page uses one-fourth. The rafter also needs bearing on the plate, and a deep cut on a low pitch can run wider than the plate. Check the section and any local amendment for your area.
- How many rafters do I need?
- For a gable roof the count is (floor(building length ÷ spacing) + 1) × 2: a pair at every spacing mark along the length, plus one at the end. A 30 ft building at 16 in on center is floor(360 ÷ 16) + 1 = 23 per side, so 46 rafters. At 24 in on center it is 16 per side, 32 in all. Add the doubled rafters, hip or valley rafters and outlookers your plan calls for; they are not counted here.
- What length of lumber should I buy?
- Buy the next stock length at or above the total rafter length: 8, 10, 12, 14, 16, 18 or 20 ft. The example comes to 14' 5 9/16", so 16 ft boards. A rafter that is a little over a stock length needs the next one up, so it can be worth shortening the overhang or checking whether a different span splits the lengths better. Past 20 ft, rafters are spliced or made of engineered lumber, which this calculator does not size.
- What size rafters do I need?
- This calculator does not say. The size, grade and spacing of rafters depend on the span, the roof load (snow in particular), the species and grade of lumber and whether there are ceiling joists or collar ties. In the US they come from the span tables in the International Residential Code (R802) or an engineer, and your local building department has the final say. The lumber size field here only sets the board feet and the birdsmouth depth limit.
- How do I measure the run of a shed roof?
- A shed rafter spans the whole building. With the high-side allowance at 0 the run is the full span, measured to the outside face of the high wall; enter the thickness of the wall or ledger (3.5 in for a 2 × 4 wall) to stop at its inside face. A 12 ft span with a 3.5 in allowance has a run of 11' 8 1/2". The overhang is added at the low end only, and a high-side overhang or a rafter notched over a ledger is not counted.
- Is the overhang measured level or along the rafter?
- Level, as on a plan: the distance from the outside of the wall to the plumb cut at the tail. The calculator multiplies it by the pitch factor to get the length along the rafter, so a 12 in overhang at 6/12 is 1' 1 7/16" of rafter. A fascia or a tail cut that is not plumb will move the exact length a little.
- Do I need a permit or an engineer?
- Most places require a permit for new roof framing and many require plans, and snow, wind, seismic and uplift rules can change the framing. This calculator only works the geometry and counts the boards; check your local code and ask a designer or engineer about sizes, ties and bracing.
Handy tools
- Slope Calculator: Turn a rise and run, an angle or a percent grade into the x/12 pitch the field above takes.
- Feet and Inches Calculator: Add or divide lengths in feet, inches and fractions, and get decimal feet for the span and building length.