Rafter Length Calculator

Calculate rafter length from building width, roof pitch, overhang, and beam thickness. Get results in feet and inches with roof angle, slope factor, and hip/valley factor.

Framing a roof without knowing your exact rafter length is a recipe for wasted lumber, bad cuts, and a frustrating day on the job site. Whether you're building a garage, framing a shed, or replacing rafters on your home, getting this measurement right the first time saves you hours of rework and hundreds of dollars in materials.

This rafter length calculator takes your building width, overhang, beam thickness, and roof pitch — then gives you the precise rafter length in feet and inches, along with the roof angle, slope factor, and hip and valley factor. No manual math, no digging through rafter tables. Just enter your numbers and get your cut list started.

What Is Rafter Length and Why Does It Matter?

Rafter length is the distance from the ridge board at the peak of your roof down to the outer edge of the wall plate — including any overhang you've planned. It's the single most important measurement in roof framing because every other cut depends on it.

Get it wrong by even an inch or two, and your ridge line won't be level, your sheathing won't line up, and you'll be shimming and re-cutting all day. On a standard residential roof, a 2-inch error at the rafter translates to roughly a 1/4-inch height difference at the ridge — enough to cause visible waviness in the finished roofline.

Rafter length depends on three things:

  • Building width (the span your roof needs to cover)
  • Roof pitch (how steep the roof is)
  • Overhang (how far past the wall the rafter extends)

The beam thickness also plays a role because rafters meet at the ridge board, and you need to account for half the ridge board thickness when calculating the actual run.

How Rafter Length Is Calculated

The math behind rafter length is based on the Pythagorean theorem — your roof is essentially a right triangle.

The core formula:

Rafter Length = √(Rise² + Run²)

Where:

  • Run = (Building Width ÷ 2) − (Beam Thickness ÷ 2) + Overhang
  • Rise = Run × (Pitch ÷ 12)

For example, on a 24-foot-wide building with a 6/12 pitch, 12-inch overhang, and 1.5-inch ridge beam:

  1. Run = (24 ÷ 2) − (1.5 ÷ 2) + 1 = 12 − 0.75 + 1 = 12.25 feet
  2. Rise = 12.25 × (6 ÷ 12) = 6.125 feet
  3. Rafter Length = √(6.125² + 12.25²) = √(37.52 + 150.06) = √187.58 = 13.70 feet (13 ft 8 in)

Understanding Roof Pitch

Roof pitch is expressed as a ratio — the number of inches the roof rises for every 12 inches of horizontal run. A 6/12 pitch means 6 inches of rise per 12 inches of run.

Here's a quick reference for common pitches:

Roof Pitch

Angle (degrees)

Slope Factor

Common Use

2/12

9.5°

1.014

Low-slope commercial, porch roofs

4/12

18.4°

1.054

Minimum for standard shingles

5/12

22.6°

1.083

Common residential

6/12

26.6°

1.118

Most popular residential pitch

8/12

33.7°

1.202

Steeper residential, colonial style

10/12

39.8°

1.302

Cape Cod, steep decorative roofs

12/12

45.0°

1.414

A-frame, very steep residential

The slope factor is a multiplier that converts horizontal run to actual rafter length. Multiply your total run by the slope factor, and you get the rafter length. It's a shortcut that experienced framers use on the job site instead of running the full Pythagorean calculation every time.

What About Hip and Valley Rafters?

Hip and valley rafters run diagonally from the ridge to the wall corners, making them longer than common rafters. The hip/valley factor (typically 1.414 for standard pitches) tells you how much longer these diagonal rafters are compared to the horizontal run.

To estimate a hip rafter length, multiply your common rafter run by both the slope factor and the hip/valley factor.

How to Use This Calculator

  1. Enter your building width — This is the full span from outside wall to outside wall. Select feet or inches from the unit dropdown.
  2. Enter the overhang — The distance your rafter will extend past the exterior wall. Most residential overhangs are 12 to 24 inches. Enter in inches.
  3. Enter the beam (ridge board) thickness — Standard dimensional lumber is 1.5 inches for a 2× board. If you're using an engineered ridge beam, enter its actual thickness.
  4. Select your roof pitch — Choose from the dropdown, ranging from 0/12 (flat) up through standard residential pitches. If you don't know your pitch, you can measure it with a speed square on an existing roof.
  5. Read your results — The calculator displays your rafter length in both feet-and-inches and decimal feet, plus the roof angle, slope factor, and hip/valley factor.

