Rafter calculator

Enter the building width, the pitch and the overhang. Example: a 24 ft wide house with a 6/12 roof and a 1 1/2 in ridge board has a run of 12 ft − 3/4 in = 143.25 in. Each foot of run at 6/12 needs √(1 + 0.5²) = 1.118 ft of rafter, so the rafter is 143.25 × 1.118 = 160.16 in (13 ft 4 3/16 in) from the ridge to the outside of the wall, plus a 12 in overhang × 1.118 = 13.42 in of tail: 173.57 in (14 ft 5 9/16 in) in all. Along a 40 ft wall at 16 in on center that is 480 ÷ 16 + 1 = 31 rafters a side, 62 in all.

How to use this calculator · what to enter and what the result means

Lengths are along the rafter's measuring line: the line that runs from the ridge to the outside top corner of the wall, through the inside corner of the birdsmouth. The overhang is the level distance from the outside of the wall to the tail cut.

Rafter length
–
Rafters
–
Ridge to wall
–
Tail (overhang)
–
Roof angle
–
Board to buy
–

–

    How the calculator works

    –

    The run of a common rafter is half the building width, less half the ridge board thickness, because the rafter stops at the face of the ridge board. The pitch gives the length of rafter per unit of run, √(1 + (pitch ÷ 12)²), so the length from the ridge to the outside of the wall is the run times that factor, and the tail is the level overhang times the same factor. The roof angle is arctan(pitch ÷ 12). The plumb cuts at the ridge and the tail are that angle off a square cut across the board, and the seat cut is 90° minus it.

    The birdsmouth is the notch that sits on the wall: a level seat cut as long as the wall plate is wide and a plumb heel cut. The heel cut is seat × pitch ÷ 12 high. The wood left above the wall (the height above plate) is the plumb depth of the rafter, depth ÷ cos(angle), minus the heel cut. The board must be a little longer than the rafter length, because a plumb cut runs at a slant across the board: depth × pitch ÷ 12 more, long point to long point. Lumber is sold in whole or even feet, so the calculator rounds up to the next even foot.

    For the count, the first rafter or truss sits at one end wall, the next ones at the spacing, and a last one at the other end wall, so the count is the building length ÷ spacing, rounded up, plus one. A gable roof with rafters needs that many on each side. Gable-end framing, blocking, and any extra rafters around chimneys, skylights or dormers are not included.

    Metric uses 1 in = 2.54 cm and 1 ft = 0.3048 m exactly. The pitch is always rise per 12 of run, whatever the unit.

    Rafter length per foot of run

    PitchAngleFactorRafter per ft of runRidge to wall, 24 ft wideRidge to wall, 28 ft wideRidge to wall, 32 ft wide
    3/1214.0°1.03112 3/8 in12 ft 3 11/16 in14 ft 4 3/8 in16 ft 5 1/8 in
    4/1218.4°1.05412 5/8 in12 ft 7 in14 ft 8 5/16 in16 ft 9 5/8 in
    5/1222.6°1.08313 in12 ft 11 3/16 in15 ft 1 3/16 in17 ft 3 3/16 in
    6/1226.6°1.11813 7/16 in13 ft 4 3/16 in15 ft 7 in17 ft 9 13/16 in
    7/1230.3°1.15813 7/8 in13 ft 9 13/16 in16 ft 1 5/8 in18 ft 5 7/16 in
    8/1233.7°1.20214 7/16 in14 ft 4 3/16 in16 ft 9 in19 ft 1 7/8 in
    9/1236.9°1.25015 in14 ft 11 1/16 in17 ft 5 1/16 in19 ft 11 1/16 in
    10/1239.8°1.30215 5/8 in15 ft 6 1/2 in18 ft 1 11/16 in20 ft 8 15/16 in
    11/1242.5°1.35716 1/4 in16 ft 2 5/16 in18 ft 10 7/8 in21 ft 7 7/16 in
    12/1245.0°1.41417 in16 ft 10 9/16 in19 ft 8 1/2 in22 ft 6 7/16 in

    Factor = √(1 + (pitch ÷ 12)²): the rafter length for each unit of level run, and for each unit of level overhang. The last three columns are common rafter lengths from the face of a 1 1/2 in ridge board to the outside of the wall, without the overhang, to the nearest 1/16 in. Computed with the same formula as the calculator.

    How many rafters or trusses

    Building length12 in o.c.16 in o.c.19.2 in o.c.24 in o.c.
    20 ft21 (42)16 (32)14 (28)11 (22)
    24 ft25 (50)19 (38)16 (32)13 (26)
    30 ft31 (62)24 (48)20 (40)16 (32)
    36 ft37 (74)28 (56)24 (48)19 (38)
    40 ft41 (82)31 (62)26 (52)21 (42)
    48 ft49 (98)37 (74)31 (62)25 (50)
    50 ft51 (102)39 (78)33 (66)26 (52)
    60 ft61 (122)46 (92)39 (78)31 (62)

    Trusses, or rafters on one side, with one at each end wall: building length ÷ spacing, rounded up, + 1. The number in brackets is rafters for both sides of a gable roof. 12, 16, 19.2 and 24 in are the spacings in the IRC rafter span tables.

    Lumber sizes

    NominalDressed, dry (in)Dressed, dry (mm)
    2x41-1/2 × 3-1/238 × 89
    2x61-1/2 × 5-1/238 × 140
    2x81-1/2 × 7-1/438 × 184
    2x101-1/2 × 9-1/438 × 235
    2x121-1/2 × 11-1/438 × 286

    Minimum dressed sizes of dry dimension lumber from Table 3 of the American Softwood Lumber Standard, Voluntary Product Standard PS 20-20 (NIST). The same standard says standard lengths are in multiples of 1 foot or 2 feet, as set in the grading rules. Green lumber is dressed larger (1-9/16 in thick in the same table), and rough-sawn or reclaimed boards can differ: measure your boards and enter their real depth and the ridge thickness.

    Code rules for rafters and trusses

    From the 2021 International Residential Code, Chapter 8 (ICC Digital Codes). The calculator does the geometry; it does not size rafters for loads.

    TopicCode text (2021 IRC)Section
    Rafter size and span“Rafters shall be sized based on the rafter spans in Tables R802.4.1(1) through R802.4.1(8). Rafter spans shall be measured along the horizontal projection of the rafter. For other grades and species and for other loading conditions, refer to the AWC STJR.”R802.4.1
    Ridge board“A ridge board used to connect opposing rafters shall be not less than 1 inch (25 mm) nominal thickness and not less in depth than the cut end of the rafter.” Without continuous ties across the structure, “the ridge shall be supported by a wall or ridge beam designed in accordance with accepted engineering practice”.R802.3
    Framing at the ridge“Rafters shall be framed opposite from each other to a ridge board, shall not be offset more than 1 1/2 inches (38 mm) from each other and shall be connected with a collar tie or ridge strap”.R802.4.2
    Low pitch“Where the roof pitch is less than 3:12 (25-percent slope), structural members that support rafters, such as ridges, hips and valleys, shall be designed as beams”.R802.4.4
    Bearing“The ends of each rafter or ceiling joist shall have not less than 1 1/2 inches (38 mm) of bearing on wood or metal and not less than 3 inches (76 mm) on masonry or concrete.”R802.6
    Notched overhangs“Notches on cantilevered portions of rafters are permitted provided the dimension of the remaining portion of the rafter is not less than 3 1/2 inches (89 mm) and the length of the cantilever does not exceed 24 inches (610 mm)”.R802.7.1.1
    Truss design“Wood trusses shall be designed in accordance with accepted engineering practice. The design and manufacture of metal-plate-connected wood trusses shall comply with ANSI/TPI 1.”R802.10.2
    Truss drawings“Truss design drawings … shall be provided to the building official and approved prior to installation. Truss design drawings shall be provided with the shipment of trusses delivered to the job site.” They include “Slope or depth, span and spacing.”R802.10.1
    Altering trusses“Truss members shall not be cut, notched, drilled, spliced or otherwise altered in any way without the approval of a registered design professional.”R802.10.4

    The eight rafter span tables cover a 20 psf roof live load and 30, 50 and 70 psf ground snow loads, each with the ceiling attached or not attached to the rafters, for 2x4 to 2x12 rafters of common species and grades at 12, 16, 19.2 and 24 in spacing. The span you look up is the rafter's level distance between its supports, which this calculator shows as the run.

    Allowable rafter spans depend on the species and grade of the lumber, the spacing, the snow and dead loads where you build, and whether a ceiling is attached. Look them up in the IRC tables your jurisdiction has adopted, or ask an engineer. Trusses are designed by the truss maker; give them the building width, pitch, overhang and spacing, and never cut a truss. Your local building department has the final word.

    Before you cut

    • Measure the real building. Measure the width across the top plates at both gable ends and in the middle. If the walls are not parallel, the rafters will not all be the same length.
    • Cut one pattern rafter first. Mark the ridge plumb cut, the birdsmouth and the tail on one straight board, test it at both ends of the building, then use it to mark the rest.
    • Crown up. Sight down each board and install it with the bow (crown) facing up.
    • Size the ridge board. The plumb cut at the top of a rafter is deeper than the board itself (depth ÷ cos angle), and the code wants the ridge at least that deep. The result suggests the smallest standard ridge size that covers it.
    • Leave wood above the wall. A deep seat cut weakens the rafter where it carries load. Keep the height above plate generous, and check the notching rules in the code before you cut deeper.
    • Shingles, panels and vents. Once the framing is set, the roofing calculator gives squares and bundles, the metal roof calculator gives panels and trim, and the roof vent calculator gives the attic vent area.

    Related