All calculators

Concrete and masonry

Landscaping and earthwork

Carpentry and interiors

Electrical, cooling and pools

Rafter Calculator

Work out the rafter length, rise and roof angle for a common gable roof. Enter the building span, pitch and overhang to get the length to cut and the rafters to buy.

The span is measured outside wall to outside wall. Results are for a common gable roof with two equal slopes.

Results are estimates for a common gable roof. The calculator gives lengths and counts, not lumber sizes; span tables, an engineer and your building permit decide the board size and fixing.

How the rafter calculator works

The run is half the building span, less half the ridge board thickness converted to feet. The pitch multiplier is the square root of 1 plus the pitch divided by 12, squared. Multiplying the run by the multiplier gives the rafter length from the ridge to the outside of the wall, and multiplying the horizontal overhang by the same multiplier gives the sloping overhang. The two added together are the length to cut. Rise is the run multiplied by the pitch divided by 12, and the roof angle is the inverse tangent of the pitch divided by 12. The board to buy is that total rounded up to the next 2 ft, because lumber is sold in 2 ft steps. For the count, the building length in inches is divided by the rafter spacing and rounded up, then one is added for the end rafter and the result is doubled for the two sides.

Example: a 24 ft span at 6/12 pitch with a 1.5 in ridge has a run of 12 − 0.0625 = 11.9375 ft. The multiplier is the square root of 1 + 0.25 = 1.118. The rafter is 11.9375 × 1.118 = 13.35 ft, and a 1 ft overhang adds 1.118 ft, so the total is 14.46 ft. The rise is 11.9375 × 0.5 = 5.97 ft and the angle is 26.6°. A 14.46 ft total becomes a 16 ft board. On a 40 ft building at 16 in spacing, 480 ÷ 16 = 30 spaces, 30 + 1 = 31 rafters per side and 62 in total.

Line length, cuts and overhang

The line length is measured along the top edge of the rafter from the ridge to the outside face of the wall. It does not include the birdsmouth, the plumb cut at the ridge or the tail cut; those are marked on the board after the line length is known, so check the board leaves enough stock for them; if the total is only a few inches under the board length, buy the next size up. The overhang is entered as a horizontal distance from the wall to the fascia. The sloping length is longer than that horizontal distance by the same pitch multiplier, which is why a 1 ft overhang adds 1.12 ft at 6/12. Half the ridge thickness is taken off the run because the rafters meet the side of the ridge board rather than a single point at the centre.

What this calculator does not do

This page covers a common gable roof with two equal slopes. It does not work out hips, valleys, dormers, unequal slopes or a roof with more than one ridge. It gives lengths and counts only, not lumber sizes: the depth and grade of a rafter come from span tables, an engineer and the building permit, and a rafter that is too small can sag or fail under snow. Ceiling joists, collar ties, bracing and fixings are not included. For the pitch itself use the roof pitch calculator, for shingles use the roofing calculator, and for the lumber cost use the board foot calculator.

Frequently asked questions

How long is a rafter for a 24 ft span at 6/12 pitch?

Half of 24 ft is 12 ft, and 1.5 in of ridge takes off 0.0625 ft, leaving a run of 11.9375 ft. At 6/12 the multiplier is 1.118, so the rafter is 11.9375 × 1.118 = 13.35 ft. A 1 ft overhang adds 1.118 ft, giving 14.46 ft, so buy a 16 ft board.

How many rafters for a 40 ft building at 16 in spacing?

40 ft is 480 in. Dividing by 16 gives 30 spaces, and one more rafter than spaces gives 31 per side. Both sides need 31 × 2 = 62 rafters.

How much does a 6/12 roof rise?

A 6/12 pitch rises 6 in for every 12 in of run, which is 0.5 ft per ft. The 11.9375 ft run rises 11.9375 × 0.5 = 5.96875 ft, or about 5.97 ft.

Related calculators