Rafter Calculator 2026 | Calculate Rafter Length, Pitch & Lumber Needed

Reviewed by the AmericaCalculator.com editorial team 🕐 Last Updated: August 2026

Calculate the exact rafter length, ridge board length, number of rafters needed, board feet of lumber, and estimated material cost for any gable roof. Enter your run, pitch, spacing, and overhang — and get instant results. Based on the standard Pythagorean theorem formula used by professional framers across the US.

Run = half the building width (span ÷ 2). For a 30-ft wide building, run = 15 ft.
Eave overhang past wall plate
2026 avg: 2×8 ~$1.85/lf | 2×10 ~$2.20/lf | 2×12 ~$2.75/lf

Your Rafter Calculations

15 ft run, 4/12 pitch, 16" spacing, 40 ft building

Roof Cross-Section
Run: 15ft 4/12 Rafter
15.62 ft Rafter Length (ridge to plate) + 12" overhang = 16.62 ft total cut
40 ft Ridge Board Length
62 Total Rafters (both sides)
820 Board Feet of Lumber
$1,516 Est. Lumber Cost
18.4° Rafter Angle (slope)

How to Use the Rafter Calculator

  • Enter the Run (half the building width) The "run" is the horizontal distance from the wall plate to the center ridge. It equals exactly half your total building width (span). For a 28-foot wide house, the run is 14 feet.
  • Select your roof pitch Pitch is expressed as rise per 12-inch run. A 6/12 pitch rises 6 inches for every foot of horizontal run. Common residential pitches are 4/12 to 8/12. Select from the dropdown or use our pitch chart below.
  • Enter overhang, spacing, and building length Overhang is how far the rafter extends past the wall plate (typical: 12–24 inches). Spacing is 16" or 24" on center. Building length determines how many rafters you need per side.
  • Select lumber size and enter price Common rafter sizes are 2×6, 2×8, 2×10, and 2×12. Your local lumber yard can give you the current price per linear foot. The 2026 national average for 2×8 dimensional lumber is approximately $1.85/linear foot.
  • Click Calculate Instantly get rafter length, total cut length (with overhang), ridge board length, rafter count, board feet, estimated cost, and rafter angle — everything you need to order materials and start framing.

Rafter Length Formula — The Math Explained

Rafter length is calculated using the Pythagorean theorem. A rafter, the horizontal run, and the vertical rise form a right triangle — and you're solving for the hypotenuse (the rafter):

Rise = Run × (Pitch ÷ 12)
Rafter Length = √(Run² + Rise²)
Total Cut Length = Rafter Length + Overhang Length
Overhang Length = Overhang(in) ÷ 12 × √(1 + (Pitch/12)²)

Example: 15-foot run, 6/12 pitch, 12-inch overhang

  • Rise = 15 × (6 ÷ 12) = 7.5 feet
  • Rafter length = √(15² + 7.5²) = √(225 + 56.25) = √281.25 = 16.77 feet
  • Overhang run = 12 in = 1 ft | Overhang rise = 1 × 0.5 = 0.5 ft
  • Overhang segment = √(1² + 0.5²) = 1.12 feet
  • Total cut length = 16.77 + 1.12 = 17.89 feet
💡 Framing square shortcut: Professional framers use a framing square. For a 6/12 pitch, set the square's tongue at 6" and the blade at 12". The hypotenuse of each 12" step equals your rafter unit length (13.42" for 6/12).

Roof Pitch Chart & Common Uses

PitchAngleMultiplier*Best ForCommon Regions
2/129.5°1.014Porch overhangs, shedsHot, dry climates (AZ, NV)
3/1214.0°1.031Low-slope commercialSouthern US
4/1218.4°1.054Ranch-style homesSoutheast, Southwest
6/1226.6°1.118Most popular residentialNationwide
8/1233.7°1.202Traditional colonial homesNortheast, Midwest
10/1239.8°1.302Cape Cod, steep-slope areasNew England
12/1245.0°1.414A-frames, steep snow-load roofsMountain regions (CO, WA, MT)

*Multiplier: multiply the run by this factor to get the rafter length (before overhang). E.g., 6/12 pitch × 15 ft run × 1.118 = 16.77 ft rafter.

How Many Rafters Do I Need?

The number of rafters per side is determined by your building length and rafter spacing. Here's the formula:

Rafters per side = ⌈(Building Length ÷ Spacing) + 1⌉ × 2 sides
Add 10% for waste, cuts, and extras
Building Length16" Spacing (per side)24" Spacing (per side)Total @ 16" (both sides)
20 ft161132
30 ft231646
40 ft312162
50 ft392678
60 ft463192

