Home › Lumber, framing and roofing › Rafter Length Calculator

Rafter Length Calculator

Enter the building span, roof pitch, overhang and ridge board thickness. You get the common rafter length, the plumb cut angle and how many rafters a gable roof needs.

How rafter length is calculated

A common rafter is the hypotenuse of a right triangle. The horizontal side is the run: half the building span, minus half the ridge board thickness. The vertical side is the rise, which the pitch sets. Pitch is written as rise per 12 units of run, so a 6/12 roof rises 6 in for every 12 in of run.

run = span ÷ 2 − ridge thickness ÷ 2

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

The square-root part is the length per unit of run. It is the same for every roof of that pitch, so framers often call it the pitch factor.

Worked example

A building 24 ft wide with a 6/12 roof, a 1½ in ridge board and a 12 in overhang. The run is 144 − 0.75 = 143.25 in. The pitch factor for 6/12 is 1.118, so the rafter is 13 ft 4 3/16 in from ridge to wall, plus a 1 ft 1 7/16 in tail: 14 ft 5 9/16 in in total, or 14.46 ft. With a little extra for cuts, buy 16 ft boards. The plumb cut is 26.6°. A 40 ft building with rafters at 16 in on center needs 31 rafters per side, 62 in all.

In metric, a 7.2 m span at 6/12 with a 300 mm overhang and a 45 mm ridge gives a 4,335 mm rafter; a 12 m building at 600 mm centers needs 21 per side, 42 in all.

Measuring span and overhang

  • Span is measured across the building from the outside of one wall's top plate to the outside of the opposite wall. Measure at both ends; if the walls are out of parallel, frame to the actual numbers.
  • Overhang is measured level, from the outside of the wall to where the fascia will go. Many houses use 12 to 24 in, as a rule of thumb; deeper eaves shade walls and windows but catch more wind.
  • Ridge board length is the building length plus the overhang at each gable end. A 40 ft building with 12 in gable overhangs needs a 42 ft ridge, usually made from two or more boards joined at a rafter pair.

Pitch factors and angles

PitchAngleRafter length per foot of run
4/1218.4°1.054 ft
5/1222.6°1.083 ft
6/1226.6°1.118 ft
8/1233.7°1.202 ft
10/1239.8°1.302 ft
12/1245.0°1.414 ft

Marking the cuts

  • Plumb cut at the ridge. Set a speed square on the pitch (the "6" on the common scale for 6/12) or on the degree scale at the plumb cut angle, and draw the line. When the rafter is in place, that line is vertical.
  • Measure along the top edge. The lengths here are measured along the top edge of the rafter from the ridge plumb line. Mark the wall line, then the tail.
  • Bird's mouth. Notch the rafter where it sits on the wall plate: a level seat cut and a plumb heel cut. Keep the notch shallow so the rafter keeps its strength; local code limits how deep it can go.
  • Cut one rafter, test it on both sides of the building, then use it as a pattern for the rest.

Safety and code notes

  • This calculator gives length, not size. Rafter depth and spacing come from span tables for your wood species, grade, snow load and dead load. Check local code or a structural engineer.
  • Under the IRC, a ridge board is commonly required to be at least 1 in nominal thick and as deep as the rafter's plumb cut. Roofs flatter than 3/12 need a structural ridge beam instead.
  • Rafters push outward on the walls. Ceiling joists or rafter ties must hold the walls together.
  • Roof framing is work at height. Use proper fall protection and never stand on unbraced rafters.

Frequently asked questions

How long is a rafter for a 24 ft building with a 6/12 pitch?

With a 1½ in ridge board and a 12 in overhang, each common rafter is about 14 ft 5 9/16 in long, so 16 ft boards are needed.

How do I find the plumb cut angle?

It equals the roof angle: the arctangent of rise ÷ 12. A 6/12 roof has a 26.6° plumb cut, an 8/12 roof 33.7°.

How many rafters do I need?

Divide the building length by the spacing, round up and add one for each side, then double it for a gable roof. A 40 ft building at 16 in on center needs 31 per side, 62 in all.

Why subtract half the ridge board?

The rafters meet the faces of the ridge board, not its center line, so each rafter is shorter by half the ridge thickness measured level.

Last updated November 8, 2026. See how we check our numbers.

Keep going