Calculators · Rafter Length Calculator
RoofingRafter Length Calculator
Enter the building span, roof pitch and overhang to get the common rafter cut length, the hip rafter and the number of rafters.
Common rafter cut length
—
How to calculate rafter length
A common rafter, the run and the rise form a right triangle, so the rafter is the longest side. The run is the horizontal distance the rafter covers, which is half the span of a gable roof. The rise is how far the roof climbs over that run, and the pitch tells you how much it climbs for each 12 inches of run. Everything comes from one number, the pitch factor:
| What you get | Formula |
|---|---|
| Pitch factor | √(1 + (pitch ÷ 12)²) |
| Run, gable roof | span ÷ 2 |
| Run, shed roof | the whole span |
| Rise | run × pitch ÷ 12 |
| Rafter to the ridge centerline | run × pitch factor |
| Overhang along the slope | horizontal overhang × pitch factor |
| Ridge deduction | half the ridge board thickness × pitch factor |
| Cut length | (run − half the ridge + overhang) × pitch factor |
The overhang is measured horizontally, from the outside of the wall to the tail. That is how it is drawn on plans, and the calculator turns it into a length along the slope. For the pitch itself, from an angle, a percentage or a total rise, use the roof pitch calculator.
Example: a 28 ft wide gable roof at 6/12
The building is 28 ft wide, the pitch is 6/12, the overhang is 1 ft and the ridge board is 1 1/2 in thick. Type those numbers and you get the same figures.
| Step | Operation | Result |
|---|---|---|
| Run | 28 ÷ 2 | 14 ft |
| Rise | 14 × 6 ÷ 12 | 7 ft |
| Pitch factor | √(1 + 0.5²) | 1.1180 |
| Rafter to the ridge centerline | 14 × 1.1180 | 15.652 ft (15 ft 7 13/16 in) |
| Overhang along the slope | 1 × 1.1180 | 1.118 ft (1 ft 1 7/16 in) |
| Theoretical length with overhang | 15.652 + 1.118 | 16.771 ft (16 ft 9 1/4 in) |
| Ridge deduction | (1.5 ÷ 2) × 1.1180 | 0.84 in (13/16 in) |
| Cut length | (14 − 0.0625 + 1) × 1.1180 | 16.701 ft (16 ft 8 7/16 in) |
The cut length is measured along the top edge of the rafter, from the plumb cut at the ridge to the plumb cut at the tail. The board you buy has to be longer than that, so ask your supplier for the next full length above your figure.
Rafter length table by span and pitch
This table gives the length of a common rafter from the outside of the wall to the ridge centerline, for a gable roof, with no overhang and no ridge deduction. For an overhang, add the horizontal overhang times the pitch factor from the next table.
| Span | 4/12 | 5/12 | 6/12 | 8/12 | 10/12 | 12/12 |
|---|---|---|---|---|---|---|
| 16 ft | 8 ft 5 3/16 in | 8 ft 8 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 | 10 ft 10 in | 11 ft 2 3/16 in | 12 ft 1/4 in | 13 ft 3/16 in | 14 ft 1 11/16 in |
| 24 ft | 12 ft 7 13/16 in | 13 ft | 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 2 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 4 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 |
| 36 ft | 18 ft 11 11/16 in | 19 ft 6 in | 20 ft 1 1/2 in | 21 ft 7 5/8 in | 23 ft 5 3/16 in | 25 ft 5 1/2 in |
| Pitch | 4/12 | 5/12 | 6/12 | 8/12 | 10/12 | 12/12 |
|---|---|---|---|---|---|---|
| Pitch factor | 1.0541 | 1.0833 | 1.1180 | 1.2019 | 1.3017 | 1.4142 |
Ridge board, plumb cut and level cut
The rafters of a gable roof meet the two faces of the ridge board, not its center. That is why the calculator takes half of the ridge thickness off the run. If your plans give the length to the centerline, leave the ridge field empty. If the roof has a ridge beam instead of a board, the deduction depends on that design, so measure from the plans.
The top of the rafter has a plumb cut, which is vertical, and the notch that sits on the wall has a level cut, which is horizontal. A framing square gives both. Place the 12 inch mark of one leg and the rise mark of the other, the first number of the pitch, on the edge of the rafter. The leg at 12 inches draws the level cut and the other leg draws the plumb cut. That is the same triangle as the roof, so it works for any pitch.
Hip and valley rafters
A hip or valley rafter runs along the diagonal of the corner, so its horizontal run is the common run times √2, or 1.4142. For two roof planes of the same pitch that meet at 90 degrees, the rise is the same as for the common rafter and the length is (run + overhang) × √(2 + (pitch ÷ 12)²). The calculator shows this for gable roofs. In the example it is 15 × √2.25 = 22.5 ft, or 22 ft 6 in. It is a theoretical length to the center of the ridge, with no ridge deduction, and it does not apply to roofs with different pitches or corners that are not 90 degrees.
Birdsmouth cut: heel depth and seat length
A birdsmouth is the notch that lets the rafter sit on the top plate. Its heel cut is vertical and its seat cut is horizontal. The 2012 International Residential Code, in the version published by the city of Seattle, limits notches at the ends of a solid lumber member to one-fourth of its depth (section R502.8.1, which section R802.7.1 applies to rafters), and asks for at least 1 1/2 in of bearing on wood (R802.6). For the cantilevered part of a rafter, section R802.7.1.1 permits notches if the remaining depth of the rafter is at least 3 1/2 in and the cantilever is not longer than 24 in. We read these sections in October 2026. The real depths of the lumber are the minimum dry dressed widths of PS 20-25, table 3. The table shows the largest heel cut and the seat length that goes with it.
| Lumber | Real depth (in) | Largest heel cut (in) | Seat at 4/12 (in) | Seat at 6/12 (in) | Seat at 8/12 (in) | Seat at 12/12 (in) |
|---|---|---|---|---|---|---|
| 2x4 | 3 1/2 | 7/8 | 2.63 | 1.75 | 1.31 | 0.88 |
| 2x6 | 5 1/2 | 1 3/8 | 4.13 | 2.75 | 2.06 | 1.38 |
| 2x8 | 7 1/4 | 1 13/16 | 5.44 | 3.63 | 2.72 | 1.81 |
| 2x10 | 9 1/4 | 2 5/16 | 6.94 | 4.63 | 3.47 | 2.31 |
| 2x12 | 11 1/4 | 2 13/16 | 8.44 | 5.63 | 4.22 | 2.81 |
The seat length is the heel depth divided by the pitch ratio. The steeper the roof, the shorter the seat for the same heel depth, and the calculator warns when the seat is under the 1 1/2 in bearing. The sizes are minimum dressed sizes, and lumber can come a little bigger. Your state or city adopts its own edition of the code and may change it, so confirm the limits with your building department.
How many rafters do I need?
Rafters are laid out on the spacing from one end of the roof to the other, with one more rafter than there are spaces. Per side that is the building length divided by the spacing, rounded up, plus one. A 40 ft long gable roof at 16 in on center needs ⌈480 ÷ 16⌉ + 1 = 31 rafters per side, 62 in all. The count covers common rafters only, so add gable-end framing, hips, valleys and any doubled rafters your plans call for. To turn the lengths into a lumber order, see the board foot calculator.
Frequently asked questions
How do I calculate rafter length?
Take half of the building span for a gable roof, which is the run. Multiply the run by the pitch factor, the square root of 1 plus (rise ÷ run) squared. For a 28 ft wide building with a 6/12 pitch the run is 14 ft, the factor is 1.1180, and the rafter is 14 × 1.1180 = 15.652 ft, or 15 ft 7 13/16 in, measured to the center of the ridge. Add the overhang along the slope and subtract half the ridge board to get the cut length.
How do I calculate rafter length using pitch?
Turn the pitch into a ratio. A 6/12 pitch is 6 ÷ 12 = 0.5, and the factor is √(1 + 0.5²) = 1.1180. Multiply the horizontal run by that factor. The factor for 4/12 is 1.0541, for 8/12 it is 1.2019 and for 12/12 it is 1.4142. If you only know an angle, take its tangent first. For 30 degrees the tangent is 0.5774, which is a pitch of about 6.93/12.
Do I enter the full span or half?
Enter the full span of the building, from the outside of one wall to the outside of the opposite wall, and pick a gable roof. The calculator halves it for you. For a shed roof pick shed, and the whole span is the run because the rafter climbs from one wall to the other.
How do I find the rafter length for a shed roof?
A shed roof has one slope, so the run is the whole span between the walls and there is no ridge board to deduct. Multiply the span by the pitch factor and add the overhang along the slope. A 12 ft span at 4/12 gives 12 × 1.0541 = 12.649 ft. With a 6 in overhang, which adds 0.5 × 1.0541 = 0.527 ft along the slope, the cut length is 13.176 ft, or 13 ft 2 1/8 in.
Does the ridge board change the rafter length?
Yes, a little. The rafters meet the faces of the ridge board and not its center, so each rafter loses half of the ridge thickness in run. At 6/12 a 1 1/2 in ridge board shortens the rafter by 3/4 in × 1.1180 = 0.84 in along the slope. Leave the ridge field empty if you work to the centerline or the ridge is a different design, such as a ridge beam.
How deep can a birdsmouth cut be?
The 2012 IRC, as published by the city of Seattle, says notches at the ends of a solid lumber member cannot exceed one-fourth of its depth, and that rafters need at least 1 1/2 in of bearing on wood. A 2x8 is 7 1/4 in deep in real size, so the heel cut can be 1 13/16 in at most. Choose the lumber size and type your heel cut to compare. Notches on the cantilevered part of a rafter are covered by R802.7.1.1. The 2021 and 2024 editions and your local code may differ, so confirm with your building department.
What size lumber do I need for my rafters?
This calculator does not size rafters. The size depends on the span, the spacing, the species and grade of the lumber and the snow and wind loads of your area. Use the span tables that your local code adopts, or ask an engineer or your building department. The calculator only works out the geometry, the lengths and the counts.
More calculators
- Roof Pitch Calculator Convert rise and run to pitch, angle and slope factor, and find rafter length.
- Roofing Calculator Estimate roof area, roofing squares and shingle bundles from your roof size and pitch.
- Board Foot Calculator Calculate board feet from thickness, width and length for any number of boards.