Calculate common rafter length from roof run and pitch using the Pythagorean theorem. Enter your building span, pitch, and overhang to get rafter length, rise, slope factor, angle in degrees, and rafter count.
✓Verified: Inch Calculator rafter formula & Pythagorean theorem — April 2026
✓Rafter length calculated using the Pythagorean theorem — the industry standard for common rafter framing. Slope factors verified against Inch Calculator and carpenter framing references.
Full formula including ridge board adjustment: rafter = (span/2 + overhang/12 − ridge/2/12) × slope factor. Verified against multiple example calculations.
Formulas: Run = (span/2) − (ridge/2/12). Rise = run × pitch/12. Slope factor = sqrt(pitch² + 144) / 12. Line length = run × slope factor. Overhang length = overhang_in/12 × slope factor. Total rafter = line length + overhang length. Angle = atan(pitch/12) × 180/π. Rafter count = (ceil(roof_length_in / spacing) + 1) × 2.
⏱ Last reviewed: April 2026
How to Calculate Rafter Length — Step by Step
Rafter length calculation is one of the most fundamental skills in residential framing. A common rafter is the diagonal structural member that runs from the ridge board at the peak of the roof down to the top plate of the exterior wall. Its length is determined by two measurements: the run (horizontal distance from wall plate to ridge center) and the rise (vertical height from wall plate to ridge).
The mathematics is pure Pythagoras: because the rafter, rise, and run form a right triangle, the rafter length is the hypotenuse — equal to the square root of (rise² + run²). In practice, carpenters use a shortcut called the slope factor (also called the rafter factor or pitch multiplier), which is precalculated for each standard pitch and eliminates the need to calculate rise separately.
Rafter Length Formula
Run = Span / 2 − Ridge Thickness / 2 / 12
Rise = Run × Pitch / 12
Slope Factor = √(Pitch² + 144) / 12
Rafter Line Length = Run × Slope Factor
Total Rafter = Line Length + (Overhang ÷ 12 × Slope Factor)
Example — 24 ft span, 6:12 pitch, 12″ overhang, 1.5″ ridge:
Run = 24/2 − 1.5/2/12 = 12 − 0.0625 = 11.9375 ft
Slope factor = √(36+144)/12 = √180/12 = 1.118
Line length = 11.9375 × 1.118 = 13.34 ft
Overhang = 12/12 × 1.118 = 1.118 ft
Total rafter = 13.34 + 1.12 = 14.46 ft (order 16 ft boards)
Slope Factor Reference Table — All Standard Pitches
Mechanically seamed only; standard panels require 2:12+
Concrete/clay tile
4:12
Heavier — check structural requirements
Wood shingles/shakes
3:12
4:12+ recommended for best performance
EPDM / flat membrane
1/4″/ft
Requires minimum drainage slope per code
💡 Framing tip: Always order rafter boards at least 6–12 inches longer than your calculated total rafter length. Boards are cut long and trimmed in place — this allows for birdsmouth adjustments, plumb cuts at the ridge, and tail cuts at the overhang. For a calculated 14.5 ft rafter, order 16 ft boards. Rafters are typically installed crown up (slight bow facing upward) so any natural curve works with, not against, the roof load.
Frequently Asked Questions
Rafter length = run × slope factor, where slope factor = sqrt(pitch² + 144) / 12. First find the run: half the building span minus half the ridge thickness. Then multiply by the slope factor for your pitch. Add overhang: overhang_inches/12 × slope factor. Example: 24-ft span, 6:12 pitch, 12″ overhang = (12 − 0.0625) × 1.118 + 1 × 1.118 = 14.46 ft.
Two methods: (1) Pythagorean: Rafter = sqrt(Rise² + Run²) where Rise = Run × Pitch/12. (2) Slope factor: Rafter = Run × sqrt(Pitch² + 144)/12. Both give the same result. The slope factor method is faster when you know the pitch. For a 6:12 pitch, slope factor = 1.118, so every 10 ft of run needs 11.18 ft of rafter.
The run is the horizontal distance from the outside wall plate to the center of the ridge. For a simple gable roof: run = span/2 minus half the ridge board thickness. For a 24-ft wide building with a 1.5-inch ridge board: run = 12 − 0.0625 = 11.9375 ft. The run is always measured horizontally, not along the rafter slope.
Roof pitch is expressed as rise per 12 inches of run (e.g., 6:12 = 6″ rise per 12″ run = slope factor 1.118). Higher pitch = longer rafters for the same run. A 4:12 pitch with 12-ft run needs 12.65-ft rafters. A 12:12 pitch with the same run needs 16.97-ft rafters. Pitch also determines roofing material compatibility and snow/rain shedding performance.
Calculate the main rafter line length (ridge to wall plate), then add: overhang rafter length = horizontal overhang in feet × slope factor. Example: 12-inch overhang on 6:12 pitch: 1 ft × 1.118 = 1.118 ft additional. Total rafter = 13.34 + 1.12 = 14.46 ft. Always buy boards at least 6 inches longer than calculated to allow for trimming.
The slope factor converts horizontal run to sloped rafter length. Formula: sqrt(pitch² + 144) / 12. Key values: 4:12 = 1.054, 5:12 = 1.083, 6:12 = 1.118, 7:12 = 1.158, 8:12 = 1.202, 9:12 = 1.250, 12:12 = 1.414. Multiply your run by this factor to get the rafter line length instantly without using the Pythagorean theorem.
Rafter count per side = ceil(roof length in inches / spacing in inches) + 1. At 16″ OC for a 30-ft roof: ceil(360/16) + 1 = 24 rafters per side, 48 total. At 24″ OC: ceil(360/24) + 1 = 16 per side, 32 total. Add extras for gable ends (2 per gable), valleys, and any special framing. Most residential roofs use 16″ OC spacing.
Common guidelines: 2×6 for spans up to 12–14 ft at 16″ OC in light snow. 2×8 for spans 14–18 ft. 2×10 for spans 18–22 ft. 2×12 for longer spans or heavy snow. Always verify with span tables for your lumber species (Douglas Fir, SPF, Southern Yellow Pine) and check local building codes. Snow loads, wind loads, and dead loads all affect the required size.
A birdsmouth is the notch cut into the bottom of the rafter where it rests on the wall top plate. It has a plumb cut (vertical) and a seat cut (horizontal). The seat cut depth should not exceed one-third of the rafter depth per most building codes. The birdsmouth transfers roof load to the wall and keeps the rafter from sliding off the plate. Its position determines the wall height and overhang configuration.
Rafter span = the horizontal distance covered (same as the run). Rafter length = the actual sloped measurement along the board. For a 6:12 pitch with 12-ft run: span = 12 ft, but rafter line length = 12 × 1.118 = 13.42 ft. Building codes and span tables reference the horizontal span, not the sloped length, when specifying maximum rafter spans for different lumber sizes.