To frame a stick-built gable roof, tie the walls together with ceiling joists, set a ridge board, install rafter pairs opposite each other, tie them across the building, then sheathe. The 2021 IRC (R802) sets the ridge, bearing, tie and nailing rules.
To convert rise and run to pitch and get the common rafter length, use the roof pitch calculator.
This guide covers the on-site build sequence for a simple stick-framed gable roof on a house. For drawing the roof on a plan, see roof framing plan.
Key facts
- Rafters need at least 1-1/2 inches of bearing on wood or metal and at least 3 inches on masonry or concrete (2021 IRC Section R802.6).
- A ridge board must be at least 1 inch nominal thick and at least as deep as the cut end of the rafter (2021 IRC Section R802.3).
- Opposing rafters must not be offset more than 1-1/2 inches from each other at the ridge (2021 IRC Section R802.4.2).
- Wood rafter ties must be at least 2 inches by 4 inches, at a maximum of 24 inches on center (2021 IRC Section R802.5.2.2).
- Collar ties must be at least 1 inch by 4 inches nominal, spaced no more than 4 feet on center, in the upper third of the attic space (2021 IRC Section R802.4.6).
- Rafter spans are measured along the horizontal projection of the rafter, not along its sloped length (2021 IRC Section R802.4.1).
What do you need before you frame a roof?
You need the roof slope, the building span, the rafter size and spacing from the plans, and a decision between rafters and trusses. This guide assumes a rafter roof. If the plans call for trusses, they arrive with design drawings and are installed to those drawings, and the 2021 IRC does not let you cut or alter them without approval (R802.10.4).
Rafter size comes from the span tables in R802.4.1, quoted in the rafter span chart. Where the pitch is less than 3:12, members that support rafters, such as ridges, must be designed as beams (R802.4.4), so a low-slope roof is not a job for the steps below.
2021 IRC Table R802.4.1(1), maximum rafter spans (feet-inches), No. 2 grade, roof live load 20 psf, dead load 10 psf, ceiling not attached to rafters, L/Δ = 180.
| Species | Spacing | 2x6 | 2x8 | 2x10 |
|---|---|---|---|---|
| Douglas fir-larch | 12 in. o.c. | 16-10 | 21-4 | 26-0 |
| Douglas fir-larch | 16 in. o.c. | 14-7 | 18-5 | 22-6 |
| Hem-fir | 12 in. o.c. | 15-11 | 20-8 | 25-3 |
| Hem-fir | 16 in. o.c. | 14-2 | 17-11 | 21-11 |
Read the full table for other species, grades, spacings and loads.
How do you start framing a roof?
Check that the top plates are straight and level, because every rafter seat is cut from the same pattern. Mark rafter and ceiling joist positions on the plates together so each rafter lands beside a joist.
R802.2 requires continuous ties across the structure so roof thrust is not applied to the walls. Ceiling joists that run parallel to the rafters and sit in the bottom third of the rafter height do that job (R802.5.2). Where ceiling joists do not run parallel to the rafters, 2x4 rafter ties at a maximum of 24 inches on center are used instead (R802.5.2.2). Ceiling joists are fastened to the top plate per Table R602.3(1), item 2. Span sizes for the joists are in the ceiling joist span chart.
How do you cut a pattern rafter?
Cut one rafter with the plumb cut at the ridge, the bird's mouth (seat and heel cut) and the tail, test it at both walls, then use it as the pattern for the rest. Walls that are out of level or out of parallel show up here, before every other rafter is cut.
The seat must leave at least 1-1/2 inches of bearing on wood or metal (R802.6). And notches in solid lumber rafters follow the limits referenced in R802.7.1, so do not cut deeper than the plans or the code allow. On a cantilevered rafter tail, a notch is allowed only if at least 3-1/2 inches of the rafter remains and the cantilever does not exceed 24 inches (R802.7.1.1).
How do you set the ridge board?
Cut the ridge board at least 1 inch nominal thick and at least as deep as the cut end of the rafter, then hold it at the planned height with temporary posts braced to the ceiling joists (R802.3). Pitch matters here: where the roof pitch is 3:12 or greater and ceiling joists or rafter ties provide a continuous tension tie, vertical bearing of the rafter top against the ridge board satisfies the bearing rule (R802.6).
A ridge board is not a beam. Where ceiling joists or rafter ties do not provide continuous ties across the structure, the ridge must instead be supported by a wall or a ridge beam designed in accordance with accepted engineering practice (R802.3). Where ceiling joists sit above the bottom third of the rafter height, the ridge also has to be designed as a beam (R802.5.2). The difference is covered in ridge beam vs ridge board.
How do you install and nail the rafters?
Set rafters in opposing pairs, each pair directly across from the other at the ridge, and nail them to the ridge and the plate per Table R602.3(1). Opposing rafters must not be offset more than 1-1/2 inches from each other, and they must be connected by a collar tie or ridge strap (R802.4.2).
2021 IRC Table R602.3(1), fastening schedule, roof framing items. One option shown per row; the table lists equivalent alternatives.
| Connection | Item | Fastener (one option) | Spacing and location |
|---|---|---|---|
| Ceiling joist to top plate | 2 | 3-8d common (2-1/2 in. x 0.131 in.) | Per joist, toe nail |
| Ceiling joist not attached to parallel rafter, laps over partitions | 3 | 3-16d common (3-1/2 in. x 0.162 in.) | Face nail |
| Collar tie to rafter | 5 | 3-10d common (3 in. x 0.148 in.) | Face nail each rafter |
| Rafter or roof truss to plate | 6 | 3-10d common (3 in. x 0.148 in.) | 2 toe nails on one side and 1 toe nail on opposite side of each rafter |
| Rafter to ridge, valley or hip rafter, or to minimum 2 in. ridge beam | 7 | 3-10d common (3 in. x 0.148 in.) | Toe nail |
| Rafter to ridge, valley or hip rafter, or to minimum 2 in. ridge beam | 7 | 2-16d common (3-1/2 in. x 0.162 in.) | End nail |
Footnote i of the table says that where a rafter is fastened to an adjacent parallel ceiling joist, two toe nails go on one side of the rafter, and the opposite-side toe nail is not required. Plate nailing per the table applies unless the roof must meet the uplift rules of R802.11 (R802.4.2). The R802.11 exceptions allow table nailing where the uplift per rafter does not exceed 200 pounds; otherwise the connection must resist the uplift force from Table R802.11 or engineering. See hurricane ties for the connectors.
How do you tie the rafters together?
Nail each rafter to the parallel ceiling joist at the heel joint, then add collar ties or ridge straps near the top. The heel joint nail count in Table R802.5.2(1) rises with span, spacing and snow load and falls as slope increases.
2021 IRC Table R802.5.2(1), required number of 16d common nails per heel joint splice, ground snow load 20 psf (roof live load 20 psf or less), 16 in. rafter spacing, 10 psf roof dead load, ceiling joists at the bottom of the attic space.
| Slope | 12 ft roof span | 24 ft roof span | 36 ft roof span |
|---|---|---|---|
| 3:12 | 4 | 7 | 10 |
| 4:12 | 3 | 5 | 8 |
| 5:12 | 3 | 4 | 6 |
| 7:12 | 3 | 3 | 5 |
Footnote a lets you use 10d common nails if you take 1.2 times the number of 16d nails, rounded up. Heel joint connections are not required where the ridge is supported by a load-bearing wall, header or ridge beam (footnote b). For other snow loads, spacings and slopes, read the full table.
Collar ties must be at least 1 inch by 4 inches nominal, spaced no more than 4 feet on center, in the upper third of the attic space, and nailed per Table R602.3(1) (R802.4.6). A ridge strap of at least 1-1/4 inches by 20 gage may replace them. The detail is in collar ties.
What comes after the rafters are up?
Add lateral support where needed, frame the gable ends, then sheathe the roof. R802.8 requires lateral support at points of bearing for rafters with a depth-to-thickness ratio above 5 to 1 based on nominal dimensions. Above 6 to 1, R802.8.1 requires solid blocking, diagonal bridging or a continuous 1-inch by 3-inch wood strip at intervals not exceeding 8 feet.
Roof sheathing nailing for wood structural panels is in Table R602.3(1), items 31 and 32: 8d common nails (2-1/2 in. x 0.131 in.) at 6 inches on center at panel edges and at intermediate supports, for panel thicknesses of 3/8 inch to 3/4 inch. Footnote f requires 4-inch spacing near roof edges and ridges in high-wind conditions: greater than 130 mph in Exposure B or greater than 110 mph in Exposure C. Panels must not cantilever more than 9 inches beyond the gable end wall unless supported by gable overhang framing (R803.2.3). Panel thickness is in the roof sheathing thickness guide. Hips and valleys are a different build, covered in gable and hip roof framing.
Limits of this guide
The tables here are prescriptive limits for their stated loads only. The adopted code edition and local amendments govern, trusses and engineered rafters use manufacturer designs and tables, and the full chapter is in the 2021 IRC online.
Summary
Frame a gable roof by tying the walls with ceiling joists or rafter ties, cutting and testing a pattern rafter, setting the ridge board, and installing opposing rafter pairs no more than 1-1/2 inches out of line. Tie them at the heel joint and with collar ties, add lateral support where needed, then sheathe per Table R602.3(1).
Framing Plan is a preliminary drawing aid. It draws joist layouts, beams and openings and exports PNG, PDF and DXF, but it does not check code or size members, and its editor works in millimetres. Open the framing studio to sketch the walls and openings your roof will bear on.