Last verified · v1.0
Calculator · construction
Rafter Length Calculator
Calculate exact rafter lengths instantly using building span, roof pitch, and eave overhang. Powered by the Pythagorean theorem for precise framing results.
Inputs
Total Rafter Length
—
Explain my result
Get a plain-English breakdown of your result with practical next steps.
The formula
How the
result is
computed.
Rafter Length Calculator: Formula and Methodology
Accurate rafter length calculation is one of the most critical tasks in residential and commercial roof framing. The rafter length calculator applies the Pythagorean theorem to roof geometry, combining building span, roof pitch, and eave overhang into a single precise measurement that determines how long each common rafter must be cut.
The Rafter Length Formula
The complete formula for total rafter length is:
L = √((S/2)² + (S/2 · P/12)²) + O · √(1 + (P/12)²)
Where the variables are defined as follows:
- L — Total rafter length (feet)
- S — Building span: total exterior width from outside wall to outside wall (feet)
- P — Roof pitch: vertical rise in inches per 12 inches of horizontal run
- O — Eave overhang: horizontal projection of the rafter beyond the exterior wall (feet)
Formula Derivation
A symmetric gabled roof divides the building span into two equal halves. Each common rafter covers a horizontal run of S/2 feet. The roof pitch P/12 defines the slope ratio, so the total vertical rise over that run equals (S/2) × (P/12). These two legs form a right triangle, and the Pythagorean theorem gives the rafter body length as the hypotenuse:
Rafter body = √((S/2)² + ((S/2)(P/12))²)
The eave overhang extends the rafter horizontally beyond the wall by distance O. Because the overhang follows the same pitch as the rafter, its along-the-rafter length is longer than its horizontal projection. That length equals O × √(1 + (P/12)²), which scales the unit hypotenuse of the pitch triangle by O. Summing the two components produces the full rafter length L. This derivation follows the methodology established in BYU-Idaho Framing Construction Processes and Materials and conforms to span and geometry standards published in the Lancaster County Span Tables for Joists and Rafters.
Variables Explained
Building Span (S)
The building span is the total exterior width measured from the outer face of one wall plate to the outer face of the opposite wall plate. For a 28-foot-wide home, S = 28. The calculator halves this value to find the rafter run — the horizontal distance each rafter must bridge from the wall to the ridge centerline.
Roof Pitch (P)
Pitch is always expressed as rise over a 12-inch run. A 6/12 pitch rises 6 inches vertically for every 12 inches of horizontal run, producing a 26.6-degree slope. Common residential pitches range from 4/12 (low slope, roughly 18 degrees) to 12/12 (a steep 45-degree slope). Steeper pitches yield significantly longer rafters on the same building — a 12/12 pitch rafter is about 41% longer than a 4/12 rafter over the same span.
Eave Overhang (O)
The eave overhang is the horizontal distance the rafter projects past the exterior wall. Standard residential overhangs range from 12 to 24 inches (1 to 2 feet). Wider overhangs improve weather protection for siding and windows but require longer rafter stock and heavier lumber grades.
Step-by-Step Example
Consider a gable-roof house with these specifications: building span = 28 feet, roof pitch = 6/12, eave overhang = 1.5 feet.
- Step 1 — Find the run: 28 ÷ 2 = 14 feet
- Step 2 — Calculate the rise: 14 × (6/12) = 7 feet
- Step 3 — Rafter body length: √(14² + 7²) = √(196 + 49) = √245 ≈ 15.65 feet
- Step 4 — Overhang length along rafter: 1.5 × √(1 + 0.25) = 1.5 × 1.118 ≈ 1.68 feet
- Step 5 — Total rafter length: 15.65 + 1.68 = 17.33 feet
A framing carpenter would order 18-foot rafter stock to accommodate this length plus cutting margin for the birdsmouth and ridge plumb cut.
Practical Applications
- New construction framing: Determine cut schedules and lumber order quantities for entire roof framing crews before breaking ground
- Roof replacement and re-roofing: Match existing rafter dimensions precisely when replacing sheathing or storm-damaged members
- Outbuildings and sheds: Size rafters for simple gabled structures without professional engineering software
- Material cost estimation: Calculate total board-feet of lumber needed for accurate roofing bids
As noted in the ERIC technical report on calculating hip rafter lengths, mastery of rafter geometry using right-triangle mathematics is a foundational competency for carpentry apprentices and journeymen alike.
Important Adjustments for Real-World Cutting
The formula yields the theoretical rafter length from the ridge centerline to the fascia line. In practice, deduct half the ridge board thickness (typically 0.75 inches for a 2× ridge) from the upper end. At the wall plate, account for the birdsmouth depth. Always add a 2–3 inch waste allowance and round up to the next standard lumber length when placing a lumber order.
Reference