Rafter Length Calculator

Enter the width of the building, the roof pitch and the overhang. You get the length of a common rafter, the roof angle, how high the ridge is above the top plate, and how many rafters the roof needs.

Your project

Results

Rafter length, including the overhang
14 ft 6 7/16 in
14.53 ft along the slope
Rafter length (decimal feet)
14.53 ft
Length from the ridge to the outside of the wall
13.42 ft
Overhang along the slope
1.12 ft
Roof angle
26.6 °
Height of the ridge above the top plateMeasured to the center of the span
6.00 ft

How many

Rafters on each side
16 rafters
Rafters in allPlus any gable-end and hip framing
32 rafters
  • This is the "theoretical" length from the center of the ridge to the outside of the wall, plus the overhang. Take off half the thickness of the ridge board (measured along the slope) at the top, and cut the birdsmouth and the tail to suit. Rafter size and spacing depend on the span, the load and your local code: check a span table or ask an engineer.

How this calculator works

A common rafter is the hypotenuse of a right triangle. Its run is half the building width, its rise is the run times the pitch divided by 12, and its length is the run times the square root of 1 plus the pitch squared over 144. The overhang is added along the same slope, using the same factor.

length = run × √(1 + (pitch ÷ 12)²) + overhang × √(1 + (pitch ÷ 12)²)

Worked example: a 24 ft wide building with a 6/12 pitch has a run of 12 ft and a slope factor of √1.25 = 1.118. The rafter from the ridge to the wall is 12 × 1.118 = 13.42 ft, and a 12 in overhang adds 1.118 ft, so the rafter is 14.53 ft (14 ft 6 7/16 in) long. The ridge sits 6 ft above the top plate. A 30 ft long roof with rafters at 24 in on center takes 16 on each side, 32 in all.

Common rafter length by building width and pitch (no overhang)

The length from the center of the ridge to the outside of the wall, in feet and inches.

Width4/126/128/1210/1212/12
16 ft8 ft 5 3/16 in8 ft 11 5/16 in9 ft 7 3/8 in10 ft 4 15/16 in11 ft 3 3/4 in
20 ft10 ft 6 1/2 in11 ft 2 3/16 in12 ft 0 1/4 in13 ft 0 3/16 in14 ft 1 11/16 in
24 ft12 ft 7 13/16 in13 ft 5 in14 ft 5 1/16 in15 ft 7 7/16 in16 ft 11 5/8 in
28 ft14 ft 9 1/16 in15 ft 7 13/16 in16 ft 9 15/16 in18 ft 2 11/16 in19 ft 9 9/16 in
32 ft16 ft 10 3/8 in17 ft 10 11/16 in19 ft 2 3/4 in20 ft 9 15/16 in22 ft 7 1/2 in

Tips before you buy

  • Rafters are cut from the plan dimensions, but the lumber has width, so mark the plumb cut, the birdsmouth and the tail carefully on one rafter, cut it and use it as a pattern for the rest.
  • Check the span against a span table for the lumber grade, species, spacing and roof load, and add collar ties, rafter ties or a ridge beam as required. The structure matters more than the length.
  • Measure the building width between the real outside faces of the walls, not the plan, and check that the walls are the same width at both ends.
  • Order a little longer than the calculation so that you have room to trim, and buy the next standard length up (for 14.5 ft you need a 16 ft board).
  • Roofs often need permits and inspection of the framing. Check with your building department.

Tools & materials for this project

As an Amazon Associate we earn from qualifying purchases. These links do not change what you pay.

Frequently asked questions

How do you calculate rafter length?

Take half the building width as the run, multiply by the square root of 1 plus the pitch squared over 144, and add the overhang using the same factor. For a 24 ft wide building with a 6/12 pitch and a 12 in overhang that gives 14.53 ft.

What is the rafter length for a 6/12 pitch?

The rafter is 1.118 times the run. A 12 ft run (a 24 ft wide building) gives 13.42 ft before the overhang.

How many rafters do I need?

One every 16 or 24 inches along the length, plus one for the end, on each side of the ridge. A 30 ft roof at 24 in on center takes 16 on each side.

What is the angle of a 6/12 roof?

26.6 degrees. A 4/12 roof is 18.4 degrees, an 8/12 is 33.7 degrees, and a 12/12 is 45 degrees.

Add this calculator to your website

Running a blog, a contractor site or a class page? You can put this calculator on it for free. Copy the code below, and please leave the link underneath the calculator in place. The small script just resizes the frame to fit the results; if your site strips scripts, the calculator still works inside a scrolling frame.

Get the embed code

Related calculators & guides

Estimates only. Results assume standard materials and simple shapes. Supplier products vary, and the final call on quantity, structure and safety is yours. Check your local code and your supplier's guidance before ordering.