The short answer
A 10 ft wide gable shed at 6/12 with a 6 in overhang has a 65-1/4 in run and a rafter line of 6 ft 1 in, so a 2x6 needs an 8 ft board. The 2021 IRC carries 11 ft 11 in on a 2x6 at 16 in spacing and 30 psf of snow.
A rafter calculator turns three measurements into one cut length: how wide the shed is, how steep the roof is and how far the roof hangs over the wall. Use the calculator below for gable and lean-to sheds. Under it you get the formula, a table you can read without typing anything, and the rules for rafter size and the birdsmouth notch.
Calculator
Rafter length calculator
Enter the shed and the roof. For a gable roof the width is wall to wall across the rafters. For a lean-to it is the depth from the tall wall to the low wall, and the length is the wall the rafters sit along.
Rafter line length
- Run, including overhang
- 5 ft 5-1/4 in
- Rise over that run
- 2 ft 8-5/8 in
- Roof angle
- 26.57°
- Board to buy, at least
- 6 ft 3-3/4 in
- Buy this length
- 8 ft
- Rafters for the roof
- 20
- Smallest rafter for the span
- 2x4
Line length runs along the top edge of the rafter, from the ridge (or the tall wall on a lean-to) to the tip of the overhang. Spans are the 2021 International Residential Code tables R802.4.1(3) and R802.4.1(5) for spruce-pine-fir No. 2, 10 psf dead load, no ceiling attached, measured on the horizontal projection; at 3/12 or lower, the shed designer's L/240 span check. Your adopted code and your building department decide.
What to enter
On a gable roof, enter the width of the shed, wall to wall, because two rafters meet at the ridge and each covers half. On a lean-to, enter the depth from the tall wall to the low wall, because one rafter covers all of it. The length is the wall the rafters sit along, and it only sets how many rafters you cut. Pitch is the rise in inches for every 12 inches of run. If you have not picked one yet, choose it on the shed roof pitch guide first, then come back.
What the result means
The rafter line is the long point to long point length along the top edge, the number you mark on the board. The board to buy adds the height of the rafter’s plumb cut, so the stock covers the point of the cut. The checks under the numbers read the span against the 2021 International Residential Code1 and test the birdsmouth. They size a rafter for a shed. They do not replace your local code or a building department’s answer.
- 1International Code Council 2021 International Residential Code, Chapter 3: Building Planning
- 2International Code Council 2021 International Residential Code, Chapter 8: Roof-Ceiling Construction
How to Calculate Rafter Length
You can do this with a pencil. The roof is a right triangle: the run is the flat leg, the rise is the upright leg and the rafter is the sloping side. Pythagoras gives the rafter once you know the other two.
Run and rise
The run is the horizontal distance the rafter crosses. On a gable shed that is half the width, less 3/4 in because the ridge board is 1-1/2 in thick and takes half of it on each side, plus the overhang. On a lean-to it is the depth plus an overhang at each end. The rise is the run times the pitch divided by 12.
The pitch multiplier
Skip the square root by using a multiplier. The rafter line is the run times the number in the last column. It is the square root of 1 plus (pitch / 12) squared, which is the same thing as 1 divided by the cosine of the roof angle.
| Pitch | Roof angle | Rise per 12 in of run | Multiplier |
|---|---|---|---|
| 3/12 | 14.04° | 3 in | 1.0308 |
| 4/12 | 18.43° | 4 in | 1.0541 |
| 5/12 | 22.62° | 5 in | 1.0833 |
| 6/12 | 26.57° | 6 in | 1.1180 |
| 7/12 | 30.26° | 7 in | 1.1577 |
| 8/12 | 33.69° | 8 in | 1.2019 |
| 9/12 | 36.87° | 9 in | 1.2500 |
| 10/12 | 39.81° | 10 in | 1.3017 |
| 11/12 | 42.51° | 11 in | 1.3566 |
| 12/12 | 45.00° | 12 in | 1.4142 |
The roof angle is also the angle of the plumb cut: set a speed square so the roof angle reads on the rafter edge and the cut line stands vertical when the rafter is in place.
Worked example: a 10 ft gable at 6/12
Take a 10 ft wide gable shed, a 6/12 roof and a 6 in overhang, entered in the calculator above.
- Run: half of 120 in is 60 in, less 3/4 in for the ridge, plus 6 in of overhang is 65-1/4 in, or 5 ft 5-1/4 in.
- Rise: 65.25 x 6 / 12 is 32-5/8 in, or 2 ft 8-5/8 in.
- Rafter line: 65.25 x 1.118 is 72.95 in, or 6 ft 1 in.
- Board to buy: a 2x6 is 5-1/2 in deep, so the plumb cut adds 5.5 x 6 / 12, which is 2-3/4 in. That is 6 ft 3-3/4 in, so an 8 ft board.
How you mark, cut and raise that rafter is on the shed rafters guide. This page only gets you the length.
Rafter Length Table for Common Shed Widths
These lengths use a 6 in overhang and are the rafter line, before you add the depth of the plumb cut. The pitches are the ones the shed designer draws: 4/12, 5/12 and 6/12 on a gable shed, 2/12, 3/12 and 4/12 on a lean-to.
Gable shed
| Shed width | 4/12 | 5/12 | 6/12 |
|---|---|---|---|
| 8 ft | 4 ft 8-1/8 in | 4 ft 9-3/4 in | 4 ft 11-1/2 in |
| 10 ft | 5 ft 8-3/4 in | 5 ft 10-3/4 in | 6 ft 1 in |
| 12 ft | 6 ft 9-3/8 in | 6 ft 11-3/4 in | 7 ft 2-3/8 in |
| 14 ft | 7 ft 10-1/8 in | 8 ft 3/4 in | 8 ft 3-3/4 in |
| 16 ft | 8 ft 10-3/4 in | 9 ft 1-3/4 in | 9 ft 5-1/4 in |
Lean-to shed
| Shed depth | 2/12 | 3/12 | 4/12 |
|---|---|---|---|
| 8 ft | 9 ft 1-1/2 in | 9 ft 3-3/8 in | 9 ft 5-7/8 in |
| 10 ft | 11 ft 1-7/8 in | 11 ft 4 in | 11 ft 7-1/8 in |
| 12 ft | 13 ft 2-1/8 in | 13 ft 4-3/4 in | 13 ft 8-1/2 in |
| 14 ft | 15 ft 2-1/2 in | 15 ft 5-1/2 in | 15 ft 9-3/4 in |
| 16 ft | 17 ft 2-7/8 in | 17 ft 6-1/4 in | 17 ft 11 in |
A lean-to rafter is long, because one board crosses the whole depth. Past 16 ft the calculator moves to a 20 ft or 24 ft board, the way the shed designer lists it: one piece, never spliced. Depth also sets the size. A 12 ft deep lean-to at 2/12 or 3/12 spans 11 ft 8-1/2 in, more than the 11 ft 1 in a 2x6 carries at 16 in spacing and 30 psf at L/240, so it needs 2x8 rafters. At 16 ft deep it needs 2x10.
What Size Rafter Do You Need
Length is half the question. The other half is whether the board carries the span. The calculator reads the span from the 2021 International Residential Code1, which prints the allowable rafter spans in Tables R802.4.1(3) and R802.4.1(5) (International Code Council, 2021 IRC, Chapter 8). The values below are for spruce-pine-fir No. 2, a 10 psf dead load and no ceiling attached to the rafters.
| Ground snow load | Spacing | 2x4 | 2x6 | 2x8 | 2x10 |
|---|---|---|---|---|---|
| 30 psf | 16 in | 8 ft 2 in | 11 ft 11 in | 15 ft 1 in | 18 ft 5 in |
| 30 psf | 24 in | 6 ft 8 in | 9 ft 9 in | 12 ft 4 in | 15 ft 1 in |
| 50 psf | 16 in | 6 ft 8 in | 9 ft 9 in | 12 ft 4 in | 15 ft 1 in |
| 50 psf | 24 in | 5 ft 5 in | 7 ft 11 in | 10 ft 1 in | 12 ft 4 in |
Two details change how you read the table.
- The span is the horizontal projection, not the length along the slope. On a gable shed that is half the width less 3/4 in, and the calculator uses it.
- Deflection decides the table, and the limit depends on the roof. The IRC sets L/180 for rafters steeper than 3:12 with no finished ceiling attached, and L/240 for the rest (2021 IRC, Table R301.7). The tables are L/180, so at 3/12 or lower the calculator switches to the shed designer’s L/240 span check, which is shorter.
Your own snow load is a number from your building department, not from this page. Past a 2x10, or past 50 psf, the table stops and the answer is a call to an engineer. The gable ridge needs to be at least as deep as the cut end of the rafter, and the walls need ties across the building so the roof does not push them out (2021 IRC1, R802.2 and R802.3). Both are in the shed trusses vs rafters guide and the shed rafters guide.
- 1International Code Council 2021 International Residential Code, Chapter 3: Building Planning
- 2International Code Council 2021 International Residential Code, Chapter 8: Roof-Ceiling Construction
The Birdsmouth and the Overhang
The birdsmouth is the notch where the rafter sits on the wall plate. It has a seat, the flat part that rests on the plate, and a heel, the plumb cut beside it. The calculator uses a 3-1/2 in seat, which is the width of a 2x4 wall.
The IRC1 lets you notch the part of a rafter that overhangs the wall if at least 3-1/2 in of rafter is left and the overhang is no longer than 24 in (2021 IRC, R802.7.1.1). The checks follow from that.
- A 2x4 fails it. A 2x4 is 3-1/2 in deep, so any notch leaves less. A rafter with an overhang needs a 2x6 or larger.
- A 2x6 at 6/12 passes. The 3-1/2 in seat takes a 1-3/4 in heel cut and leaves about 3.9 in measured square to the edge.
- A 2x6 at 12/12 does not. The heel cut grows with the pitch and leaves about 3.0 in, so the seat has to get narrower or the rafter bigger.
- A tail over 24 in is outside the rule, whatever the board.
The calculator tells you the maximum seat that still leaves 3-1/2 in. If you have no overhang, the rule does not apply, but the seat still has to sit on the plate. The overhang changes the rafter length, so enter it before you cut. For the step-by-step on laying out the notch, see the shed rafters guide. Metal panels often want a specific eave overhang, which the metal roof on a shed guide covers, and the full roof build sits in how to build a shed roof.
- 1International Code Council 2021 International Residential Code, Chapter 3: Building Planning
- 2International Code Council 2021 International Residential Code, Chapter 8: Roof-Ceiling Construction
Rafters or Trusses
On a gable shed, width sets the rafter span and depth only adds pairs. A 16 ft wide shed spans 7 ft 11-1/4 in per side, inside what a 2x6 carries at 16 in spacing and 30 psf, and every rafter is cut from the same pattern. Wider sheds, or a building department that wants design drawings, are where trusses built on a jig or ordered from a plant come in. The shed designer frames with rafters tied across by 2x4 ties, and it never uses a 2x4 rafter: it starts at 2x6 and steps up until the span passes. The shed trusses vs rafters guide compares the cost, the time and the span limits.
Get a Plan With Every Rafter Cut
The calculator gives you one rafter. A finished shed also needs the ridge, the wall plates, the fascia and the cut list. The shed designer takes the same width, pitch, overhang, spacing and snow load, sizes the rafters, and prints the cut for each one in the material list. The link under the calculator results opens the designer with your values already filled in whenever they fit its range.
Check before you cut
Before you cut
Measure the wall plate on the real shed, not the plan. A wall that is 1/2 in out changes the run at both ends. Cut one rafter, hold it up, and use it as the pattern for the rest.
Sources
Every number in this guide that does not come from our own shed designer was checked against these 2 documents, numbered in the order the text first cites them and read on Sep 29, 2026. 2 are codes, agencies, makers and stores.
- 1International Code Council2021 International Residential Code, Chapter 3: Building Planning
- 2International Code Council2021 International Residential Code, Chapter 8: Roof-Ceiling Construction


