Skip to content

Rafter Length Calculator - Roof Pitch to Rafter Length

Calculate rafter length from a building's width and roof pitch, entered as a ratio like 6:12 or an angle in degrees, using the Pythagorean theorem for framing.

Rafter Length Calculator

Calculate the length of rafters based on the building width and roof pitch. Enter the required measurements below to get an accurate rafter length calculation.

Input Measurements

ft
Roof Pitch Type
:12

Results

Rafter Length
12.65ft

Calculation Formula

The rafter length is calculated using the Pythagorean theorem: Rafter Length = √[(Width/2)² + (Pitch × Width/24)²], where Width is the building width and Pitch is the roof pitch ratio.

Roof Visualization

Loading calculator...
📚

Documentation

A rafter length calculator finds the length of a roof rafter from a building's width and its roof pitch. A rafter is one of the sloped beams that run from the ridge, the peak of the roof, down to the outer walls. Rafter length depends on two things: how wide the building is and how steep the roof slopes.

What Is a Rafter?

Builders use a small set of terms to describe a roof shape.

  • Rafter: a sloped beam that runs from the ridge down to the wall, supporting the roof deck and roofing material.
  • Span: the full width of the building, measured from the outside of one wall to the outside of the opposite wall.
  • Run: half the span. It is the horizontal distance from the wall to a point directly under the ridge.
  • Rise: the vertical distance the roof climbs from the wall to the ridge.
  • Pitch: how steep the roof is, written as a ratio such as 6:12 or as an angle in degrees such as 26.6°.
  • Pitch ratio: a number written as x:12. It means the roof rises x inches for every 12 inches of horizontal run. A 6:12 pitch rises 6 inches for every 12 inches of run.
  • Ridge: the horizontal line at the top of the roof where the rafters from both sides meet.

Rafter Length Formula

A rafter, the run beneath it, and the rise above it form a right triangle. The rafter is the longest side of that triangle, called the hypotenuse. Its length can be found with the Pythagorean theorem.

Using Pitch Ratio (x:12)

Run=Building Width2\text{Run} = \frac{\text{Building Width}}{2}

Rise=Run×Pitch Ratio12\text{Rise} = \text{Run} \times \frac{\text{Pitch Ratio}}{12}

Rafter Length=Run2+Rise2\text{Rafter Length} = \sqrt{\text{Run}^2 + \text{Rise}^2}

Using Roof Angle (Degrees)

When the roof slope is given as an angle instead of a ratio, the formula uses cosine:

Rafter Length=Runcos(θ)\text{Rafter Length} = \frac{\text{Run}}{\cos(\theta)}

Here θ is the roof angle in degrees, and Run is still half the building width.

Converting Between Pitch Ratio and Angle

Angle=tan1(Pitch Ratio12)\text{Angle} = \tan^{-1}\left(\frac{\text{Pitch Ratio}}{12}\right)

Pitch Ratio=12×tan(Angle)\text{Pitch Ratio} = 12 \times \tan(\text{Angle})

A 4:12 pitch equals about 18.4°. A 6:12 pitch equals about 26.6°. A 12:12 pitch equals 45°.

How to Calculate Rafter Length: Example

Take a building 24 feet wide with a 6:12 pitch.

  1. Run = 24 ÷ 2 = 12 feet
  2. Rise = 12 × (6 ÷ 12) = 6 feet
  3. Rafter length = √(12² + 6²) = √180 ≈ 13.42 feet

A 24-foot-wide building with a 6:12 pitch needs rafters about 13.42 feet long, measured from the ridge centerline to the outer edge of the wall. This length does not include any roof overhang.

A second example shows a steeper pitch. A building 28 feet wide with a 7:12 pitch has a run of 14 feet and a rise of 14 × (7 ÷ 12) ≈ 8.17 feet. The rafter length is √(14² + 8.17²) ≈ 16.21 feet.

Common Rafter Lengths by Building Width and Pitch

Building Width (ft)Pitch RatioRoof Angle (°)Rafter Length (ft)
244:1218.412.65
246:1226.613.42
248:1233.714.42
2412:1245.016.97
304:1218.415.81
306:1226.616.77
308:1233.718.03
3012:1245.021.21
364:1218.418.97
366:1226.620.12
368:1233.721.63
3612:1245.025.46

These are common values. The calculator works for any building width and any pitch.

How Roof Pitch Affects the Amount of Roofing Material

A steeper roof needs longer rafters, and a longer rafter means more roof surface to cover with shingles or other material. For a building of a given width, an 8:12 roof needs about 14% more rafter length than a 4:12 roof, and so about 14% more surface area to cover. Steeper roofs also take longer to install because work at a steep angle is slower and needs more safety equipment.

Limitations

The formulas above give the length of a common rafter, the kind that runs straight from the ridge to the wall on a simple gable roof. They do not cover hip or valley rafters, which run diagonally across corners and need different geometry. The result also does not include roof overhang past the wall, and it does not account for the thickness of the ridge board, which shortens each rafter slightly where it meets the ridge. The calculator does not check local building codes or structural loads such as snow weight; those require an engineer or a licensed contractor.

Frequently Asked Questions

What is a rafter length calculator?

It is a tool that computes the length of a roof rafter from the building width and the roof pitch. It applies the Pythagorean theorem so the user does not have to do the trigonometry by hand.

How do you calculate rafter length for a 6:12 pitch?

Divide the building width by 2 to get the run. Multiply the run by 6/12 to get the rise. Then take the square root of the run squared plus the rise squared. For a 24-foot-wide building this gives a rafter length of about 13.42 feet.

Does rafter length include the roof overhang?

No. The calculated length runs from the ridge centerline to the outer wall plate. Any overhang, commonly 12 to 18 inches on houses, must be added separately.

Can this calculator find hip or valley rafter length?

No. Hip and valley rafters run diagonally at roof corners and follow different geometry than the common rafters this calculator handles.

What is a typical roof pitch for a house?

Most houses use a pitch between 4:12 and 9:12. A 6:12 pitch is common because it drains water well without being difficult or costly to build. Regions with heavy snow often use steeper pitches, such as 8:12 or more, to help snow slide off.

How much more roofing material does a steep roof need?

For the same building width, an 8:12 roof needs about 14% more rafter length, and roughly 14% more roofing material, than a 4:12 roof. Steeper pitches also usually cost more in labor because work is slower and requires more safety equipment.

References

  1. American Wood Council. (2018). Span Tables for Joists and Rafters. American Wood Council.
  2. Huth, M. W. (2011). Understanding Construction Drawings (6th ed.). Cengage Learning.
  3. International Code Council. (2021). International Residential Code for One- and Two-Family Dwellings. International Code Council.
  4. Thallon, R. (2008). Graphic Guide to Frame Construction (3rd ed.). Taunton Press.
  5. Wagner, W. H. (2019). Modern Carpentry: Essential Skills for the Building Trades (12th ed.). Goodheart-Willcox.