Practical Examples

Example 1: Standard Garage (24 ft wide, 6/12 pitch)

You're framing a detached two-car garage. The building is 24 feet wide, you want an 18-inch overhang for rain protection, and you're using a standard 2× ridge board (1.5 inches thick).

  • Building width: 24 ft
  • Overhang: 18 in
  • Beam thickness: 1.5 in
  • Pitch: 6/12

Result: Rafter length of approximately 15 ft 2 in. You'd buy 16-foot lumber and trim to fit, leaving room for your plumb cut at the ridge and bird's mouth at the wall plate.

Example 2: Backyard Shed (12 ft wide, 4/12 pitch)

Building a 12-foot-wide storage shed with a gentle 4/12 pitch. You want a modest 12-inch overhang and a 1.5-inch ridge board.

  • Building width: 12 ft
  • Overhang: 12 in
  • Beam thickness: 1.5 in
  • Pitch: 4/12

Result: Rafter length of approximately 7 ft 6 in. Standard 8-foot lumber works perfectly here with minimal waste.

Example 3: Covered Porch (16 ft wide, 3/12 pitch)

Adding a covered porch with a low 3/12 pitch and a generous 24-inch overhang for shade.

  • Building width: 16 ft
  • Overhang: 24 in
  • Beam thickness: 1.5 in
  • Pitch: 3/12

Result: Rafter length of approximately 10 ft 6 in. You'd go with 12-foot lumber. The low pitch means you'll need rolled roofing or membrane — standard asphalt shingles require at least a 4/12 pitch.

Example 4: Steep Colonial Roof (30 ft wide, 10/12 pitch)

Framing a steep colonial-style roof on a 30-foot-wide house with 18-inch overhangs.

  • Building width: 30 ft
  • Overhang: 18 in
  • Beam thickness: 1.5 in
  • Pitch: 10/12

Result: Rafter length of approximately 20 ft 8 in. You'll likely need to special-order longer lumber or use a splice joint. The steep pitch gives you excellent water shedding and potential for usable attic space.

Common Mistakes When Calculating Rafter Length

Forgetting to subtract the ridge board. The run isn't simply half the building width — you need to subtract half the ridge beam thickness from each side. On a 1.5-inch ridge board, that's 0.75 inches per side. Doesn't sound like much, but across a full roof with 20+ rafters, inconsistent ridge calculations create a crooked ridge line.

Measuring overhang from the wrong point. Overhang is measured horizontally from the outside face of the wall, not along the rafter slope. A 12-inch overhang on a 6/12 pitch actually adds about 13.4 inches of rafter length because the rafter is sloped.

Using nominal building width instead of actual. If your building plans say "24 feet," verify whether that's to the outside of the framing or the outside of the sheathing. Even a half-inch difference matters when you're cutting 30 rafters.

Confusing pitch with angle. A 6/12 pitch is not a 6-degree angle — it's 26.6 degrees. Mixing these up on a miter saw will ruin your cuts.

Rafter Length Reference Table

For quick estimates, here are rafter lengths for common building widths at popular pitches (assuming 12-inch overhang and 1.5-inch ridge board):

Building Width

4/12 Pitch

6/12 Pitch

8/12 Pitch

10/12 Pitch

12 ft

7 ft 4 in

7 ft 10 in

8 ft 8 in

9 ft 8 in

16 ft

9 ft 4 in

10 ft 2 in

11 ft 2 in

12 ft 8 in

20 ft

11 ft 6 in

12 ft 6 in

14 ft 0 in

15 ft 10 in

24 ft

13 ft 6 in

14 ft 10 in

16 ft 8 in

19 ft 0 in

30 ft

16 ft 10 in

18 ft 6 in

20 ft 10 in

23 ft 10 in

36 ft

20 ft 0 in

22 ft 2 in

25 ft 0 in

28 ft 8 in

Values are approximate. Use the calculator above for exact measurements with your specific overhang and beam dimensions.

Tips for Accurate Roof Framing

Always add extra length. Buy lumber at least one size longer than your calculated rafter length. You'll need material for the plumb cut at the ridge and the tail cut at the overhang. A 13 ft 6 in rafter means you're buying 16-footers, not 14-footers.

Double-check with a test rafter. Before cutting all your lumber, cut one test rafter and hold it in place. Verify that the ridge height, bird's mouth seat, and overhang all line up. Five minutes of testing saves an hour of re-cutting.

Account for the bird's mouth. The bird's mouth cut (the notch where the rafter sits on the wall plate) reduces the effective depth of the rafter at the bearing point. Make sure you're not cutting more than one-third of the rafter depth, or you'll weaken the structural connection.

Mark your measurements in the builder's fraction. Construction measurements use fractions — 1/16, 1/8, 1/4, and so on. Converting a decimal like 13.42 feet to feet and inches (13 ft 5 in) prevents errors when you're marking lumber with a tape measure.

Factors That Affect Your Rafter Length

Building width is the biggest factor. Every additional foot of building width adds roughly 6-8 inches of rafter length depending on your pitch.

Roof pitch has a multiplying effect. Going from a 4/12 to an 8/12 pitch on a 24-foot building adds about 3 feet to each rafter — that's significant when you're pricing lumber for 30+ rafters.

Overhang length adds directly to the rafter run. Most building codes require at least some overhang to protect the wall from water, and many homeowners prefer 18-24 inches for rain protection and shade.

Ridge beam size has a small but real effect. If you're using a 3.5-inch engineered beam instead of a 1.5-inch dimensional board, each rafter run shortens by an extra inch — which adds up across the full roof.

Frequently Asked Questions

How do I calculate rafter length from roof pitch?

Multiply half the building width by the slope factor for your pitch. For a 6/12 pitch (slope factor 1.118) on a 24-foot building: (24 ÷ 2) × 1.118 = 13.42 feet. Then add the overhang length multiplied by the same slope factor.

What size rafter do I need for a 20-foot span?

For a 20-foot span with a standard 6/12 pitch, your rafters will be about 12 feet 6 inches long. As for lumber dimension, most residential roofs use 2×8 or 2×10 rafters for 20-foot spans, but the required size depends on your local building code, snow load, and rafter spacing (16 or 24 inches on center).

What's the difference between rafter length and rafter run?

Rafter run is the horizontal distance from the outside of the wall to the center of the ridge board. Rafter length is the actual sloped distance along the rafter — it's always longer than the run because the rafter is angled. Think of run as the base of a triangle and rafter length as the hypotenuse.

How do I find my existing roof pitch?

Place a level horizontally against the underside of your rafter and measure 12 inches from the rafter. Then measure straight down from the 12-inch mark to the rafter. That vertical measurement is your pitch. If it's 6 inches, you have a 6/12 pitch.

Does overhang affect rafter length?

Yes. Overhang adds to the total rafter run, which increases the overall rafter length. A 12-inch overhang on a 6/12 pitch adds about 13.4 inches of actual rafter length. A 24-inch overhang on the same pitch adds about 26.8 inches. Always include overhang in your calculation.

What's the minimum roof pitch for asphalt shingles?

Most shingle manufacturers require a minimum 4/12 pitch (sometimes written as 2/12 with special underlayment). Below 4/12, water doesn't shed fast enough and can work under the shingle tabs, causing leaks. For pitches under 4/12, use rolled roofing, membrane, or metal panels.

How much longer are hip rafters than common rafters?

Hip rafters run diagonally from the ridge to the corner of the building, so they're longer than common rafters. Multiply your common rafter run by the hip/valley factor (1.414 for equal-pitch roofs) and then by the slope factor to get the hip rafter length.

Can I splice rafters if they're too long for standard lumber?

Yes, but splices must occur over a bearing point or be properly engineered. For residential construction, most codes require a splice plate nailed on both sides with a specific nailing pattern. If your calculated rafter length exceeds 20 feet, consider engineered trusses instead — they're often more economical and structurally consistent for long spans.

What is a slope factor and how do I use it?

The slope factor (also called the rafter factor or secant of the roof angle) is a multiplier that converts horizontal distance to sloped distance along the rafter. For a 6/12 pitch, the slope factor is 1.118 — meaning every 12 inches of horizontal run becomes 13.42 inches of actual rafter length. Multiply your total run by the slope factor to get the rafter length without doing the full Pythagorean calculation.

How does beam thickness affect rafter length?

The ridge beam sits at the peak where rafters from both sides meet. Since each rafter butts against the beam, you need to subtract half the beam thickness from each rafter's run. A thicker beam (like a 3.5-inch engineered beam) shortens each rafter by about an extra inch compared to a standard 1.5-inch ridge board. It's a small adjustment, but skipping it means your rafters will be slightly long, forcing the ridge board higher than planned.