On a 24 ft wide house with a 6/12 roof, a common rafter rises 6 ft over its 12 ft run. Cut against a 1½ in ridge board and with a 12 in overhang, it is 14 ft 5⅝ in long, so you buy 16 ft boards. A 30 ft long house needs 50 of them at 16 in on center. The roof covers 930 square feet, 10.2 squares of shingles with waste, and takes 31 sheets of OSB and 122 ft of drip edge. The calculator above works this out for any gable roof and checks that the rafter size can carry your snow load.
How the calculator works
Enter the building length and width, the pitch and the overhangs, then the rafter size and spacing, the lumber, the snow load and the covering. The result is the common rafter length, the lumber to buy and the full materials list, with a check against the AWC span method and the code's minimum slope for the covering.
Rafter length
A rafter is the hypotenuse of a right triangle whose base is the run and whose height is the rise. Pitch is rise per 12 in of run, so the sloped length is the run times the slope factor √(1 + (pitch/12)²): 1.054 at 4/12, 1.118 at 6/12, 1.202 at 8/12, 1.414 at 12/12. The run of a common rafter is half the building width less half the thickness of the ridge board, because rafters stop against its face. The tail adds the eave overhang, measured horizontally from the wall, times the same factor.
For the default roof: (144 − ¾) in × 1.118 = 160.2 in to the wall line, plus 12 × 1.118 = 13.4 in of tail, 173⅝ in in total. Lumber comes in even lengths, so that is a 16 ft board with room for the plumb cut at the ridge and the tail cut.
Count and the rest of the frame
Rafters per slope are the roof length, rakes included, divided by the spacing, plus one: 32 ft at 16 in is 24 spaces and 25 rafters, 50 for both slopes. The ridge board runs the same 32 ft. Ceiling joists or rafter ties tie each pair of rafters together at the wall plates; without them a gable roof pushes its walls apart, unless the ridge is a structural beam.
Roof area and materials
The roof surface is the sloped width from the eave edge to the ridge times the roof length, for both slopes: 2 × 14.5 × 32 = 930 ft². Shingles are sold by the square of 100 ft²; with 10 % for starter, hips, ridge and cuts that is 10.2 squares. Sheathing takes 4 × 8 ft OSB or plywood sheets, 31 for this roof with 5 % for cuts. Spaced battens replace sheathing under some metal, shake and tile roofs. Drip edge runs along the eaves and up the rakes.
Is the rafter big enough?
The calculator checks the rafter by the American Wood Council's span method with design values for the species and grade you choose. The span that matters is the horizontal run from the wall to the ridge. A 2x8 Douglas fir-larch No. 2 at 16 in, under 30 psf of snow and 15 psf of shingle roof, can span 14 ft 5 in; the default run is 11 ft 11¼ in, so it passes. A cathedral ceiling, with drywall fastened to the rafters, tightens the deflection limit from L/180 to L/240. If the run is too long, the calculator names the smallest size that works.
The covering also sets a minimum pitch: asphalt shingles need at least 2/12 (IRC R905.2.2), and below 4/12 a double layer of underlayment; lapped metal panels 3/12, wood shakes 3/12, tile 2½/12.
Common mistakes
- Using the building width as the run. Each rafter covers half the width.
- Measuring the overhang along the slope. Overhangs are usually specified horizontally; along the slope they come out longer.
- Forgetting the ridge board. Half its thickness comes off every rafter.
- No ties. A gable roof without ceiling joists or rafter ties spreads its walls.
For the span of any rafter, use the Rafter Span Calculator; for pitch and angle conversions, the Roof Pitch Calculator; for a hip roof, the Hip Roof Calculator.