How the roof framing calculator works
The calculator builds the whole stick-framing list for a rectangular gable or hip roof: every rafter, the ridge, hips and jacks, ceiling joists and collar ties, each with its cut length and the stock length to order. Lengths use the same geometry as the rafter length calculator; quantities come from the building length and your spacing; board feet come from the nominal sizes and the order lengths.
Rafters per side = ⌈length ÷ spacing⌉ + 1
Rafter = (span ÷ 2 − ridge ÷ 2 + overhang) × √(1 + (pitch ÷ 12)²)
Board feet = Σ qty × (2 × width ÷ 12) × order length
Order lengths are the smallest stock length, from 8 to 24 ft in 2 ft steps, that leaves at least 6 in for the cuts. Ridges longer than 16 ft are split into equal pieces; ceiling joists over a 24 ft span are lapped over a centre bearing wall, two pieces per joist with 18 in of lap.
How to count rafters (and why there is always one extra)
Divide the building length by the spacing and round up to whole bays, then add one, because a rafter sits at both ends of every bay. A 40 ft roof at 16 in has 30 bays and 31 rafters per side, 62 in all. The end pairs double as the king rafters at the gable walls; fly (barge) rafters for the rake overhang are four more, outside the gable walls.
Worked example: a 24 × 40 ft gable roof
- Inputs40 ft long, 24 ft span, 6/12, 12 in eave and rake overhangs, 16 in on centre, 2x8 rafters, 2x10 ridge, 2x6 ceiling joists, collar ties.
- Rafters31 per side, 62 in all, each 14 ft 5 9/16 in on the line: order 16 ft. Plus 4 fly rafters at 16 ft.
- Ridge40 + 2 × 1 = 42 ft, in three 14 ft pieces jointed at rafter pairs.
- Ceiling joists and tiesThe 24 ft span is lapped: 31 joists × 2 = 62 pieces at 14 ft. Collar ties: 11 at 4 ft centres, each 8 ft 0 in, from 10 ft 2x4s.
- Board feet2,419.3 board feet in 142 pieces.
About 2,400 board feet is a normal takeoff for a 24 × 40 ft stick-framed roof with ceiling joists.
How to read the cut list and order lumber
Each line gives the piece, its size, how many, the cut (line) length and the stock length to order. Order the stock length, not the cut length: the extra covers the plumb cuts, the birdsmouth and a bad end. Add 5 to 10% more pieces for crowned, twisted or split boards, and sort the straightest for rafters and the ridge. Sheathing and roofing come next: use the roof sheathing calculator and the roofing nail calculator.
| Size | Per lineal ft | 8 ft piece | 16 ft piece |
|---|---|---|---|
| 2x4 | 0.667 | 5.33 | 10.67 |
| 2x6 | 1 | 8 | 16 |
| 2x8 | 1.333 | 10.67 | 21.33 |
| 2x10 | 1.667 | 13.33 | 26.67 |
| 2x12 | 2 | 16 | 32 |
Ridge board vs ridge beam
A ridge board is a nailing surface: the rafters lean against each other through it, and the ceiling joists or rafter ties stop the walls from spreading. It is usually one size deeper than the rafters so the full plumb cut bears on it. A ridge beam is a structural beam carried by posts at each end; it holds the rafters up so no ties are needed, which is what makes a vaulted ceiling possible. A ridge beam has to be designed for the load.
Collar ties vs rafter ties vs ceiling joists
Rafter ties and ceiling joists, low in the roof, stop the walls spreading; collar ties, high in the roof, do not. The IRC requires rafter ties or ceiling joists in the lower third of the attic, connected to the rafters, unless a designed ridge beam carries the roof. Collar ties go in the upper third, at no more than 4 ft on centre, and resist wind uplift at the ridge. That is why the calculator warns when you choose no ceiling joists: a vaulted roof needs a structural ridge or engineered ties.
Hip roof framing explained
A hip roof has a ridge shorter than the building by the span, four hip rafters running from the ridge ends to the corners, common rafters along the sides and one at each end of the ridge, and jack rafters stepping down between the hips and the walls. Each jack set has a jack at every spacing along the hip, and there are eight sets: two per hip. On a square plan the hips meet at a point, there is no ridge, and four king commons finish the peak. Hip rafters are usually one size deeper than the commons.
When trusses are cheaper than stick framing
For plain gable roofs over garages and houses, a truss package is usually cheaper once labour is counted, and it spans wider with smaller lumber. Stick framing wins for small sheds, roofs with storage or rooms in the attic, complicated hips and valleys, and jobs where trusses would take weeks to arrive. Price both: this list against the count from the roof truss calculator.
Metric units
Switch to m · mm to enter the building in metres and the overhangs in millimetres. Order lengths switch to metric stock from 2.4 to 7.2 m in 0.3 m steps with a 150 mm allowance, and board feet become cubic metres plus the lineal metres to order. Sizes stay as North American 2x sections.
When this result does not apply
The list is exact for a rectangular gable or hip roof of one pitch; it is a takeoff, not a structural design.
- Sizes for your loads. Check rafters and joists with the rafter span calculator.
- Valleys, dormers and L-shapes. Add their pieces separately.
- Gambrel roofs. Use the gambrel roof calculator.
- Spans over 40 ft. Beyond residential stick framing: use trusses or an engineered design.
- Blocking, hangers and hardware. Not included; add them to the order.
- Roofing materials. Use the shingle calculator.
Frequently asked questions
How many rafters do I need?
Divide the building length by the spacing, round up, add one, and double it for the two sides of a gable. A 40 ft building at 16 in needs 31 per side, 62 in all, plus four fly rafters if there is a rake overhang.
How long is the ridge board?
The building length plus the two rake overhangs on a gable roof, or the building length minus the span on a hip roof. Over 16 ft, split it into equal pieces jointed at rafter pairs: a 42 ft ridge is three 14 ft boards.
How far apart are collar ties?
No more than 4 ft on centre, in the upper third of the attic. A 40 ft roof needs 11. They resist uplift at the ridge but do not stop the walls spreading; rafter ties or ceiling joists low in the roof do that.
What is the difference between ceiling joists and rafter ties?
Both tie the rafters together low in the roof so the walls cannot spread. Ceiling joists also carry the ceiling; rafter ties are only ties. The IRC wants one or the other in the lower third of the attic unless a designed ridge beam carries the roof.
How many board feet is a roof?
A 24 × 40 ft gable roof with 2x8 rafters at 16 in, a 2x10 ridge, lapped 2x6 ceiling joists and collar ties is about 2,419 board feet; a 28 × 40 ft hip roof is about 2,916. A 10 × 12 shed roof is about 150.
What size ridge board do I need?
One size deeper than the rafters, so the whole plumb cut bears on it: a 2x10 ridge for 2x8 rafters. A ridge beam carrying the roof without ties must be sized by an engineer.
About this calculator
Roof Calcly builds every calculator from a written method, tests it against worked cases before it goes live, and shows the formula, assumptions and sources on the page, so you can check any number yourself.
Update history
- Published with Gable roof and Hip roof modes.
Sources
- Roof geometry. Rafter, hip and jack lengths, the same as the rafter length calculator.
- International Code Council, International Residential Code (IRC), Chapter 8, Roof-Ceiling Construction. Rafter ties or ceiling joists in the lower third of the attic, collar ties in the upper third at no more than 4 ft on centre, and ridge beams where ties are omitted.
- Board foot. The standard US lumber measure: 1 in × 12 in × 12 in on nominal dimensions.
- American Softwood Lumber Standard (PS 20). Nominal and actual sizes of dimension lumber.