Rafter calculator

This rafter calculator (a rafter length calculator for gable roofs) takes the building span, roof pitch and overhang and gives you the length of a common rafter for a gable roof, the plumb and seat cut angles, the birdsmouth size and the shortest board that will do.

m
°
Wall plate width (sets the seat cut)

Pitch is the roof angle in degrees. A 6/12 pitch is 26.6°.

–rafter length with overhang, ridge to tail

  • –ridge to outside of wall
  • –plumb cut angle
  • –seat cut angle
  • –roof rise at ridge
  • –birdsmouth heel height
  • –board to buy

How to use the rafter calculator

  1. Measure the span from the outside of one wall to the outside of the opposite wall.
  2. Enter the roof pitch as rise per 12 inches of run. A 6 means 6/12.
  3. Add the overhang, measured level from the outside of the wall to the end of the tail.
  4. Set the ridge board thickness (1½ inches for a 2x ridge) so half of it is taken off each rafter.
  5. Pick your rafter lumber and wall framing to size the birdsmouth. The drawing shows one side of the roof to scale.
  6. Add the building length and rafter spacing to count how many rafters to buy.

Rafter terms in one picture

Half of a gable roof showing span, run, rise, pitch, rafter line length, overhang, ridge board, plumb cut, seat cut and birdsmouth
Run is half the span. Rise is run × pitch ÷ 12. The rafter is the sloped hypotenuse plus the tail.

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

Common roof pitches
PitchAngleSlope factorRise per foot of run
3/1214.04°1.0313 in
4/1218.43°1.0544 in
5/1222.62°1.0835 in
6/1226.57°1.1186 in
7/1230.26°1.1587 in
8/1233.69°1.2028 in
9/1236.87°1.2509 in
10/1239.81°1.30210 in
12/1245.00°1.41412 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 and x/12 pitch compared
DegreesAbout x/12Slope factorTypical use
15°3.2/121.035Low-pitch sheet roofs, sheds
22.5°5/121.082Concrete interlocking tiles (check the tile's minimum)
30°6.9/121.155Common for houses
35°8.4/121.221Plain tiles and slate often need 35° or more
45°12/121.414Steep 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:

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

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.