Rafter Lumber Sizing Guide (2026)

Rafter size depends on span, spacing, wood species, and roof load. Use this quick reference:

Lumber SizeMax Span @ 16" SpacingMax Span @ 24" Spacing2026 Avg Price/LF
2×6up to 13–14 ftup to 11–12 ft~$1.10“$1.40
2×8up to 17–18 ftup to 14–15 ft~$1.70“$2.00
2×10up to 21–22 ftup to 18–19 ft~$2.10“$2.40
2×12up to 25–26 ftup to 22–23 ft~$2.60“$3.00
⚠️ Always check local building codes. Rafter span tables in IRC (International Residential Code) are the legal standard. Snow load zones, wind zones, and local amendments can require larger lumber than these general guidelines.

Types of Rafters

  • Common Rafter: Runs perpendicular from wall plate to ridge board. Most standard rafter in gable roof construction. This calculator focuses on common rafters.
  • Hip Rafter: Runs diagonally from a corner of the building to the ridge, forming the hip on a hip roof. Hip rafters are longer than common rafters at the same pitch and require compound-angle cuts.
  • Valley Rafter: Forms the internal angle where two roof sections meet. Found in L-shaped houses or any intersecting roof planes.
  • Jack Rafter: A shorter rafter that runs from the wall plate to a hip or valley rafter rather than to the ridge board. Used to fill in the triangular sections of hip or valley roofs.
  • Collar Tie: Not technically a rafter — a horizontal member connecting opposing rafters to prevent spreading. Required by code at or near the ridge.

Worked Example — 40-Foot Ranch Home, 6/12 Pitch

Let's work through a real project: a 40-foot wide, 60-foot long ranch home with a 6/12 pitch, 16-inch rafter spacing, and 18-inch overhang.

CalculationFormulaResult
Run40 ft ÷ 220 ft
Rise20 × (6/12)10 ft
Rafter length√(20² + 10²) = √50022.36 ft
Overhang length1.5 ft × 1.1181.68 ft
Total cut length22.36 + 1.6824.04 ft
Rafters per side(60 ft × 12 ÷ 16) + 146
Total rafters46 × 2 sides + 10% waste102
Linear feet of lumber102 × 24.04 ft2,452 lf
Estimated cost (2×10 @ $2.20/lf)2,452 × $2.20$5,394

Frequently Asked Questions — Rafter Calculator

How do you calculate rafter length?
Use the Pythagorean theorem: Rafter Length = √(Run² + Rise²), where Rise = Run × (Pitch ÷ 12). Add the overhang length to get total cut length. Example: 15-ft run, 6/12 pitch → Rise = 7.5 ft → Rafter = √(225 + 56.25) = 16.77 ft.
What is roof pitch and how do I measure it?
Roof pitch is rise over run, expressed as X/12. Place a 12-inch level horizontally on the roof surface, hold it level, and measure the vertical distance from the level's end to the roof — that's your rise. A 6-inch rise = 6/12 pitch.
What is the most common roof pitch in the US?
6/12 pitch is the most popular across the country. 4/12 is common in warmer climates. Steeper pitches (8/12–12/12) are used in heavy-snow regions.
How many rafters do I need?
Per side: (Building length in inches ÷ spacing in inches) + 1, rounded up. Double it for both sides. Add 10% for waste. For a 40-ft building at 16" spacing: (480 ÷ 16) + 1 = 31 per side = 62 total × 1.1 = 68.
What size lumber should I use for rafters?
Quick reference: 2×6 up to 14-ft spans, 2×8 up to 18-ft spans, 2×10 up to 22-ft spans, 2×12 up to 26-ft spans (at 16" spacing, standard lumber grade). Always verify with IRC span tables for your specific load zone.
What is a ridge board and how long should it be?
The ridge board runs at the peak of the roof. Its length equals the building length (for a simple gable). It should be one size larger than the rafter lumber (e.g., 2×10 ridge for 2×8 rafters).
What is the difference between common, hip, valley, and jack rafters?
Common rafters go straight from wall to ridge. Hip rafters run diagonally to a corner on hip roofs. Valley rafters sit in the inside angle where two roof sections meet. Jack rafters are short rafters that connect to a hip or valley rafter instead of the ridge.
Do I need a building permit for roofing work?
Yes, for any structural roofing work (rafter replacement, new framing, additions) in most US jurisdictions. Shingle-only replacement may not require a permit everywhere. Check with your local building department before starting work.