How to use the rafter calculator
- Measure the span from the outside of one wall to the outside of the opposite wall.
- Enter the roof pitch as rise per 12 inches of run. A 6 means 6/12.
- Add the overhang, measured level from the outside of the wall to the end of the tail.
- Set the ridge board thickness (1½ inches for a 2x ridge) so half of it is taken off each rafter.
- Pick your rafter lumber and wall framing to size the birdsmouth. The drawing shows one side of the roof to scale.
- Add the building length and rafter spacing to count how many rafters to buy.
Rafter terms in one picture
- Span (building width): the full width of the building, outside of wall to outside of wall.
- Run (rafter run): the horizontal distance one rafter covers, half the span.
- Rise: how far the roof climbs over the run.
- Pitch: rise per 12 inches of run, written 6/12, 8/12 and so on.
- Line length: the rafter measured along the slope from the ridge to the outside of the wall.
- Birdsmouth: the notch that sits the rafter on the wall plate, made of a level seat cut and a vertical heel cut.
Rafter length formula
Every rafter length calculation uses the same three numbers: the run, the roof pitch, and the overhang. The calculator does this for you. Here is the math if you want to check it by hand.
Run = span ÷ 2 − ridge thickness ÷ 2
Rafter length = √(run² + rise²) = run × √(1 + (pitch ÷ 12)²)
This is the Pythagorean theorem: once you know the rise and run, the rafter is the hypotenuse of a right triangle. The number √(1 + (pitch ÷ 12)²) is the slope factor: multiply any level distance by it to get the length along the rafter. It also turns a level overhang into tail length.
Worked example: a 24 ft span with a 1½ in ridge gives a run of 143.25 in. At 6/12 the slope factor is 1.118, so the line length is 160.16 in, or 13 ft 4 3/16 in. A 12 in overhang adds 13.42 in, for 173.57 in in total, which fits on a 16 ft board.
Roof pitch to angle and slope factor
| Pitch | Angle | Slope factor | Rise per foot of run |
|---|---|---|---|
| 3/12 | 14.04° | 1.031 | 3 in |
| 4/12 | 18.43° | 1.054 | 4 in |
| 5/12 | 22.62° | 1.083 | 5 in |
| 6/12 | 26.57° | 1.118 | 6 in |
| 7/12 | 30.26° | 1.158 | 7 in |
| 8/12 | 33.69° | 1.202 | 8 in |
| 9/12 | 36.87° | 1.250 | 9 in |
| 10/12 | 39.81° | 1.302 | 10 in |
| 12/12 | 45.00° | 1.414 | 12 in |
Metric rafters: pitch in degrees (UK and Australia)
In the UK and Australia, roof pitch is given in degrees and timber in millimetres. Switch the calculator to Metric to enter the span in metres and the pitch in degrees. Rafter length is then run ÷ cos(pitch), and the overhang is converted the same way.
| Degrees | About x/12 | Slope factor | Typical use |
|---|---|---|---|
| 15° | 3.2/12 | 1.035 | Low-pitch sheet roofs, sheds |
| 22.5° | 5/12 | 1.082 | Concrete interlocking tiles (check the tile's minimum) |
| 30° | 6.9/12 | 1.155 | Common for houses |
| 35° | 8.4/12 | 1.221 | Plain tiles and slate often need 35° or more |
| 45° | 12/12 | 1.414 | Steep roofs, room-in-roof |
UK rafters are usually C16 or C24 graded softwood, 47 mm thick and 150 to 225 mm deep, sold in lengths rising in 300 mm steps (2.4, 2.7, 3.0 m and so on). Rafter spacing is typically 400 or 600 mm centres. As with imperial sizes, the span tables in Approved Document A or TRADA, or an engineer, decide the actual size.
Laying out the plumb cut, seat cut and birdsmouth
Set a speed square on the rafter's top edge with the pivot against the edge and rotate it until the common scale reads your pitch (6 for 6/12). Mark along the square: that line is the plumb cut at the ridge. Measure the line length along the top edge (or a parallel layout line) to find the wall's outside edge, draw another plumb line there for the heel cut, then square off it for the seat cut.
The seat should bear fully on the top plate, 3½ in for a 2x4 wall or 5½ in for a 2x6 wall. The heel cut height is the seat length × pitch ÷ 12. Keep the notch shallow enough to leave plenty of wood above it. A common rule of thumb is no deeper than one third of the rafter's depth. The calculator warns you when a cut is deeper than that.
How many rafters do I need?
Rafters are usually spaced 16 or 24 inches on center (measured from the center of one rafter to the center of the next). For one side of the roof, divide the building length in inches by the spacing, round up, and add one for the end. Double it for a gable roof.
Rafters = (building length (in) ÷ spacing (in), rounded up, + 1) × 2
Example: a 30 ft long building at 16 in on center needs 360 ÷ 16 = 22.5, rounded up to 23, plus 1 = 24 rafters per side, or 48 in total. At 24 in on center it is 16 per side, 32 in total. Gable-end overhangs, framed openings and doubled rafters at skylights add to that count.
Rafter size and spacing
How deep a rafter must be depends on its horizontal span, spacing, roof and snow loads, and the lumber species and grade. Wider spacing or longer spans need deeper lumber. Common ranges for light residential roofs:
- 2x6 for short spans, such as sheds and porch roofs.
- 2x8 and 2x10 for most house roofs.
- 2x12 for long spans, heavy snow areas or vaulted ceilings with insulation in the rafter bays.
Use the rafter span tables in your local building code (in the US, the IRC tables) or an engineer's plans for the actual size. This calculator handles the geometry and cut list, not structural sizing.
Rafters vs trusses
Stick-framed rafters are cut on site and leave the attic open for storage or a vaulted ceiling. Trusses are triangulated frames built in a factory to an engineer's design. They span farther with smaller lumber and go up fast, but their webs fill the attic and they cannot be cut or altered on site. For sheds, garages, additions and small roofs, rafters are often simpler. For a large, plain gable roof, trusses are usually cheaper.
Before you cut
- Cut one pattern rafter, test it on both sides of the roof, then use it to mark the rest.
- Walls are rarely perfectly parallel. Check the span at both ends and the middle.
- This calculator sizes geometry, not strength. Rafter size and spacing depend on span, snow and dead loads, and lumber grade, so follow your local building code's span tables or an engineer's plans.
Frequently asked questions
How do you calculate rafter length?
Find the run (half the building span, minus half the ridge board thickness) and the rise (run × pitch ÷ 12). The rafter length is the square root of run² + rise², which is the same as run × the slope factor √(1 + (pitch ÷ 12)²). Add the overhang measured along the slope.
What is the angle of a 6/12 roof pitch?
A 6/12 pitch is 26.57 degrees. Common pitches: 4/12 is 18.43°, 5/12 is 22.62°, 8/12 is 33.69°, 10/12 is 39.81° and 12/12 is 45°.
How long is a rafter for a 24 foot wide building?
At a 6/12 pitch with a 1½ inch ridge board, the run is 143.25 inches and the rafter is 160.16 inches (13 ft 4 3/16 in) from ridge to the outside of the wall. A 12 inch overhang adds 13.42 inches along the slope, so you need a 16 ft board.
How deep can a birdsmouth cut be?
A common rule of thumb is to keep the birdsmouth notch no deeper than one third of the rafter's depth, so the rafter keeps enough wood above the cut to carry the overhang. Check your local building code or plans.
What angle is the plumb cut on a rafter?
The plumb cut angle equals the roof angle measured from horizontal, so on a 6/12 roof you set a speed square or saw to 26.6°. The seat cut is square to the plumb cut, at 90° minus the roof angle from the rafter edge.
Do I measure overhang horizontally or along the rafter?
Overhang is usually specified horizontally, from the outside of the wall to the fascia. The calculator converts it to length along the rafter by multiplying by the slope factor.
How many rafters do I need for a 30 foot building?
At 16 inches on center, 24 rafters per side (48 for a gable roof). At 24 inches on center, 16 per side (32 in total). Divide the length in inches by the spacing, round up, add one, then double for both sides.
What is the difference between a rafter and a truss?
Rafters are single sloped boards cut on site, leaving the attic open. Trusses are engineered triangular frames built in a factory. They span farther with smaller lumber but fill the attic with webs and can't be cut or modified.