Rafter Calculator

Enter the building width and the roof pitch. Get the rafter length with the overhang, the birdsmouth cuts, the ridge height and a code check.

Roof type

Outside of wall to outside of wall. Type it like 24' or 11' 10 1/2"

Rise in 12, like 6 or 6/12. Not sure? Use the roof pitch calculator.

Measured level, from the outside of the wall to the end of the rafter tail. 0 for none.

Rafter size

How much of the rafter sits on the wall: 3 1/2" on a 2x4 wall, 5 1/2" on a 2x6 wall. Shorter is fine, down to 1 1/2".

1 1/2" for a 2x ridge board. Half of it comes off each rafter.

More options

Along the ridge, outside of wall to outside of wall.

Rafter spacing
Round lengths to
Units

Enter the width and pitch

Type the building width and the roof pitch. The rafter length, the cuts and a code check appear here as you type.

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:

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

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.

RuleLimitIRC section
Rafter left above a birdsmouth with a tail3 1/2" minimumR802.7.1.1Same in 2021
Overhang (cantilever) with a notched rafter24" maximumR802.7.1.1Same in 2021
Notch at a rafter end with no tail1/4 of the rafter depthR802.7.1, R502.8.1Same in 2021
Bearing on a wood wall plate1 1/2" minimumR802.6Same in 2021
Ridge board1" nominal, as deep as the rafter's plumb cutR802.3Same in 2021
Roofs flatter than 3/12Ridge must be a designed beamR802.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.

We check the calculator against cases worked out separately before every change. Four of them:

RoofRafterLengthHAPWood above notch
Gable 24', 6/12, 12" overhang2x6173.575" (14' 5 9/16")4.399"3.935"
Gable 20', 4/12, 18" overhang2x8144.674" (12' 0 11/16")6.476"6.143"
Shed 10', 2/12, 12" overhangs2x6145.986" (12' 2")4.993"4.925"
Gable 16', 12/12, 24" overhang2x6168.645" (14' 0 5/8")4.278"3.025" (fails)

Sources

Help us improve this calculator

Was it helpful?

Only if you want a reply.