Roof Framing Calculator
Rafters, ridge and ties for a gable roof.
Doing this for work? Estimate the whole job in minutes.
JRIQ turns plans and site photos into full material + labor estimates with AI — built by the team behind these calculators.
Try it free →
A stick-framed gable roof is a pair of rafter rows leaning on a ridge board, tied at the bottom so they can’t spread. The math is trigonometry: the roof pitch turns your horizontal run into a longer rafter, and the building length sets how many rafters you need.
DifficultyAdvanced
TimeA weekend or more for a small structure (shed, garage, porch)
SkillsReading a span table, cutting accurate plumb and bird’s-mouth cuts, working safely at height
PermitsRoof framing is structural and permitted. Rafter size and spacing must meet span tables (IRC R802) for your snow/roof load — don’t guess; size the rafters from a table for your span, spacing, and lumber.
Tools you'll need
- Framing square + rafter/speed square
- Circular saw
- Tape measure and chalk line
- Ladder/scaffold and fall protection
- String line and level
- Rafter ties / hurricane ties + connector nails
Step by step
- Set the span, length, and pitchEnter the building width (span), the roof length, and the pitch (rise per 12). The calculator returns the rafter length along the slope and how many rafters you need per side.
- Size the rafters from a span tableUse an IRC rafter span table for your lumber, spacing, and load to confirm the rafter depth (e.g., 2×8 vs 2×10). The calculator estimates 2×8 stock length — verify the depth against the table for your conditions.
- Cut a pattern rafterLay out the plumb cut, bird’s-mouth (seat) cut, and tail with a framing square set to your pitch, cut one rafter, and test-fit it against the ridge and wall before cutting the rest.
- Set the ridge and raftersBrace the ridge board at height, then install opposing rafter pairs ~16" or 24" on-center, nailing each to the ridge and seating the bird’s-mouth on the top plate.
- Tie it togetherAdd ceiling joists or rafter ties near the plate so the walls can’t spread, plus collar ties in the upper third, and connect every rafter to the wall with a hurricane/rafter tie. The calculator includes a tie per rafter.
Common mistakes
Undersized rafters for the span
Always check a span table — a 2×6 and a 2×10 reach very different distances. Too small and the roof sags or fails under snow load.
No rafter ties — spreading walls
Without ties at the plate line, rafter thrust pushes the walls outward. Install ceiling joists or rafter ties, not just collar ties up high.
Sloppy bird’s-mouth or plumb cuts
Cut a single pattern rafter, test-fit it, then use it as the template so every rafter seats identically.
Skipping hurricane ties
Toe-nails alone don’t resist uplift. Connect each rafter to the wall with a rated metal tie.
Safety
- Roof work is the highest-risk DIY there is — use fall protection, stable scaffolding, and never work alone at height.
- Brace the ridge and the first rafter pairs well; a partly-framed roof is unstable until enough rafters are tied in.
Frequently asked questions
How do I calculate rafter length?
Multiply the horizontal run (½ the span, plus overhang) by the pitch factor √(rise² + 12²) ⁄ 12. The calculator does this and rounds up to a stock length for the plumb and bird’s-mouth cuts.
What spacing should rafters be?
16" on-center is typical; 24" is allowed for many spans with adequately sized rafters and sheathing. The calculator supports both.
What size rafters do I need?
It depends on span, spacing, species, and roof load — read it off an IRC rafter span table. As a rough guide, longer spans step up from 2×6 to 2×8, 2×10, and beyond.
Do I need rafter ties or collar ties?
Both do different jobs: rafter ties (or ceiling joists) near the wall plate stop the walls from spreading; collar ties in the upper third resist uplift separating the rafters at the ridge.
Next steps for this project
Sources & references
- IRC Section R802 — Wood Roof Framing (rafter spans, ties, connections)
- Size rafters from the IRC rafter span tables for your load and lumber