Roof framing math

Rafter Length Formula

If you want to understand the rafter length formula without digging through framing tables, this page gives you the simple version. It explains how to calculate rafter length using building span, roof pitch, and optional overhang with plain English and worked examples.

For a standard common rafter on a simple gable roof, the math is based on a right triangle. Once you know the run and rise, the rafter length is just the hypotenuse.

If you need to convert roof pitch to degrees first, use the roof pitch to angle calculator.

Basic Rafter Length Formula

The standard rafter length formula comes from the Pythagorean theorem.

Common run = Building span ÷ 2 Slope ratio = Pitch rise ÷ Pitch run Rise over common run = Common run × Slope ratio Rafter length = √(Common run² + Rise²)

This works for a common rafter on a simple centered gable roof. If the roof includes overhang, you extend the horizontal run outward and calculate the sloped length again using the same pitch.

Rafter length formula with overhang

Total horizontal distance = Common run + Overhang Rise at outer edge = Total horizontal distance × Slope ratio Rafter length with overhang = √(Total horizontal distance² + Rise at outer edge²)

How to Calculate Rafter Length

  1. Measure the full building span.
  2. Divide the span by 2 to get the common run for a centered gable roof.
  3. Convert pitch into a slope ratio by dividing rise by run.
  4. Multiply the common run by that ratio to get the vertical rise.
  5. Use the Pythagorean theorem to find the rafter length.
  6. If needed, add overhang to the run and repeat the same process.

This is the same process used by a rafter calculator. The main advantage of the calculator is speed and convenience, especially when checking multiple roof pitches or spans.

Worked Example: Rafter Length Without Overhang

Example: A building has a 24 foot span and a 6/12 roof pitch.

Step 1: Common run = 24 ÷ 2 = 12 feet

Step 2: Slope ratio = 6 ÷ 12 = 0.5

Step 3: Rise = 12 × 0.5 = 6 feet

Step 4: Rafter length = √(12² + 6²) = √180 = 13.42 feet

Worked Example: Rafter Length With Overhang

Example: Same roof, but with a 1 foot overhang.

Step 1: Total horizontal distance = 12 + 1 = 13 feet

Step 2: Rise at outer edge = 13 × 0.5 = 6.5 feet

Step 3: Rafter length with overhang = √(13² + 6.5²) = √211.25 = 14.53 feet

Quick Reference Table

The table below shows the sloped rafter length for 12 units of horizontal run at common roof pitches.

Roof pitch Angle in degrees Rafter length per 12 run
3/1214.04°12.37
4/1218.43°12.65
5/1222.62°13.00
6/1226.57°13.42
7/1230.26°13.89
8/1233.69°14.42
9/1236.87°15.00
10/1239.81°15.62
12/1245.00°16.97

To estimate a rafter quickly, multiply the horizontal run by the factor for the roof pitch. This is a handy shortcut when you already know the pitch.

When This Formula Works Best

This formula works best for a standard common rafter on a simple roof layout. It is useful for rough estimating, planning, and learning the math behind a rafter calculator.

More complex roofs, special cuts, structural details, and exact framing layout may require additional measurements beyond the basic formula shown here.

FAQ

What is the formula for rafter length?
For a common rafter, use the square root of run squared plus rise squared. The run is usually half the building span for a simple gable roof.
How do you calculate rafter length from span and pitch?
Divide the span by two, convert pitch to a slope ratio, calculate the rise over that run, and then use the Pythagorean theorem to find the sloped rafter length.
Does the formula include overhang?
Not by default. To include overhang, add the overhang to the common run and calculate the new sloped length using the same pitch.
Can I use this for sheds and small gable roofs?
Yes. The formula is commonly used for simple shed, garage, and small residential roof calculations.
What if I do not want to do the math by hand?
Use the rafter length calculator on the main page to get the same result faster.