You're building a shed with a 12-foot span and a 6/12 pitch. How long do your rafters need to be? The answer is 8 feet 1 inch for a total cut length including a 12-inch overhang — and here's exactly how to calculate it step by step, including the math most guides skip.
The Rafter Length Formula
Every rafter length calculation starts with the Pythagorean theorem. A rafter forms the hypotenuse of a right triangle, with the run as the base and the rise as the height.
The formula is:
Rafter length = √(run² + rise²)
Before you can use it, you need two values: the run and the rise.
Run equals half the building span. For a 12-foot wide shed, the run is 6 feet (the rafter only covers half the width — the other half is a mirror image from the opposite wall to the ridge).
Rise is determined by the pitch. A 6/12 pitch means the roof rises 6 inches for every 12 inches of horizontal run. For a 6-foot run: rise = 6 inches × 6 = 36 inches = 3 feet.
Now apply the formula:
Rafter² = 6² + 3² = 36 + 9 = 45
Rafter = √45 = 6.71 feet = 6 feet 8.5 inches
This is the line length — the structural measurement from the center of the ridge to the outside edge of the wall plate. It's not the same as the lumber length you'll buy. You still need to add the overhang (tail) and account for the seat cut.
Common Rafter Lengths by Pitch
For a 12-foot span (6-foot run), here are the line lengths at common residential pitches:
| Pitch | Rise per Foot | Total Rise (6-ft run) | Rafter Line Length |
|---|---|---|---|
| 3/12 | 3 inches | 18 inches (1.5 ft) | 6 feet 2 inches |
| 4/12 | 4 inches | 24 inches (2 ft) | 6 feet 4 inches |
| 5/12 | 5 inches | 30 inches (2.5 ft) | 6 feet 6 inches |
| 6/12 | 6 inches | 36 inches (3 ft) | 6 feet 8.5 inches |
| 7/12 | 7 inches | 42 inches (3.5 ft) | 6 feet 11 inches |
| 8/12 | 8 inches | 48 inches (4 ft) | 7 feet 2 inches |
| 10/12 | 10 inches | 60 inches (5 ft) | 7 feet 10 inches |
| 12/12 | 12 inches | 72 inches (6 ft) | 8 feet 6 inches |
These are line lengths only. For actual lumber, add the overhang and cut allowance.
Adding the Rafter Tail (Overhang)
The rafter tail extends past the wall plate to form the eave. A standard residential overhang is 12 to 18 inches, measured horizontally (not along the rafter slope).
To find the tail length along the rafter, apply the same pitch factor to the overhang distance. The pitch factor (also called the rafter multiplier) is the rafter length per foot of run.
For a 6/12 pitch, the pitch factor is √(1² + 0.5²) = √1.25 = 1.118.
A 12-inch (1-foot) horizontal overhang at 6/12 pitch adds: 1 foot × 1.118 = 13.4 inches of rafter length along the slope.
So the full cut length for our 12-foot span shed with 6/12 pitch and 12-inch overhang:
Line length (6.71 ft) + tail (1.12 ft) = 7.83 feet = 7 feet 10 inches
Always add 4 to 6 inches for cutting waste and the ridge reduction. Buy 8-foot lumber for this example.
Common vs Hip vs Valley Rafters
Not all rafters run perpendicular to the ridge. Understanding the three types prevents sizing errors.
Common rafters run at 90 degrees to the ridge and form the basic structure of a gable roof. The calculations above apply to common rafters. They're the starting point for everything else.
Hip rafters run at a 45-degree angle from the corner of the building up to the ridge. Because they run diagonally, they're longer than common rafters. To calculate a hip rafter length, multiply the common rafter run by 1.414 (the diagonal factor), then calculate rise as before, then apply the Pythagorean theorem. For our 6-foot common run at 6/12 pitch: hip run = 6 × 1.414 = 8.485 feet, rise = 3 feet. Hip rafter = √(8.485² + 3²) = √(71.99 + 9) = √80.99 = 9.0 feet.
Valley rafters sit in the valley where two roof planes meet at a concave angle. Valley rafter length is calculated the same way as hip rafter length — using 1.414 times the common run — because valley rafters also run at 45 degrees to the building walls.
Rafter Size by Span
Calculating the right length is only half the job. You also need the right lumber dimensions to carry the load. The IRC (International Residential Code) publishes span tables for this purpose.
For rafters at 12-inch on-center spacing with 30 psf live load (typical residential):
| Lumber Size | Maximum Span |
|---|---|
| 2×6 | 11 feet 4 inches |
| 2×8 | 15 feet 0 inches |
| 2×10 | 19 feet 1 inch |
| 2×12 | 23 feet 0 inches |
At 16-inch on-center spacing, spans increase roughly 10-15%. At 24-inch spacing, add another 10-15% to the maximum span.
Most sheds and garages use 2×6 rafters at 16-inch spacing, which handles spans up to about 13 feet. For spans of 14-20 feet (a typical two-car garage), 2×8 is the standard choice.
Check your local building code for the specific snow load requirements in your area — high-snow regions require smaller spans or larger lumber.
Practical Tips Before You Cut
Mark the bird's mouth before anything else. The bird's mouth is a triangular notch cut near the bottom of the rafter where it sits on the wall plate. It has two cuts: a plumb cut (vertical, matching the roof pitch) and a seat cut (horizontal, matching the wall plate width — typically 3.5 inches for a 2×4 plate, 5.5 inches for a 2×6). Mark it with a rafter square to ensure accuracy before cutting.
Make one test rafter first. Cut one rafter, hold it in place on the actual structure, and verify the fit before cutting the rest. Small measurement errors compound quickly when you're cutting 20 identical pieces.
Use a speed square or rafter square. A speed square has pitch marks directly on it — set it to your pitch and you can mark plumb cuts quickly and accurately without trigonometry at the job site.
Add lumber to your order. Order 10% more lumber than the calculated quantity to account for knots, warps, and cutting waste. For a typical shed with 14 rafters, order 16.
Rafter Length Calculator
Calculate rafter length from span and roof pitch