Rafter Span Calculator
How far a rafter or ceiling joist can span by the code's span tables, for your lumber, spacing, snow load and ceiling, and the smallest size that spans what you need.
By Marko Visic, BSc Physics · Updated November 25, 2026
The lumber
Rafters, center to center.
The loads
Ask your building department. The lowest option takes the live load tables; above the highest, hire an engineer.
The roof's own weight: roofing, sheathing and framing. Use the column at or above yours.
A vaulted ceiling fastened to the rafters takes the stiffer tables.
The span you need (optional)
Measured level, from the wall to the ridge or a purlin, not along the slope; the overhang doesn't count.
Ceiling joists or rafter ties above the wall tops (optional)
Leave both empty when the ceiling joists or ties sit on the wall tops, as the tables assume.
Table: R802.4.1(1), roof live load 20 psf, ceiling not attached to the rafters, dead load 10 psf.[1]
Longest span: a 2x6 #2 Douglas fir-larch rafter 16 in on center spans 14 ft 7 in measured level, 14 × 12 + 7 = 175 in.[1]
Your span: 12 × 12 = 144 in. 175 in reaches 144 in: the 2x6 spans it.
It's also the smallest size that does.
The tables assume ceiling joists or rafter ties at the wall tops; higher ones shorten the span.[1] These are the code's tables, not an engineered design: other grades, species and loads go to the AWC's span tables.[1]
How far can a rafter span? It depends on the lumber, the spacing and the load, and the 2024 IRC's span tables give each case. A 2x6 #2 Douglas fir-larch rafter 16 in on center spans 14 ft 7 in under the 20 psf roof live load, 12 ft 1 in under a 30 psf ground snow load and 9 ft 10 in under 50 psf, with no ceiling on the rafters and a 10 psf dead load.[1] The span is measured level, from the wall to the ridge, not along the rafter.[1]

Drawing: CalculateMyRoof · CC BY 4.0 · How to reuse
How the calculator works
Pick rafters or ceiling joists, then the lumber's species, grade and size and how far apart the members are. For rafters, the snow or live load, the dead load and whether a ceiling is fastened to the rafters pick one of the code's rafter tables, R802.4.1(1) to (8); for ceiling joists, whether the attic has storage picks R802.5.1(1) or (2).[1] The calculator reads the one cell that matches and gives the longest span, in feet and inches as the table prints it. Enter the span you need and it checks the size against it and finds the smallest size that spans it. If the ceiling joists or rafter ties sit above the wall tops, enter their height and the ridge's, and the code's factor cuts the span.
How to measure rafter span
The tables measure a rafter's span level, along its horizontal projection,[1] between the supports at each end: the wall it sits on and the ridge, or a purlin partway up. On a gable roof with the ridge in the middle, that's the level distance from the wall to the ridge, close to half the building's width. The overhang past the wall isn't part of it. A purlin shortens the span; it has to be at least as big as the rafters, run continuously and be braced down to a bearing wall.[1] The rafter itself is longer than its span, and the rafter length calculator works it out from the pitch, with the overhang and the cuts. A ceiling joist spans between the walls or beams that hold it up.
Snow load, dead load and ceiling: which table
The rafter tables cover a roof live load of 20 psf and ground snow loads of 30, 50 and 70 psf, each with a 10 and a 20 psf dead load column.[1] The code designs a roof for whichever is greater, the roof live load or the ground snow load,[2] so a roof whose ground snow load is no more than 20 psf takes the live load tables, and one with more takes the first snow table that covers it.[1] Your building department has the ground snow load, from the code's map; above 70 psf the code calls for an engineered roof.[2] The guide to how much snow a roof can hold explains the snow loads.
Dead load is the roof's own weight, figured from the actual materials,[2] and the roof load calculator gives what your covering weighs. Use the 10 psf column when the roof's dead load is no more than that and the 20 psf column up to 20 psf.[1] A ceiling fastened to the rafters, as in a vaulted ceiling, takes the tables that hold the rafters to a deflection of L/240 where the others allow L/180, so its spans are shorter: the 2x6 above drops from 14 ft 7 in to 14 ft 1 in.[1]
Ceiling joists or rafter ties above the wall tops
The rafter tables assume ceiling joists or rafter ties at the bottom of the attic, where they keep the rafters from pushing the walls apart.[1] Raise them, for a higher ceiling or more headroom, and Table R802.4.1(9) cuts the span by a factor set by HC/HR: HC is the ties' height above the top of the walls, HR the ridge's.[1] The factor runs from 0.67 with the ties at 1/3 of the ridge height to 1.00 at 1/7.5 or less.[1] The table lists nothing between its rows, so the calculator takes the row above, with the smaller factor, and above 1/3 it gives no span, as the table gives no factor.[1]
Ties 24 in above the wall tops under a ridge 96 in up sit at 24 ÷ 96 = 0.25 of the ridge height, the 1/4 row, so the 2x6 above, 14 ft 7 in or 14 × 12 + 7 = 175 in, spans 175 × 0.76 = 133 in, or 11 ft 1 in.[1]
Cells the calculator refuses
We copied the span tables cell for cell from ICC's online 2024 IRC and checked each cell against the cells around it. Some can't be right: one prints an inch figure of a foot or more, and a few span farther under the 20 psf dead load than under 10 psf, which errs long and would let a rafter be undersized.[1] Others span no farther than the next size down, gain less over it than any other step in the tables, or come out longer with a ceiling attached than without. The calculator gives no span for those cells and says why, and skips them when it looks for the smallest size that works.
The refused cells
| Cell | What fails |
|---|---|
| R802.4.1(1), 16 in, Douglas fir-larch #3, 2x8 at 20 psf dead load | An inch figure of a foot or more.[1] |
| R802.4.1(1), 19.2 in, Douglas fir-larch #3, 2x10 at 20 psf dead load | Gains less over the next size down than any other step.[1] |
| R802.4.1(3), 16 in, southern pine SS, 2x10 at 20 psf dead load | Out of step with the sizes beside it.[1] |
| R802.4.1(4), 19.2 in, hem-fir #1, 2x6 at 20 psf dead load | Longer than at the lighter dead load: errs long.[1] |
| R802.4.1(5), 16 in, spruce-pine-fir SS, 2x10 at 20 psf dead load | Longer with a ceiling attached than without; one of the pair is wrong.[1] |
| R802.4.1(5), 19.2 in, hem-fir #1, 2x4 at 20 psf dead load | Longer than at the lighter dead load: errs long.[1] |
| R802.4.1(5), 24 in, hem-fir #1, 2x4 at 20 psf dead load | Longer than at the lighter dead load: errs long.[1] |
| R802.4.1(6), 16 in, spruce-pine-fir SS, 2x10 at 20 psf dead load | Longer with a ceiling attached than without; one of the pair is wrong.[1] |
| R802.4.1(6), 24 in, hem-fir SS, 2x12 at 20 psf dead load | Gains less over the next size down than any other step.[1] |
| R802.4.1(7), 19.2 in, hem-fir SS, 2x12 at 20 psf dead load | Gains less over the next size down than any other step.[1] |
| R802.4.1(7), 24 in, Douglas fir-larch #3, 2x12 at 20 psf dead load | Longer than at the lighter dead load: errs long.[1] |
| R802.4.1(7), 24 in, hem-fir SS, 2x12 at 10 psf dead load | Gains less over the next size down than any other step.[1] |
| R802.4.1(7), 24 in, hem-fir SS, 2x12 at 20 psf dead load | Out of step with the sizes beside it.[1] |
| R802.4.1(7), 24 in, spruce-pine-fir SS, 2x12 at 20 psf dead load | Gains less over the next size down than any other step.[1] |
| R802.4.1(8), 19.2 in, hem-fir SS, 2x12 at 20 psf dead load | Gains less over the next size down than any other step.[1] |
| R802.4.1(8), 24 in, hem-fir SS, 2x12 at 10 psf dead load | Gains less over the next size down than any other step.[1] |
| R802.4.1(8), 24 in, hem-fir SS, 2x12 at 20 psf dead load | Out of step with the sizes beside it.[1] |
| R802.4.1(8), 24 in, spruce-pine-fir SS, 2x12 at 20 psf dead load | Gains less over the next size down than any other step.[1] |
Common questions
Can a 2x6 rafter span 12 ft?
At 16 in on center under the 20 psf roof live load, yes in every species at grade #2 or better, the shortest being southern pine #2 at 13 ft 6 in; no #3 does, the longest reaching 11 ft 1 in in Douglas fir-larch.[1] Snow shortens it: a #2 Douglas fir-larch 2x6 spans 12 ft 1 in under a 30 psf ground snow load, enough, and 9 ft 10 in under 50 psf, not enough.[1]
How far can a 2x10 rafter span without support?
Without a purlin between the wall and the ridge, a #2 Douglas fir-larch 2x10 at 16 in on center spans 22 ft 6 in under the 20 psf roof live load, 18 ft 9 in under 30 psf of ground snow, 15 ft 3 in under 50 psf and 13 ft 3 in under 70 psf, with a 10 psf dead load and no ceiling on the rafters.[1] A purlin braced to a bearing wall splits that into two shorter spans.[1]
How far can a 2x4 rafter span?
A #2 Douglas fir-larch 2x4 spans 9 ft 10 in at 16 in on center under the 20 psf roof live load, 8 ft 2 in at 24 in, and 8 ft 3 in at 16 in under a 30 psf ground snow load.[1]
How many rafters do I need?
Divide the wall's length by the spacing and add one: a 20 ft wall at 16 in on center has 20 × 12 ÷ 16 = 15 spaces, so 15 + 1 = 16 rafters a side, and a gable roof has two sides. The span sets their size: a gable 20 ft wide puts the ridge 20 ÷ 2 = 10 ft from each wall, which a #2 Douglas fir-larch 2x6 at 16 in on center spans under the 20 psf roof live load, at up to 14 ft 7 in.[1]
How far can a ceiling joist span?
A #2 Douglas fir-larch 2x6 ceiling joist 16 in on center spans 17 ft 8 in under an uninhabitable attic without storage and 13 ft under one with limited storage; a 2x8 spans 23 ft 4 in and 16 ft 6 in.[1]
What is the longest a 2x8 rafter can span?
23 ft 9 in, the longest any 2x8 gets in the rafter tables: Select Structural Douglas fir-larch at 12 in on center under the 20 psf roof live load.[1] A #2 at 16 in spans 18 ft 5 in.[1]
Methodology & sources
The spans are the 2024 IRC's Tables R802.4.1(1) to (8) for rafters and R802.5.1(1) and (2) for ceiling joists, copied cell for cell from ICC's online code on Nov 25, 2026, with Table R802.4.1(9) for raised ties. The calculator looks up one cell per answer, and the page doesn't reprint the tables. We checked each cell against its neighbors: an inch figure of a foot or more, a span longer under the heavier dead load, a size that spans no farther than the one below it or gains less over it than any other step in the tables, and, for the cells left, a pair out of order by spacing, grade, ceiling or snow load, which flags both. Flagged cells give no span. ICC's online 2018 IRC and 2021 IRC tables carry the same cells, and match the 2024 IRC's everywhere but one cell the newer edition corrected.
Spans compare in inches, and a raised-tie span is floored to the whole inch. The calculator covers the code's species and grades in sawn lumber, at 12, 16, 19.2 and 24 in on center, the spacings the tables give.[1] These are the code's tables, not an engineered design: other grades, species and loads go to the AWC's span tables or an engineer.[1] The lookup and the checks run as tests on every build.
Sources
- [1] International Code Council. 2024 International Residential Code, Chapter 8: Roof-Ceiling Construction (Oct 2026 version). Sections R802.4.1, R802.4.5, R802.5.1. Retrieved Nov 25, 2026. codes.iccsafe.org
- [2] International Code Council. 2024 International Residential Code, Chapter 3: Building Planning (Oct 2026 version). Sections R301.2.3, R301.4, R301.6. Retrieved Nov 17, 2026. codes.iccsafe.org
Change log: first published November 25, 2026.
Related
- Rafter length calculator
- Roof truss calculator
- Trusses vs rafters
- Roof load calculator
- How much snow a roof can hold
- Gable roof calculator
- Roof sheathing calculator
By Marko Visic, BSc Physics. Updated November 25, 2026.