Rafter Calculator
This rafter calculator gives common rafter length with the ridge and birdsmouth deductions, how many a roof needs, and the hip, valley and jack rafters on a hipped roof.
Common Rafter
How Many Rafters
Rafter count along the length of the building, both slopes, plus the ridge.
Hip, Valley and Jack Rafters
A hip runs diagonally, so it climbs a shallower apparent pitch and is longer than any common rafter.
How to use the Rafter Calculator
Enter the span, the full width of the building, plate to plate, and the pitch. Each rafter runs half the span, and the tool applies the two deductions that turn a theoretical length into a cut length: half the ridge thickness, measured along the slope, and the birdsmouth seat.
The Layout tab counts rafters along the building, both slopes plus the gable ends. The Hip tab handles hipped roofs, where the diagonal members are longer and cut at a different angle.
If you only need pitch converted into an angle, a slope factor or a roof area, the roof pitch calculator does that more directly.
Rafter formula
run = span ÷ 2line length = run × √(1 + (pitch ÷ 12)²)ridge deduction = (ridge thickness ÷ 2) × √(1 + (pitch ÷ 12)²)overhang along slope = overhang × √(1 + (pitch ÷ 12)²)hip run = √(run² + run²) = run × √2
The slope factor appears three times, because every horizontal measurement on a roof has to be converted the same way. That includes the ridge deduction, halving the ridge and forgetting to convert it is a common quarter-inch error that compounds across a roof.
| Pitch | Common slope factor | Hip slope factor | Angle |
|---|---|---|---|
| 4/12 | 1.0541 | 1.0328 | 18.43° |
| 6/12 | 1.1180 | 1.0607 | 26.57° |
| 8/12 | 1.2019 | 1.1006 | 33.69° |
| 10/12 | 1.3017 | 1.1524 | 39.81° |
| 12/12 | 1.4142 | 1.2247 | 45.00° |
The hip factor is smaller because a hip travels 17 inches horizontally for every 12 a common rafter does, so it rises less steeply along its own length.
Worked example
A 28 ft span at 6/12, 16 in overhang, 1½ in ridge, 3½ in seat cut:
- Run: 28 ÷ 2 = 14 ft
- Slope factor at 6/12: 1.1180
- Line length: 14 × 1.1180 = 15.652 ft = 15 ft 7⅞ in
- Ridge deduction: (1.5 ÷ 2) × 1.1180 = 0.84 in
- Overhang along slope: 16 × 1.1180 = 17.89 in
- Total cut length: 15 ft 7⅞ − 0.84 in + 17.89 in = 17 ft 0 ⅞ in
And the hip on the same roof: run 14 × √2 = 19.80 ft, slope factor 1.0607, so the hip is 21.00 ft, over five feet longer than the common rafter it meets.
What the result means
Line length is not cut length. The line length is the theoretical centre-line from the plate to the ridge centre. The rafter you cut is shorter at the top by half the ridge and longer at the bottom by the overhang. Ordering off the line length gives you rafters that are close and wrong.
A hip is not a steeper rafter, it is a shallower one. It runs diagonally, so it covers 16.97 inches of plan for every 12 a common rafter covers. Its unit rise over its own run is lower, which is why the hip slope factor is smaller and the hip is longer.
The birdsmouth is a notch, not a shortening. It does not change the rafter’s length along the slope; it changes where the rafter sits and how much timber is left above the plate. Code generally wants at least two thirds of the rafter depth remaining.
Common mistakes
- Deducting the whole ridge thickness. Each of the two rafters meeting at a ridge loses half of it, not all of it.
- Deducting the ridge horizontally. The deduction runs along the slope, so it is multiplied by the slope factor like everything else.
- Measuring the overhang along the slope. Soffit overhang is a level dimension. Enter it level and let the tool convert it.
- Using the common slope factor for hips. Hips use the 17-inch factor. Using 1.1180 instead of 1.0607 at 6/12 makes every hip five percent too long.
- Cutting the birdsmouth too deep. Leave at least two thirds of the rafter depth above the seat cut, or the rafter is weakened where it is most loaded.
Frequently asked questions
How do you calculate rafter length?
Halve the span to get the run, then multiply by the square root of one plus the pitch over twelve squared. For a 28 foot span at 6/12 the run is 14 feet and the slope factor is 1.118, giving a line length of 15 feet 7 and 7/8 inches before the ridge deduction and overhang.
How much do you deduct for the ridge board?
Half the ridge thickness, measured along the slope. A one and a half inch ridge means three quarters of an inch horizontally, which at 6/12 pitch is 0.84 inches along the rafter. Each of the two rafters meeting at the ridge takes that deduction, not the full thickness.
How long is a hip rafter?
Longer than the common rafter it meets, because it runs diagonally. The hip run is the common run times the square root of two, and the hip slope factor is smaller than the common one. On a 28 foot span at 6/12 the hip is about 21 feet against a 15 foot 8 inch common rafter.
What is a birdsmouth cut?
The notch where the rafter sits on the wall plate, a level seat cut and a vertical heel cut. It positions the rafter rather than shortening it. Leave at least two thirds of the rafter depth above the notch, since that is where the rafter carries its load.
How many rafters do I need?
Divide the building length by the spacing, add one for the rafter at the end of the run, then double it for the two slopes. A 40 foot building at 16 inch centres needs 31 per side, so 62 rafters plus any gable-end and doubled members.
Should the overhang be measured level or along the slope?
Level. Soffit and eave overhangs are specified as a horizontal projection, then converted to a sloped length using the same slope factor as the rest of the rafter. A 16 inch level overhang at 6/12 is 17.9 inches of timber.
Sources and assumptions
Slope factors are exact geometry: √(1 + (rise/run)²) for common rafters and √(1 + (rise/16.97)²) for hips and valleys on an equal-pitch roof, the 16.97 being 12√2.
Ridge deduction of half the ridge thickness along the slope, and a birdsmouth leaving at least two thirds of the rafter depth, follow standard US framing practice and the IRC.
Rafter size and spacing are a structural decision. This tool computes lengths and counts; span tables, snow and wind loads, and member sizing come from code or an engineer.
