Rafter Calculator
Calculate rafter count, lumber size per IBC span tables, and complete material lists with board feet
Calculate the number of rafters needed based on building length and spacing
Quick presets
Total Roof Area
0 sq ft
0.0 roofing squares • Pitch multiplier: 1.054
Professional Calculator
Calculate total area for complex roofs with multiple sections
Total Roof Area
1,389 sq ft
Sections
2
Total Squares
13.9
Cost Breakdown
Detailed Breakdown
How to Use This Calculator
Rafter Count tab: Enter your building length and select the rafter spacing (12", 16", or 24" on center). Choose your roof type — shed roofs have rafters on one side, gable roofs on two sides, and hip roofs on all four sides with additional hip and jack rafters. The calculator shows the exact number of common rafters needed. Remember that the first and last rafters sit at the building ends, so you always get one more rafter than the number of spaces.
Rafter Sizing tab: Enter the horizontal rafter span (half the building width for a centered ridge), roof pitch, spacing, lumber species/grade, and design snow load. The calculator references IBC/IRC 2024 span tables to recommend the minimum lumber size (2x6 through 2x12) that meets structural requirements. If your span is close to the maximum for a given size, the calculator recommends stepping up one size for safety margin.
Complete List tab: Enter all building dimensions to generate a comprehensive material list: common rafters (count, size, and individual length), ridge board (size and length), collar ties (count and size), and total board feet. This gives you everything you need for a lumber yard order.
The Formula
Rafter Count: Rafters per Side = (Building Length in inches / Spacing in inches) + 1 Gable Total = Rafters per Side x 2 Hip Total = Common Rafters + 4 Hip Rafters + Jack Rafters
Rafter Sizing (per IBC/IRC 2024 Table R802.4.1): Required Size determined by: Species/Grade + Spacing + Horizontal Span + Design Load Total Load = Dead Load (typically 12-20 psf) + Live/Snow Load
Typical maximum horizontal spans (SPF #2, 20 psf snow, 16" OC): 2x6: 10' 6" 2x8: 13' 11" 2x10: 17' 9" 2x12: 21' 7"
Board Feet: BF per Rafter = (Nominal Thickness x Nominal Width x Length) / 12 Total BF = (Rafter BF x Count) + Ridge Board BF + Collar Tie BF
Collar Ties: Count = Number of Rafter Pairs / 2 (minimum every other pair) Minimum size: 1x4 for spans up to 12', 1x6 for spans over 12'
Example Calculation
Mike is building a 40-foot long, 28-foot wide garage with a 5/12 pitch gable roof in Indianapolis (30 psf ground snow load).
Step 1: Calculate rafter count
• Building length: 40 ft = 480 inches
• Spacing: 16" OC
• Rafters per side: (480 / 16) + 1 = 31
• Total common rafters: 31 x 2 = 62
Step 2: Determine rafter size
• Horizontal span: 28 / 2 = 14 ft
• Species: SPF #2, 16" OC, 30 psf snow
• Per IRC Table R802.4.1: 2x10 required (2x8 max span is 12'10" at 30 psf)
Step 3: Calculate rafter length
• 5/12 pitch factor: sqrt(1 + (5/12)^2) = 1.083
• Slant length: 14 x 1.083 = 15.16 ft → Buy 16-foot 2x10s
Step 4: Complete material list
• 62 ea — 2x10x16' common rafters
• 3 ea — 2x12x16' ridge board (spliced at 40')
• 16 ea — 1x6x8' collar ties (every other pair)
• Total board feet: 62 x 26.67 + 3 x 32 + 16 x 4 = 1,818 BF
• Lumber cost: ~$1,818 x $0.70/BF = $1,273
Frequently Asked Questions
How do I calculate the number of rafters I need?
What is the difference between the rafter calculator and the rafter length calculator?
What size rafter do I need for a 14-foot span?
Do I need collar ties with my rafters?
How do I calculate board feet for rafters?
Related Calculators
Rafter Length Calculator
Calculate the actual cutting length of each rafter
Rafter Span Calculator
Look up maximum allowable spans per IBC
Roof Joist Calculator
Calculate ceiling joist count and sizing
Roof Truss Calculator
Compare trusses vs stick-framed rafters
Roof Framing Calculator
Complete roof framing material list