About the Rafter Length Calculator
This rafter length calculator works out the length of a common rafter for a gable roof from the building span, the roof pitch (rise per 12 inches of run) and the horizontal overhang. It deducts half the ridge board thickness so the length you get is the real cut length from the ridge plumb cut to the tail, and it shows the answer both in decimal feet and in feet and inches to the nearest 1/16 inch.
It is meant for DIY builders framing a shed, garage or addition, and for carpenters who want a quick check before laying out a pattern rafter. Alongside the length you get the pitch angle (which is also the plumb cut angle on a speed square), the seat cut angle, the total roof rise, the slope factor and the number of rafters for the length of the building at your chosen spacing.
The result is the rafter measured along its top edge (the line length) plus the overhang. Birdsmouth depth, fascia and ridge style vary by design, so always cut and test one pattern rafter before cutting the rest.
With the default inputs, the rafter length (with overhang) is 14.46 ft. Change any value above to recalculate instantly.
How to use the rafter length calculator
- 1Measure the building span from the outside of one wall to the outside of the opposite wall.
- 2Enter the roof pitch as inches of rise per 12 inches of run (for example 6 for a 6/12 roof).
- 3Add the horizontal overhang and the ridge board thickness.
- 4Choose rafter spacing and the building length to get the rafter count.
- 5Cut one pattern rafter to the length and angles shown, test-fit it, then use it to mark the rest.
Formula and method
A common rafter is the hypotenuse of a right triangle whose horizontal leg is the run and whose vertical leg is the rise. The run is half the building span, minus half the ridge board thickness because each rafter stops at the face of the ridge rather than at its centre. The slope factor √(1 + (pitch/12)²) converts any horizontal distance into the length along the slope, so the same factor turns the horizontal overhang into the tail length.
The pitch angle is arctan(pitch ÷ 12); it is the angle for the plumb cut at the ridge and the tail, and the seat cut of the birdsmouth is 90° minus that angle. The rafter count is the number of spaces along the building at the chosen on-center spacing plus one, for each side of the ridge.
- Span
- Outside-to-outside width of the building (ft)
- Pitch
- Rise in inches per 12 inches of horizontal run
- Ridge
- Ridge board thickness, converted to feet
- Overhang
- Horizontal eave overhang, converted to feet
Worked examples
24 ft garage, 6/12 pitch, 12 in overhang
The run is 12 ft minus 0.75 in for half the ridge board, or 11.9375 ft. Adding the 1 ft overhang and multiplying by the 6/12 slope factor of 1.1180 gives 14.46 ft (14 ft 5-9/16 in), so 16 ft boards are needed. At 16 in on center a 40 ft building needs 31 rafters per side, 62 in total.
30 ft span, 8/12 pitch, 18 in overhang, 24 in spacing
Run is 14.9375 ft; with the 1.5 ft overhang that is 16.4375 ft horizontally. The 8/12 slope factor is 1.2019, so each rafter is 19.76 ft long and fits a 20 ft board. The roof rises 10 ft and needs 19 rafters per side.
Steep 12/12 roof, no overhang or ridge board
A 12/12 roof is a 45° slope with a slope factor of √2 ≈ 1.4142. A 10 ft run therefore needs a 14.14 ft rafter, about 14 ft 1-11/16 in, and both the plumb and seat cuts are 45°.
Frequently asked questions
How do you calculate rafter length?+
Divide the span by two to get the run, subtract half the ridge board thickness, add the horizontal overhang, then multiply by the slope factor √(1 + (pitch/12)²). For a 6/12 roof the slope factor is 1.118.
Is span measured inside or outside the walls?+
Use the outside-to-outside dimension of the wall plates. The birdsmouth sits on the outer edge of the top plate, so measuring the outside keeps the run correct at the plate line.
What angle do I cut the top of a rafter?+
The plumb cut at the ridge equals the roof pitch angle, arctan(pitch ÷ 12). That is 26.57° for 6/12, 33.69° for 8/12 and 45° for 12/12. The seat cut of the birdsmouth is 90° minus that angle.
How deep can the birdsmouth cut be?+
A common rule of thumb is to leave at least two-thirds of the rafter depth above the seat cut, so the notch is no deeper than about one-third of the board. Check your local code and engineer for heavy snow loads.
What size lumber do I need for rafters?+
Rafter size depends on span, spacing, species, grade and snow and dead loads. Use the span tables in the residential building code (IRC R802) or your local code rather than rafter length alone.