Rafter Calculator

Work out rafter length, cut angles and the birdsmouth for a gable roof. Enter the building width, pitch and overhang to get the ridge height and how many rafters to buy.

Calculator Construction Updated Oct 3, 2026
How to Use
  1. Enter the building width, measured across the outside of the wall plates, and the roof pitch in inches of rise per 12.
  2. Enter the overhang, measured horizontally from the wall to the end of the rafter tail.
  3. Enter the ridge board thickness (1½ in for a 2× ridge) and the wall plate width the birdsmouth sits on.
  4. Choose the rafter size, and the building length and rafter spacing to count rafters.
  5. Read the rafter length, the cut angles, the birdsmouth and the ridge height; the drawing shows the layout.
Input
ft
in / 12
in
in
in
ft
Presets
Half the roof in section
Rafter length
—
Cut angle
—
Ridge rise
—
Rafters
—

Worked Example

A gable roof over a 24 ft wide building, 6/12 pitch, 12 in overhang, 1½ in ridge board, 2×8 rafters on 2×4 walls. Run = (288 − 1.5) ÷ 2 = 143.25 in. Pitch factor = √(1 + 0.5²) = 1.118. Rafter from the plate line to the ridge = 143.25 × 1.118 = 160.2 in (13 ft 4⅛ in). Tail = 12 × 1.118 = 13.4 in. Overall, measured along the top edge: 14 ft 5⅝ in, so buy 16 ft lumber.

Cuts: the roof angle is tan⁻¹(6 ÷ 12) = 26.57°; the plumb cuts at the ridge and tail are at that angle, and the birdsmouth seat is square to them. The seat bears on the full 3½ in plate, so the birdsmouth is 3½ × 6 ÷ 12 = 1¾ in deep. The ridge sits 143.25 × 0.5 = 71⅝ in (5 ft 11⅝ in) above the plates, measured to the rafter seat line.

The common mistake: forgetting the ridge board. Using half the full width as the run (144 in) makes every rafter ¾ in × 1.118 too long, so the ridge has to be pushed up, the roof gets steeper, and the walls are pushed out.

Show Work

Enter the sizes to see the step-by-step working.

Formulas

Run
(width − ridge) ÷ 2
Outside of plate to the ridge face
Rafter length
(run + overhang) × √(1 + (p ÷ 12)²)
6/12: × 1.118 · 12/12: × 1.414
Roof angle
θ = tan⁻¹(p ÷ 12)
Plumb cuts at θ
Birdsmouth
depth = seat × p ÷ 12
Keep it under ⅓ of the rafter depth
Ridge rise
run × p ÷ 12

Laying Out a Common Rafter

Carpenters cut one pattern rafter, check it in place at both ends of the building, then use it to mark the rest. The layout starts with a plumb line at the ridge, measures the line length along the rafter to the plate line, and marks the birdsmouth there: the seat cut sits flat on the wall plate and the heel cut sits against its outside face. The tail is measured on from the plate line and finished with a plumb cut for the fascia, or a square cut.

The speed square, invented by Albert Swanson in 1925, carries the rafter tables that make this quick: pivot it on the rafter edge to the pitch number and it gives the plumb line directly. Older framing squares have the rafter lengths per foot of run stamped on the blade, the same pitch factors this calculator uses.

About This Calculator

This calculator lays out common rafters for a gable roof: run, length to the ridge and with the tail, roof angle and cuts, birdsmouth depth and the height above the plate, ridge rise, the number of rafters and the stock length to buy. It draws half the roof in section with the dimensions, in feet and inches or metres.

Everything runs in your browser; nothing is sent anywhere. Check rafter size and spacing for your snow load in the span calculator, and use the length on a pattern rafter before cutting the rest.

Related calculators: Joist & Rafter Span Calculator, Roofing Calculator, and Slope & Grade Calculator.

Frequently Asked Questions

How do I calculate rafter length?

Find the run, half the building width less half the ridge thickness, and multiply by the pitch factor √(1 + (rise ÷ 12)²). For a 24 ft building at 6/12 with a 1½ in ridge, the run is 143.25 in and the factor 1.118, so the rafter is 160.2 in (13 ft 4⅛ in) from the plate to the ridge, plus the tail for the overhang.

What angle do I cut a rafter?

The plumb cut at the ridge and the tail are at the roof angle, tan⁻¹(rise ÷ 12): 26.57° for 6/12, 33.69° for 8/12, 45° for 12/12. With a speed square, pivot on the pivot point and set the mark to the pitch number on the “common” scale. The seat cut of the birdsmouth is square to the plumb cut.

How deep should a birdsmouth be?

The seat should bear fully on the wall plate (3½ in on a 2×4 wall), and the heel cut should not be deeper than about a third of the rafter depth measured on the plumb line, so enough wood is left above it. For a 2×8 at 6/12 on a 2×4 wall, the birdsmouth is 1¾ in deep, leaving a height above plate of 6⅜ in.

Is the overhang measured along the rafter or level?

Usually level, from the outside of the wall to the end of the tail, because that is what you see from the ground and what the soffit width is based on. The tail is longer than that by the pitch factor: a 12 in level overhang on a 6/12 roof needs 13.4 in of rafter.

How many rafters do I need?

On each side, the building length divided by the spacing, rounded up, plus one; double it for both sides. A 40 ft building at 16 in centres takes 31 per side, 62 in all, plus any extra for gable overhang ladders.

How do I use the Rafter Calculator?

Just type your numbers. The answer shows up right away — there is no button to press. Change anything and it updates by itself.

Does it cost anything or need an account?

No. The tool is completely free, there is no account to create, and it keeps working offline after the page first loads.

Is anything I type uploaded?

No. The tool works entirely on your device, so the values you enter never leave your browser.

Common Use Cases

House roof

24 ft wide, 6/12, 12 in overhang: rafters 14 ft 5⅝ in, cut from 16 ft lumber.

Steep roof

The same building at 12/12: rafters 18 ft 3½ in, 45° cuts, ridge 11 ft 11¼ in above the plates.

Shed

10 ft wide at 4/12 with 6 in overhangs: rafters 5 ft 8¾ in, ridge 1 ft 7¾ in above the plates.

Garage

24×24 ft at 8/12, 2×8 rafters at 24 in: 13 per side, 26 in all, each 15 ft 6⅝ in.

Last updated: