How to use the rafter calculator
Choose Gable for a roof with a ridge in the middle, or Shed for a single slope from a low wall to a high wall, like most sheds and lean-tos. Then enter:
- Building width. From the outside of one wall to the outside of the other. Type it like your tape reads:
24',11' 10 1/2". - Pitch. The rise in 12, like
6or6/12. If you only know the angle or the ridge height, get it from the roof pitch calculator first. - Overhang. How far the rafter tail sticks out past the wall, measured level, not along the slope.
- Rafter size, seat cut and ridge board. The defaults are a 2x6 rafter, a 3 1/2" seat on a 2x4 wall and a 2x ridge board.
Open More options and add the building length to get the number of rafters and the ridge board for your lumber order.
What each result means
- Rafter length. The whole board, from the ridge plumb cut to the end of the tail, measured along the top edge. The calculator picks the shortest standard board it fits in.
- Ridge cut to wall. The distance to mark along the top edge, from the long point of the ridge cut to the plumb line over the outside of the wall. Half the ridge board is already taken off.
- Height above plate (HAP). On that plumb line, the distance from the top edge of the rafter down to where the seat cut starts. Keep it the same on every rafter and the roof plane stays flat.
- Seat and heel. The two cuts of the birdsmouth: the level seat that sits on the wall plate and the plumb heel that sits against its outside edge. See how to cut a birdsmouth for the layout, step by step.
- Ridge height. How high the top of the rafters sits above the top of the walls at the ridge. Handy for setting the ridge board and for checking height limits.
A worked example: 24-foot gable at 6/12
The building is 24' wide, so each rafter runs 12' (144"). Half the 1 1/2" ridge board comes off: 143 1/4". The 6/12 multiplier is 1.118, so the ridge cut to wall is 13' 4 3/16". A 12" overhang adds 13 7/16" of tail, for a rafter of 14' 5 9/16", cut from a 16-foot board.
The birdsmouth has a 3 1/2" seat on a 2x4 wall, a 1 3/4" heel and a height above plate of 4 3/8". A 2x6 has 3 15/16" of wood left above the notch, more than the 3 1/2" the code asks for. The plumb cut on a 2x6 at 6/12 is 6 1/8" tall, so the ridge board has to be a 2x8. The top of the rafters at the ridge sits 6' 4 3/8" above the walls.
What the code check looks at
These are prescriptive rules from Chapter 8 of the International Residential Code (IRC), 2024 edition. Many areas still build under the 2021 edition, so both section numbers are shown.
| Rule | Limit | IRC section |
|---|---|---|
| Rafter left above a birdsmouth with a tail | 3 1/2" minimum | R802.7.1.1Same in 2021 |
| Overhang (cantilever) with a notched rafter | 24" maximum | R802.7.1.1Same in 2021 |
| Notch at a rafter end with no tail | 1/4 of the rafter depth | R802.7.1, R502.8.1Same in 2021 |
| Bearing on a wood wall plate | 1 1/2" minimum | R802.6Same in 2021 |
| Ridge board | 1" nominal, as deep as the rafter's plumb cut | R802.3Same in 2021 |
| Roofs flatter than 3/12 | Ridge must be a designed beam | R802.4.42021: R802.3 |
Rafter size is up to you. The span tables in the IRC give the largest span for each rafter size by wood species, grade, spacing, snow load and ceiling. The calculator shows the horizontal span to look up, but it does not pick the size. States and cities also amend these rules, so check with the building department that issues your permit.
Questions people ask
How do I calculate rafter length by hand?
Take the run (half the building width on a gable roof), subtract half the ridge board thickness, and multiply by the pitch multiplier: √(1 + (pitch ÷ 12)²). Add the overhang times the same multiplier for the tail. For a 24' wide 6/12 roof with a 2x ridge and a 12" overhang: (144 − 0.75) × 1.118 + 12 × 1.118 = 173.57", or 14' 5 9/16".
How deep can a birdsmouth be?
When the rafter has a tail past the wall, the IRC requires at least 3 1/2" of rafter left above the notch and an overhang no longer than 24" (Section R802.7.1.1). Without a tail, the notch is limited to one quarter of the rafter depth. The seat only needs 1 1/2" of bearing, so you can shorten it on steep roofs to keep more wood.
What size ridge board do I need?
At least 1" nominal thick and no shallower than the plumb cut on the end of the rafter (IRC R802.3). The plumb cut is longer than the rafter is deep: a 2x6 on a 6/12 roof has a 6 1/8" cut, so it needs a 2x8 ridge board. Below 3/12, the ridge must be a beam designed for the load.
How much taller is the high wall on a shed roof?
The rise of the roof between the two seat cuts: the distance between the birdsmouths, measured level, times the pitch ÷ 12. The calculator shows it as the high wall's height above the low wall, top plate to top plate.
Does this calculator size my rafters?
No. Rafter size depends on the span, the snow load, the wood species and grade, and whether a ceiling hangs from the rafters. The calculator gives the horizontal span to look up in the IRC rafter span tables (Tables R802.4.1(1) to (8)). Your building department can tell you the snow load where you live.
How we calculate
All lengths stay at full precision until they are shown. Every length is measured along the top edge of the rafter, between plumb lines.
- Multiplier = √(1 + (pitch ÷ 12)²).
- Gable: run = width ÷ 2. Ridge cut to wall = (run − ridge thickness ÷ 2) × multiplier.
- Shed: between walls = (width − seat) × multiplier. High wall difference = (width − seat) × pitch ÷ 12.
- Tail = overhang × multiplier.
- Heel = seat × pitch ÷ 12. Plumb cut = rafter depth × multiplier. Height above plate = plumb cut − heel.
- Wood left above the notch = rafter depth − seat × sin(roof angle).
- Rafters per side = building length ÷ spacing, rounded up, + 1.
We check the calculator against cases worked out separately before every change. Four of them:
| Roof | Rafter | Length | HAP | Wood above notch |
|---|---|---|---|---|
| Gable 24', 6/12, 12" overhang | 2x6 | 173.575" (14' 5 9/16") | 4.399" | 3.935" |
| Gable 20', 4/12, 18" overhang | 2x8 | 144.674" (12' 0 11/16") | 6.476" | 6.143" |
| Shed 10', 2/12, 12" overhangs | 2x6 | 145.986" (12' 2") | 4.993" | 4.925" |
| Gable 16', 12/12, 24" overhang | 2x6 | 168.645" (14' 0 5/8") | 4.278" | 3.025" (fails) |
Sources
- 2024 International Residential Code, International Code Council, Section R802 (Wood roof framing).
- 2021 Seattle Residential Code, Chapter 8, City of Seattle (IRC text for R802.3).
- Notches on cantilevered portions of rafters (R802.7.1.1), Building Code Trainer.
- Sizing the birdsmouth, Journal of Light Construction.