How this calculator works
A common rafter is the hypotenuse of a right triangle. Its run is half the building width, its rise is the run times the pitch divided by 12, and its length is the run times the square root of 1 plus the pitch squared over 144. The overhang is added along the same slope, using the same factor.
Worked example: a 24 ft wide building with a 6/12 pitch has a run of 12 ft and a slope factor of √1.25 = 1.118. The rafter from the ridge to the wall is 12 × 1.118 = 13.42 ft, and a 12 in overhang adds 1.118 ft, so the rafter is 14.53 ft (14 ft 6 7/16 in) long. The ridge sits 6 ft above the top plate. A 30 ft long roof with rafters at 24 in on center takes 16 on each side, 32 in all.
Common rafter length by building width and pitch (no overhang)
The length from the center of the ridge to the outside of the wall, in feet and inches.
| Width | 4/12 | 6/12 | 8/12 | 10/12 | 12/12 |
|---|---|---|---|---|---|
| 16 ft | 8 ft 5 3/16 in | 8 ft 11 5/16 in | 9 ft 7 3/8 in | 10 ft 4 15/16 in | 11 ft 3 3/4 in |
| 20 ft | 10 ft 6 1/2 in | 11 ft 2 3/16 in | 12 ft 0 1/4 in | 13 ft 0 3/16 in | 14 ft 1 11/16 in |
| 24 ft | 12 ft 7 13/16 in | 13 ft 5 in | 14 ft 5 1/16 in | 15 ft 7 7/16 in | 16 ft 11 5/8 in |
| 28 ft | 14 ft 9 1/16 in | 15 ft 7 13/16 in | 16 ft 9 15/16 in | 18 ft 2 11/16 in | 19 ft 9 9/16 in |
| 32 ft | 16 ft 10 3/8 in | 17 ft 10 11/16 in | 19 ft 2 3/4 in | 20 ft 9 15/16 in | 22 ft 7 1/2 in |
Tips before you buy
- Rafters are cut from the plan dimensions, but the lumber has width, so mark the plumb cut, the birdsmouth and the tail carefully on one rafter, cut it and use it as a pattern for the rest.
- Check the span against a span table for the lumber grade, species, spacing and roof load, and add collar ties, rafter ties or a ridge beam as required. The structure matters more than the length.
- Measure the building width between the real outside faces of the walls, not the plan, and check that the walls are the same width at both ends.
- Order a little longer than the calculation so that you have room to trim, and buy the next standard length up (for 14.5 ft you need a 16 ft board).
- Roofs often need permits and inspection of the framing. Check with your building department.
Tools & materials for this project
As an Amazon Associate we earn from qualifying purchases. These links do not change what you pay.
Frequently asked questions
How do you calculate rafter length?
Take half the building width as the run, multiply by the square root of 1 plus the pitch squared over 144, and add the overhang using the same factor. For a 24 ft wide building with a 6/12 pitch and a 12 in overhang that gives 14.53 ft.
What is the rafter length for a 6/12 pitch?
The rafter is 1.118 times the run. A 12 ft run (a 24 ft wide building) gives 13.42 ft before the overhang.
How many rafters do I need?
One every 16 or 24 inches along the length, plus one for the end, on each side of the ridge. A 30 ft roof at 24 in on center takes 16 on each side.
What is the angle of a 6/12 roof?
26.6 degrees. A 4/12 roof is 18.4 degrees, an 8/12 is 33.7 degrees, and a 12/12 is 45 degrees.
Add this calculator to your website
Running a blog, a contractor site or a class page? You can put this calculator on it for free. Copy the code below, and please leave the link underneath the calculator in place. The small script just resizes the frame to fit the results; if your site strips scripts, the calculator still works inside a scrolling frame.
Related calculators & guides
Estimates only. Results assume standard materials and simple shapes. Supplier products vary, and the final call on quantity, structure and safety is yours. Check your local code and your supplier's guidance before ordering.