Rafter Calculator
Calculate rafter length, overhang, roof angle, and slope from rise and run using the Pythagorean method. Enter rise, run, and any overhang to get the full rafter length to cut. Pairs with the roof pitch calculator for laying out a roof from scratch.
Rafter Framing Diagram
How the Formula Works
Calculate rise/run ratio (pitch)
Pitch (X:12) = (Rise ÷ Run) × 12 The pitch ratio defines the steepness. A 6:12 pitch rises 6 inches for every 12 inches of horizontal run. This ratio drives both the angle and the rafter length multiplier.
Calculate roof angle in degrees
Angle (°) = arctan(Rise ÷ Run) × (180 ÷ π) Convert the pitch to degrees using the inverse tangent. A 6:12 pitch equals approximately 26.57°. Used for saw blade bevel settings when cutting bird's-mouth and plumb cuts.
Calculate structural rafter length
Rafter = √(Rise² + Run²) Apply the Pythagorean theorem to the right triangle formed by the rise (vertical leg), run (horizontal leg), and rafter (hypotenuse). This is the length from the wall plate to the ridge — before overhang.
Calculate overhang rafter extension
Overhang rise = Overhang × (Rise ÷ Run) | Overhang rafter = √(Overhang² + Overhang rise²) The eave overhang extends the rafter past the wall at the same slope. Its sloped length is also calculated with the Pythagorean theorem using the horizontal overhang and its corresponding rise.
Calculate total rafter cut length
Total rafter = Rafter length + Overhang rafter extension Add the structural length and overhang extension to get the full board length to cut. Order lumber at least this long — standard lengths are 10, 12, 14, 16, 18, 20 ft. Round up to the next standard length and add a few inches for the bird's-mouth and ridge cuts.
Frequently Asked Questions
Use the Pythagorean theorem: rafter length = √(rise² + run²). For a 6:12 pitch over a 12-foot run with a 6-foot rise: √(6² + 12²) = √(36 + 144) = √180 ≈ 13.42 ft. This gives the structural length from the wall plate to the ridge center. Add your eave overhang length separately using the same formula applied to the overhang dimensions.
The span is the full horizontal width of the building from outside wall to outside wall. The run is half the span — the horizontal distance from the wall to directly below the ridge. For a 24-foot wide building, the run is 12 feet. This calculator uses run, not span — enter half your building width if you're working from a total building dimension.
The overhang extends the rafter horizontally past the wall at the same slope. Its additional rafter length is calculated the same way as the main rafter: overhang rafter = √(overhang² + (overhang × pitch/12)²). For a 1-foot overhang at 6:12: rise = 1 × 0.5 = 0.5 ft; overhang rafter = √(1² + 0.5²) = √1.25 ≈ 1.118 ft. This calculator handles the math automatically.
A bird's-mouth is a notch cut near the bottom of the rafter where it sits on the wall top plate. It has two cuts: a plumb cut (vertical, parallel to the ridge) and a seat cut (horizontal, parallel to the top plate). The bird's-mouth notch typically equals the width of the top plate — about 3.5 inches (one stud width). The rafter length in this calculator runs from the ridge plumb cut to the wall plumb cut at the bird's-mouth, not to the fascia end.
The roof angle in degrees is the number to set your circular saw or miter saw bevel for plumb cuts (ridge and bird's-mouth). For a 6:12 pitch, the angle is arctan(6/12) ≈ 26.57°. Set your saw to 26.57°. The seat cut (horizontal) is the complement: 90° − 26.57° = 63.43°. Always test on scrap lumber before cutting your full run of rafters.
Rafter sizing depends on span, spacing, species, and load. Common residential sizing: 2×6 for spans up to about 12–14 ft at 16" OC; 2×8 up to 16–18 ft; 2×10 up to 20–22 ft; 2×12 for longer spans. These are rough guides — always consult span tables (IRC Table R802.4 or equivalent) and your local building code. Most jurisdictions require an engineer's stamp for unusual spans or heavy snow loads.
Rafter count depends on your ridge length and spacing. At 16" OC: count = ⌈(ridge length / spacing)⌉ + 1, then × 2 for both sides. A 20-foot ridge at 16" OC: (20 × 12 / 16) + 1 = 16 rafters per side × 2 sides = 32 rafters. Add two for the gable-end rafters. This calculator focuses on rafter length — for total count, divide ridge length by spacing and add end rafters.
Common rafters run perpendicular from the wall plate to the ridge — this calculator calculates common rafter length. Hip rafters run at 45° from a corner to the ridge end on hip roofs — their length is longer: hip rafter = √(run² + run² + rise²) = √(2 × run² + rise²). Valley rafters occupy re-entrant corners on L-shaped roofs and use the same formula as hip rafters. Jack rafters are shortened common rafters that frame into hip or valley rafters rather than the ridge.
References
- International Residential Code IRC R802 – Wood Roof Framing
- American Wood Council (AWC) Span Tables for Joists and Rafters