Rafter Length Calculator
Framers have sized rafters with the same triangle for a century. Enter the span and the pitch and get the line length, the overhang along the slope, the angle, and the board length to buy. Free, no signup, no waiting.
Calculator ·
How the math works ·
Unit rafter length table ·
Line length versus the board you actually cut ·
FAQ
Whether you are framing a shed, a porch roof or a whole house, the rafter question is always the same: how long is the board? Carpenters search rafter length calculator thousands of times a month, usually standing in a lumber yard. This tool gives the full answer, verified against the rafter tables stamped on every framing square.
The calculator
1. Building width and pitch
2. Overhang
Your common rafter length
How the math works
- The run is half the span. A common rafter starts at the ridge and lands on one wall, so it crosses half the building width. A 24 foot wide building gives every rafter a 12 foot run.
- Unit length comes from the pitch triangle. For each foot of run, the rafter covers the square root of (144 plus the pitch squared) inches. At 6/12 that is 13.42 inches of rafter per foot of run.
- Line length is run times unit length. Twelve feet of run at 6/12 gives a 13.42 foot rafter, measured from the ridge centerline to the outside of the wall plate.
- The overhang rides the same slope. A 12 inch horizontal overhang adds 12 times the slope multiplier, about 13.4 inches at 6/12, to the tail of the rafter.
Not sure of your pitch? Our roof pitch finder works it out from a rise and run measurement, and the roof square footage calculator uses the same triangle to size the whole roof surface.
Unit rafter length table (inches per foot of run)
The standard published rafter table, the same values a framing square carries. Our calculator reproduces every row exactly.
| Pitch | Unit length | Angle | Pitch | Unit length | Angle |
|---|---|---|---|---|---|
| 2/12 | 12.16 in | 9.5° | 8/12 | 14.42 in | 33.7° |
| 3/12 | 12.37 in | 14.0° | 9/12 | 15.00 in | 36.9° |
| 4/12 | 12.65 in | 18.4° | 10/12 | 15.62 in | 39.8° |
| 5/12 | 13.00 in | 22.6° | 11/12 | 16.28 in | 42.5° |
| 6/12 | 13.42 in | 26.6° | 12/12 | 16.97 in | 45.0° |
| 7/12 | 13.89 in | 30.3° |
Line length versus the board you actually cut
- The ridge board takes a bite. Line length runs to the center of the ridge. Real rafters stop at the face of the ridge board, so you shorten each one by half the ridge thickness measured along the slope, about 0.8 inches for a standard 2x ridge board at common pitches.
- The birdsmouth sits at the wall line. The notch that seats the rafter on the wall plate is laid out from the wall line point of the line length. Building codes limit the notch depth so the rafter keeps its strength, which is one reason the NRCA and code guides tell framers to lay out one pattern rafter first.
- Buy the next even length up. Lumber comes in even foot lengths. A 14.53 foot rafter means 16 foot boards, and the calculator shows that stock length so the yard trip is one trip.
- Hip and valley rafters are a different table. They run at 45 degrees in plan, so their unit lengths are longer (18.00 inches per foot of run at 6/12). This calculator sizes common rafters; hips and valleys need the hip table or a framer.
Planning the deck that sits on these rafters? The roof decking calculator counts the 4 by 8 sheets that cover them, and the full set of tools lives on our roofing tools page.
Frequently asked questions
Take half the building span as the run. Multiply the run in feet by the unit length for your pitch and divide by 12. A 24 foot building at 6/12: run 12 feet, unit length 13.42 inches, rafter 13.42 feet before the overhang.
The run is 10 feet and the unit length at 4/12 is 12.65 inches, so the line length is 10.54 feet. Add the overhang along the slope: a 12 inch overhang adds about 12.7 inches, for a total near 11.6 feet, which means 12 foot boards.
Yes. Enter the overhang as a horizontal measurement in inches and the calculator converts it to length along the slope and adds it to the line length, which is how the tail of a real rafter is cut.
The result is the theoretical line length to the ridge centerline. Shorten each rafter by half the ridge board thickness measured along the slope when you lay out the plumb cut. On standard framing that adjustment is under an inch, and framers confirm it with one test rafter.
Yes, with one change: a lean to rafter crosses the full width of the structure, not half of it. Enter twice the lean to width as the span and the run comes out right.