Rafter Length Calculator
Rafter Length Calculator: Calculate Roof Rafter Length by Pitch, Run, and Overhang
A rafter length calculator helps you work out the correct roof rafter length before cutting lumber. It is useful for sheds, garages, porches, cabins, extensions, and simple gable roofs where you know the roof span, pitch, run, or overhang.
Rafter length is the diagonal measurement of the board that runs from the ridge area down to the wall plate. It is not the same as the width of the building. The steeper the roof pitch, the longer the rafter becomes.
This guide explains how to calculate rafter length, how pitch affects the result, how to include overhang, and how to estimate rafter count for a roof framing project.
What Is a Rafter Length Calculator?
A rafter length calculator estimates the sloped length of a roof rafter. Most calculators use the roof run and pitch to calculate the diagonal measurement.
You usually need:
| Measurement | What It Means |
|---|---|
| Roof span | Full width of the building |
| Run | Horizontal distance from wall to ridge |
| Rise | Vertical height from wall plate to ridge |
| Pitch | Roof slope, such as 4/12 or 6/12 |
| Overhang | Extra rafter length beyond the wall |
| Rafter length | Final diagonal board length |
For a standard gable roof, the run is usually half the building width. For a shed roof, the run is often the full distance from the low wall to the high wall.
Rafter Length Formula
The basic rafter length formula is:
Rafter length = √(run² + rise²)
If you know the roof pitch, calculate rise first:
Rise = run × pitch
For example, a 6/12 pitch means the roof rises 6 inches for every 12 inches of horizontal run.
That means:
6 ÷ 12 = 0.5
So if the run is 10 feet:
10 × 0.5 = 5 feet rise
Then:
√(10² + 5²) = 11.18 feet
The rafter length is about 11.18 feet, before adding overhang or making final cut adjustments.
How to Calculate Rafter Length
Follow these steps.
1. Measure the Building Width
Start with the full outside width of the building.
Example:
A building is 20 feet wide.
2. Find the Run
For a gable roof:
Run = building width ÷ 2
So:
20 ÷ 2 = 10 feet
3. Find the Rise
If the pitch is 6/12:
6 ÷ 12 = 0.5
Then:
10 × 0.5 = 5 feet
4. Calculate the Rafter Length
Use the formula:
√(run² + rise²)
So:
√(10² + 5²) = 11.18 feet
That is the main rafter length from the ridge area to the wall line.
Rafter Length by Roof Pitch
This table shows the approximate rafter length for every 1 foot of horizontal run.
| Roof Pitch | Length Per 1 ft Run |
|---|---|
| 3/12 | 1.031 ft |
| 4/12 | 1.054 ft |
| 5/12 | 1.083 ft |
| 6/12 | 1.118 ft |
| 7/12 | 1.158 ft |
| 8/12 | 1.202 ft |
| 9/12 | 1.250 ft |
| 10/12 | 1.302 ft |
| 12/12 | 1.414 ft |
Example:
If the run is 12 feet and the roof pitch is 4/12:
12 × 1.054 = 12.65 feet
So the rafter length is about 12.65 feet before overhang.
Common Rafter Length Examples
| Building Width | Run | Pitch | Approx. Rafter Length |
|---|---|---|---|
| 12 ft | 6 ft | 4/12 | 6.32 ft |
| 12 ft | 6 ft | 6/12 | 6.71 ft |
| 16 ft | 8 ft | 4/12 | 8.43 ft |
| 16 ft | 8 ft | 6/12 | 8.94 ft |
| 20 ft | 10 ft | 4/12 | 10.54 ft |
| 20 ft | 10 ft | 6/12 | 11.18 ft |
| 24 ft | 12 ft | 4/12 | 12.65 ft |
| 24 ft | 12 ft | 6/12 | 13.42 ft |
These numbers are for planning. Final rafter measurements can change because of overhang, ridge thickness, birdsmouth cuts, fascia details, and roof design.
Does Rafter Length Include Overhang?
Not always.
Some calculators give the rafter length from the ridge to the outside wall only. Others include the overhang. If you want the full board length, include the rafter tail.
The overhang is the part of the rafter that extends beyond the wall to form the eave.
How to Calculate Rafter Length With Overhang
To include overhang, use the same pitch factor.
Example:
- Main rafter length: 10.54 ft
- Roof pitch: 4/12
- Horizontal overhang: 1 ft
- 4/12 pitch factor: 1.054
Overhang length:
1 × 1.054 = 1.054 ft
Total rafter length:
10.54 + 1.054 = 11.59 ft
So the full rafter length is about 11.59 feet.
Rafter Run vs Rafter Length
This is one of the most common mistakes.
Run is the horizontal distance.
Rafter length is the diagonal board length.
For example, if a roof has a 10 foot run, the rafter will be longer than 10 feet because it sits on a slope. The steeper the pitch, the longer the rafter.
Shed Roof Rafter Length
A shed roof usually slopes in one direction. For this type of roof, the run is often the full horizontal distance from the low wall to the high wall.
Example:
- Run: 10 ft
- Rise: 3 ft
Formula:
√(10² + 3²) = √109 = 10.44 ft
So the shed rafter length is about 10.44 feet, before adding overhang.
Common Rafter vs Hip Rafter
A common rafter runs straight from the ridge to the outside wall.
A hip rafter runs diagonally from the corner of the building to the ridge. Because of that diagonal angle, a hip rafter is longer than a common rafter on the same roof.
For simple gable roofs, a common rafter calculator is usually enough. For hip roofs, use a dedicated hip rafter length calculation because the geometry is different.
How Many Rafters Do I Need?
To estimate rafter count, use the roof length and rafter spacing.
Formula for one side:
Roof length ÷ rafter spacing + 1
For a gable roof, multiply by two because rafters are installed on both sides.
Example:
- Roof length: 24 ft
- Rafter spacing: 24 inches, or 2 ft
One side:
24 ÷ 2 + 1 = 13 rafters
Both sides:
13 × 2 = 26 rafters
So a 24 foot long gable roof at 24 inch spacing needs about 26 rafters.
Common Rafter Spacing
| Rafter Spacing | Common Use |
|---|---|
| 12 inches on center | Heavy loads or special roof designs |
| 16 inches on center | Common residential roof framing |
| 24 inches on center | Common for many roofs, depending on design |
Rafter spacing affects both material count and structural performance. Always check your local code, roof load requirements, and framing plan before finalizing spacing.
Rafter Size vs Rafter Length
Rafter length tells you how long the board needs to be.
Rafter size tells you what board size is needed, such as 2×6, 2×8, 2×10, or 2×12.
Rafter size depends on:
- Roof span
- Lumber species
- Lumber grade
- Roof load
- Snow load
- Wind load
- Rafter spacing
- Roof covering
- Ceiling load
- Local building code
A rafter length calculator helps with measurement, but it does not replace span tables or structural design. For load-bearing roof framing, verify the rafter size before building.
Roof Truss vs Roof Rafter
A rafter and a truss are not the same thing.
A rafter is an individual sloped framing member cut and installed on site.
A truss is an engineered roof assembly made from multiple connected pieces.
Use a rafter calculator for:
- Common rafters
- Shed rafters
- Simple gable roofs
- Small roof framing projects
Use truss design information for:
- Manufactured roof trusses
- Engineered roof systems
- Long spans
- Complex roof structures
Metal Roof Sheet Length and Rafter Length
Rafter length can help estimate metal roof sheet length because the roof panel follows the slope of the roof.
However, metal roof sheets may need extra allowance for:
- Eave overhang
- Ridge detail
- Panel lap
- Trim
- Manufacturer requirements
- Waste
So the rafter length is a strong starting point, but final roof sheet length should be checked with the roofing supplier.
Metric Rafter Length Calculation
The same formula works in metric.
Example:
- Run: 3 meters
- Rise: 1 meter
Formula:
√(3² + 1²) = √10 = 3.16 meters
So the rafter length is about 3.16 meters.
Whether you are using feet, inches, meters, or millimeters, keep all measurements in the same unit.
Common Rafter Calculation Mistakes
Confusing Span With Run
Span is the full building width. Run is usually half the span on a gable roof.
Forgetting the Overhang
If you need the full board length, include the rafter tail.
Ignoring Ridge Thickness
A ridge board or ridge beam can slightly change the final measurement.
Using Rafter Length as Rafter Span
Rafter length is the diagonal board length. Rafter span is the horizontal distance between supports. They are not the same.
Guessing the Rafter Size
Do not choose rafter size by looking at the board and hoping for the best. Roof framing needs proper span checks.
Cutting All Rafters Before Testing One
Cut one pattern rafter first. Test it. Then cut the rest. One wrong pattern can waste a full stack of lumber.
Example: Calculate Rafter Length for a 20 Foot Wide Roof
Let’s calculate a simple gable roof.
| Measurement | Value |
|---|---|
| Building width | 20 ft |
| Roof pitch | 6/12 |
| Overhang | 12 in |
| Ridge adjustment | Not included |
Step 1: Find the Run
20 ÷ 2 = 10 ft
Step 2: Find the Rise
A 6/12 pitch means:
6 ÷ 12 = 0.5
So:
10 × 0.5 = 5 ft
Step 3: Calculate Main Rafter Length
√(10² + 5²) = 11.18 ft
Step 4: Add Overhang
For a 6/12 pitch, the slope factor is about 1.118.
A 12 inch overhang adds:
1 × 1.118 = 1.118 ft
Final length:
11.18 + 1.118 = 12.30 ft
The full rafter length is about 12.3 feet before final cut adjustments.
FAQs
How do you figure out how long a rafter needs to be?
Find the run and rise, then use:
Rafter length = √(run² + rise²)
If you know the roof pitch, use it to calculate rise first. Add overhang if the rafter tail is part of the final board length.
How far can a 2×10 span as a rafter?
It depends on lumber species, grade, spacing, roof load, snow load, ceiling load, and local building code. A 2×10 may span different distances in different conditions, so always check approved span tables or ask a qualified professional before building.
What is the rafter length for a 4/12 pitch?
A 4/12 pitch has a slope factor of about 1.054 per foot of run.
Example:
If the run is 10 feet:
10 × 1.054 = 10.54 feet
So the rafter length is about 10.54 feet before overhang.
Does rafter length include overhang?
Only if overhang is included in the calculation. Some calculators show ridge-to-wall length only. If you want the full board length, add the rafter tail.
How far can a 2×8 rafter cantilever overhang?
There is no single safe number. It depends on lumber size, species, grade, spacing, roof load, and local code. Check span tables or engineering guidance before using a long rafter overhang.
What is the 25% rule in roofing?
The 25% rule usually refers to roofing repair or replacement thresholds used by some building departments or insurance policies. The exact rule depends on location, so check local requirements before starting roof work.
How do I calculate roof rafter length?
Measure the span, divide by two to get the run, calculate rise from pitch, then use the rafter formula. Add overhang if needed.
How many rafters do I need?
Divide the roof length by rafter spacing, add one, then multiply by two for both sides of a gable roof.
What is the difference between rafter length and rafter span?
Rafter length is the diagonal board measurement. Rafter span is the horizontal distance between supports. Length is used for cutting; span is used for structural sizing.
Final Thoughts
A rafter length calculator makes roof framing easier by estimating the diagonal rafter measurement from run, rise, pitch, and overhang.
The main formula is:
Rafter length = √(run² + rise²)
For pitch-based calculations:
Rise = run × pitch
Use the calculator to estimate length, then check rafter size, spacing, span limits, and local code before cutting and installing roof framing.
