A common rafter is the hypotenuse of a right triangle: its run is half the building width on a gable roof, its rise comes from the pitch, and the overhang adds a short tail on the same slope. This rafter length calculator does that geometry for you and returns the rafter length with overhang, the length to the building line, the run and total rise, the plumb and seat cut angles and, if you give the building length and spacing, the number of rafters and the total length of timber.
Enter the pitch the way you know it: x/12 as North American framers say it, degrees as most European plans give it, or percent. The ridge setting handles both framing styles: rafters butting a ridge board (subtract half its thickness from each run) and rafters resting on a ridge beam or purlin, the usual French method, where nothing is deducted.
If you only need to convert a pitch, the roof pitch calculator is quicker; to order the covering, continue with the roofing calculator. This tool measures; it does not size the timber. Rafter depth and grade come from the span tables of your building code or an engineer.
How to use this calculator
- Choose gable (two slopes meeting at a ridge) or shed (one slope from a low wall to a high wall).
- Enter the building width across the walls that carry the rafters.
- Pick the pitch notation and enter the pitch.
- Enter the horizontal overhang beyond the wall, measured level, not along the slope.
- For a gable roof, enter the ridge board thickness, or 0 if the rafters sit on a ridge beam.
- Enter the spacing and, optionally, the building length to count the rafters.
- Read the rafter length, angles and count, and open the steps to see each calculation.
The formula
With slope = rise ÷ run (for example , or ), the pitch factor is the length of rafter per unit of horizontal run:
On a gable roof, the run of each rafter is half the span less half the ridge board thickness , and the overhang is measured horizontally:
For a shed roof, and the tail appears at both ends: . The plumb cut is the pitch angle off square; the seat cut of the birdsmouth is off square. The count is one rafter per spacing interval plus one at the end, on each slope: for a gable.
Worked example
Metric gable. A house 8 m wide with a 35° roof, rafters resting on a ridge purlin (no deduction) and a 50 cm overhang:
- Run m, pitch factor
- Length to the wall line: m; tail m
- Rafter length: 5.493 m, rise at the ridge 2.801 m
- With a 10 m long house and rafters at 60 cm centres: 36 rafters, about 197.8 m of timber.
Imperial gable. A 24 ft wide building at 6/12, a 1½ in ridge board and a 12 in overhang: run 143.25 in, line length 160.16 in, total 173.57 in (14.46 ft). Plumb cut 26.57°, seat cut 63.43°. At 16 in on centre over 32 ft: 50 rafters.
Shed. A 3 m lean-to at 15% with 30 cm overhangs at both ends: rafter 3.64 m, high wall 0.45 m above the low wall.
Pitch factors for common roof pitches
| Pitch | Angle | Factor |
|---|---|---|
| 3/12 | 14.04° | 1.0308 |
| 4/12 | 18.43° | 1.0541 |
| 6/12 | 26.57° | 1.1180 |
| 8/12 | 33.69° | 1.2019 |
| 12/12 | 45.00° | 1.4142 |
| 30° | 30.00° | 1.1547 |
| 45° | 45.00° | 1.4142 |
Multiply the run by the factor to get the sloped length. This is the number printed on the rafter tables of a framing square.
Ridge board, ridge beam and birdsmouth
In North American stick framing, the 2021 International Residential Code (section R802) requires a ridge board at least 1 in nominal thick and no shallower than the cut end of the rafters; because the rafters butt against it, each run loses half the board’s thickness. A structural ridge beam or a French panne faîtière carries the rafters on top, so the full half-span is used. At the wall, the birdsmouth notch sits on the plate: its seat cut is level and its depth is usually limited to about a third of the rafter depth so the tail stays strong.
Frequently asked questions
How do I calculate rafter length?
Take the run (half the building width on a gable roof, less half the ridge board), add the horizontal overhang, and multiply by the pitch factor √(1 + (rise/run)²). For 6/12 the factor is 1.118, so a 12 ft run gives a 13.42 ft rafter before the overhang.
Is the overhang measured along the slope or level?
This calculator asks for the level (horizontal) projection, which is what plans and eave details give. The sloped tail length is the overhang multiplied by the same pitch factor.
How many rafters do I need?
Divide the building length by the spacing, round up, and add one for the end; double it for a gable roof. A 32 ft building at 16 in on centre needs 25 rafters per side, 50 in total, before any gable-end ladder framing.
What angle do I cut a rafter at?
Set the saw to the pitch angle for the plumb cuts at the ridge and the tail (26.57° for 6/12) and to 90° minus that angle for the seat cut of the birdsmouth (63.43° for 6/12), both measured off a square cut.
What lumber length should I buy?
Take the rafter length, add a few centimetres or an inch or two for the cuts, and round up to the next stock length: lumber in North America comes in 2 ft steps, and timber merchants in Europe usually stock lengths every 30 or 50 cm.
Sources
- ICC — 2021 International Residential Code, Chapter 8 (R802 roof framing)
- American Wood Council — 2021 Span Tables for Joists and Rafters
- NIST Handbook 44, Appendix C — General tables of units of measurement
Last updated: