Article — Rafter Length Calculator
Rafter length calculator: Pythagoras for any roof pitch
A rafter length calculator finds the sloped distance from the ridge to the wall plate using the Pythagorean theorem: rafter = √(run² + rise²). Run is the horizontal half-span; rise is run × pitch / 12. A 15 ft run at 6:12 pitch produces a rafter 16.77 ft long before overhang. Add overhang × rafter multiplier for the tail, and add roughly 6% for hip or valley rafters that cut diagonally between two sloped planes.
The rafter length formula
Every rafter is the hypotenuse of a right triangle. The horizontal leg is the run, the vertical leg is the rise, and the diagonal is the rafter itself. Pitch supplies the ratio between rise and run.
rise = run × pitch / 12 vertical heightL = √(run² + rise²) PythagorasM = √(1 + (pitch/12)²) rafter multiplierL = run × M one-step formangle = arctan(pitch/12) degrees from horizontalL_tail = overhang × M tail on slopeThe one-step form using the rafter multiplier saves time on the job site. A 20 ft run at 8:12 pitch is 20 × 1.2019 = 24.04 ft. A 12 ft run at 4:12 is 12 × 1.0541 = 12.65 ft. Carpenters carry the multipliers stamped into framing squares so the work happens without a calculator.
Roof pitch and rafter length
Pitch is expressed as rise over a 12 inch run. 4:12 means 4 inches of vertical rise for every 12 inches of horizontal travel. Below 2:12 the roof is too flat for shingles and needs a membrane system. Between 4:12 and 9:12 lies most of US residential construction. Above 12:12 the roof exceeds 45 degrees and crosses into the steep-slope category that demands harnesses and roof jacks for safe installation.
Rafter overhang and tail length
The overhang is the part of the rafter that extends past the wall plate. Standard US residential overhang runs 12 to 24 inches. The overhang shades windows, protects exterior walls from rain, and conceals the soffit and gutter. On the slope, the tail length is the horizontal overhang multiplied by the rafter multiplier.
For a 6:12 roof with an 18 inch overhang, the tail on the slope is 18 × 1.118 = 20.12 inches. The full rafter — ridge to fascia — is run × M plus overhang × M. A 15 ft run with an 18 inch overhang at 6:12 pitch needs a rafter that is 16.77 + 1.68 = 18.45 ft long, cut from a 20 ft 2×10.
Buy lumber one foot longer than the calculated rafter length on every piece. The extra absorbs the birds-mouth seat cut, the ridge plumb cut, and any layout error. Pre-cutting tight to the calculated length leaves no margin and turns a single mistake into a wasted 16 ft board.
Hip and valley rafter length
Common rafters run perpendicular to the ridge. Hip and valley rafters run diagonally between two adjacent sloped planes, so their effective run is longer than a common rafter at the same horizontal distance. The approximation roughly √2 × common rafter length (≈ 1.34× at 6:12 pitch) works for most residential pitches between 3:12 and 8:12 with equal slopes on both sides.
The exact hip rafter multiplier depends on both adjacent pitches. For equal slopes the formula is √(17² + pitch²) / 12 — a 6:12 hip uses √(289 + 36) / 12 = 18.03 / 12 = 1.503 inches of hip rafter per inch of run on the diagonal. Carpenters round to 1.06 against common-rafter length for quick estimation, then cut precise compound angles using a framing square or rafter-square hip tables.
The birds-mouth and ridge cut
Two cuts shorten every common rafter. The birds-mouth is the triangular notch where the rafter sits on the top plate; it has a horizontal seat cut and a vertical heel cut. The ridge cut is a plumb cut at the upper end that mates against the ridge board. IRC R802.5 limits the seat cut depth to one-third of the rafter depth, since the cut removes bending strength.
The seat cut must not exceed one-third of the rafter depth. A 2×10 rafter (actual 9.25 in) allows a maximum 3 in deep seat. Deeper cuts remove the lower fibers that resist bending, and the rafter can fail at the cut even if it carries the rated span. If the wall plate sits too low for the standard seat, switch to a deeper rafter or add a structural ridge instead.
The ridge plumb cut removes half the ridge board thickness from the rafter top. A 1.5 inch ridge board takes 0.75 inches off each rafter at the ridge. The calculated rafter length usually includes this adjustment; if not, subtract 0.75 inches from the long-point of the plumb cut before marking.
Rafter span limits and code
IRC R802.5.1 and the AWC span tables set the maximum allowable horizontal projection for a given lumber size, species, grade, and load. A 2×6 #2 Douglas Fir-Larch rafter at 16 inch on-center spans 13 ft 4 in under 30 psf snow load; a 2×10 reaches 18 ft 0 in under the same conditions. The calculator returns the diagonal length, not the allowable span — always cross-check the AWC or IRC tables before ordering lumber. A 16.77 ft rafter at 6:12 pitch covers 15 ft of horizontal run, and 15 ft is the number the span table allows or rejects.
Common rafter length mistakes
The most frequent error is confusing run with full span. Run is half the span, measured from the outside of the wall plate to the centerline of the ridge. A 30 ft wide building has a 15 ft run, not a 30 ft run. The second mistake is forgetting overhang: a rafter cut without tail ends at the wall and leaves no soffit or gutter.
- Run vs span — run is half the building width; span is the full width
- Pitch convention — always rise over 12 inches of run, not over the slope length
- Ridge subtraction — half the ridge thickness (~0.75 in for 1.5 in plate) comes off each rafter at the ridge cut
- Birds-mouth seat depth — never more than one-third of rafter depth per IRC R802.5
- Hip rafter factor — about 1.06 × common rafter for equal-pitch hip roofs
- Lumber overage — order one foot longer than calculated on every rafter
- Span tables — IRC span limits use horizontal run, not the calculated rafter length
Tools and field shortcuts
A framing square is the fastest pre-digital tool. Both arms carry rafter tables stamped into the steel: pick the pitch (rise per 12), read across to the common-rafter length per foot of run. A 6:12 pitch shows 13.42 inches of rafter per foot of run — multiply by run in feet to get the rafter length in inches. The same table gives hip-rafter and jack-rafter lengths. Phone apps and laser distance meters update the workflow, but the math has not changed since Euclid.