terican

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.

FreeInstantNo signupOpen source

Inputs

Total Rafter Length

Explain my result

0/3 free

Get a plain-English breakdown of your result with practical next steps.

Total Rafter Lengthft

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

Frequently asked questions

How do I calculate rafter length for a 24-foot wide house with a 6/12 pitch?
For a 24-foot span with a 6/12 pitch and no overhang, the rafter run is 12 feet (half the 24-foot span). The vertical rise is 12 × 0.5 = 6 feet. Applying the Pythagorean theorem produces √(12² + 6²) = √180 ≈ 13.42 feet. Add overhang length separately by multiplying the horizontal overhang by √(1 + 0.25) ≈ 1.118.
What is roof pitch and how does it affect rafter length?
Roof pitch expresses the vertical rise in inches for every 12 inches of horizontal run. A 6/12 pitch rises 6 inches per foot. Higher pitches produce substantially longer rafters on the same building — a 12/12 pitch rafter is approximately 41% longer than a 4/12 pitch rafter on the same 24-foot building, directly driving up both lumber cost and installation labor time.
Does the eave overhang get added to the rafter length calculation?
Yes. The eave overhang follows the same slope as the main rafter body, so its actual length along the rafter exceeds its horizontal projection. The formula multiplies the horizontal overhang distance by √(1 + (P/12)²) to find the true added length. For a 1.5-foot horizontal overhang at a 6/12 pitch, this adds approximately 1.68 feet to the total rafter length.
What is the difference between rafter run and rafter span?
Rafter span refers to the full exterior width of the building measured wall to wall. Rafter run is exactly half the span — the horizontal distance one common rafter covers from the wall plate to the ridge centerline. On a 30-foot-wide building, the rafter run is 15 feet. Confusing span for run doubles all length calculations and is one of the most common framing measurement errors.
How much extra rafter length should be added when ordering lumber?
Add 2 to 4 inches to account for the birdsmouth seat cut at the wall plate and the ridge plumb cut at the upper end, after deducting half the ridge board thickness (typically 0.75 inches). Most estimators also apply a 5–10% waste factor to the full order. For a calculated rafter length of 15 feet, order 16-foot stock to cover all deductions and trimming margin comfortably.
Can this rafter length formula be used for hip roofs?
This formula applies to common rafters only, which are used on gable roofs and as the field rafters within hip roofs. Hip rafters run diagonally at 45 degrees in plan view and require a separate calculation — the hip rafter run equals the common rafter run multiplied by approximately 1.414 (√2) before applying pitch geometry. Valley rafters use the same diagonal correction factor. A dedicated hip rafter calculator should handle those members.