Rafter Length Calculator
Calculate rafter length, lumber sizes, and board feet from building span and roof pitch
Find rafter length from building span and pitch
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
Calculate Length tab: Enter the building span (wall to wall), roof pitch, eave overhang distance, and ridge board thickness. The calculator uses the Pythagorean theorem to compute the exact rafter length including the overhang tail. It also shows the birdsmouth cut depth and the total board length you need to purchase (rounded up to the next standard lumber length). Use this tab when you need the raw geometry for a single rafter.
Lumber List tab: Add the building length and rafter spacing to get a complete lumber order. The calculator computes the number of rafters (both sides), ridge board length, collar tie count and length, and total board feet. It accounts for standard lumber lengths (8, 10, 12, 14, 16 ft) and recommends the most economical cut. Use this tab when you are placing your lumber order at the yard.
Cost Estimate tab: Enter all dimensions plus your state to get a lumber cost estimate. Prices are based on 2026 national averages for #2 SPF framing lumber, adjusted by state. The calculator includes rafters, ridge board, collar ties, and a hardware allowance for hurricane ties and joist hangers.
The Formula
Run = (Building Span / 2) - (Ridge Thickness / 2) For a 24 ft span with 1.5" ridge: (24 / 2) - (1.5 / 24) = 11.9375 ft
Rise = Run × (Pitch Rise / 12) For 5/12 pitch: 11.9375 × (5/12) = 4.974 ft
Rafter Length (to ridge) = sqrt(Run² + Rise²) sqrt(11.9375² + 4.974²) = sqrt(142.50 + 24.74) = sqrt(167.24) = 12.93 ft
Overhang Length = Overhang Horizontal / cos(pitch angle) Pitch angle for 5/12 = arctan(5/12) = 22.62° 12 inches / cos(22.62°) = 12 / 0.9231 = 13.0 inches
Total Rafter Length = Rafter Length + Overhang Length 12.93 ft + 1.08 ft = 14.01 ft -> buy 14-ft lumber
Number of Rafters = ((Building Length / Spacing) + 1) × 2 ((40 / 2) + 1) × 2 = 21 × 2 = 42 rafters
Example Calculation
Tom is framing a new garage addition in Michigan. The building is 24 ft wide by 40 ft long with a 5/12 pitch, 12-inch eave overhang, and 2x ridge board. He plans 24" o.c. rafter spacing with 2x8 #2 SPF.
Step 1: Calculate rafter length Run: (24 / 2) - (1.5 / 24) = 11.9375 ft Rise: 11.9375 × (5/12) = 4.974 ft Rafter length to ridge: sqrt(11.9375² + 4.974²) = 12.93 ft Overhang tail: 12" / cos(22.62°) = 13.0" = 1.08 ft Total rafter length: 12.93 + 1.08 = 14.01 ft -> buy 14-ft 2x8s
Step 2: Count rafters Rafter pairs: (40 / 2) + 1 = 21 pairs Total rafters: 21 × 2 = 42 rafters (14-ft 2x8) Ridge board: 40 ft of 2x10 (5 pieces of 8-ft, or 3 pieces of 14-ft) Collar ties (every other pair): 11 pieces of 2x4 at 8 ft
Step 3: Board feet & cost Rafters: 42 × 14 × 7.25 × 1.5 / 12 = 533 board feet Ridge: 40 × 9.25 × 1.5 / 12 = 46 board feet Collar ties: 11 × 8 × 3.5 × 1.5 / 12 = 39 board feet Total: ~618 board feet
Step 4: Estimated cost (2026)
• 42 pcs 2x8x14 @ $12.50 each = $525
• 5 pcs 2x10x8 (ridge) @ $9.80 each = $49
• 11 pcs 2x4x8 (collar ties) @ $3.75 each = $41.25
• Hurricane ties & hardware: ~$85
• Total lumber: ~$700
Frequently Asked Questions
How do I calculate rafter length from span and pitch?
What size rafter do I need for a 24-foot span?
Do I need collar ties or rafter ties?
What is the difference between a ridge board and a ridge beam?
How many board feet of lumber do I need for rafters?
Related Calculators
Roof Area Calculator
Calculate your total roof area from dimensions and pitch
Roof Pitch Calculator
Convert between pitch, degrees, and slope factor
Roof Plywood Calculator
Calculate sheathing sheets needed for your roof
Roofing Material Calculator
Complete bill of materials for your roofing project
Shingle Calculator
Calculate how many shingle bundles you need
Roof Truss Calculator
Calculate truss dimensions and costs