Framing a roof starts with two numbers: how far each rafter must reach and at what angle. This calculator turns a building width and roof pitch into the common rafter length with overhang, the ridge height, the hip rafter length, and the rafter count, so you can cut and order with confidence before a single board is touched.
How it works
Pitch is a rise over a 12-unit run. From half the building width (the run) the geometry follows:
angle = arctan(rise / 12)
common len = run × √(1 + (rise/12)²) + overhang × √(1 + (rise/12)²)
ridge ht = run × (rise / 12)
hip len = run × √(1 + (rise/12)² + 1) (diagonal run uses 17-per-12)
count = ceil(length / spacing) + 1
The factor under the square root for the hip adds a second horizontal component because the hip travels diagonally across the plan corner.
Worked example
A 24 ft wide building at 6-in-12 has a run of 12 ft (half the width):
- Common rafter line length = 12 × √(1 + 0.25) = 12 × 1.118 = 13.4 ft, plus the sloped overhang.
- Ridge height = 12 × (6/12) = 6 ft above the wall plate (angle = arctan(0.5) ≈ 26.57°).
- Hip rafter = 12 × √(1.25 + 1) = 12 × 1.5 = 18 ft line length.
If the building is 40 ft long with rafters at 16 in on centre:
- Count per side = ceil(40 / (16/12)) + 1 = ceil(30) + 1 = 31 rafters per slope.
Common pitches and their angles
| Pitch | Rise per 12 run | Angle | Character |
|---|---|---|---|
| 3-in-12 | 3 in | 14.0° | Low slope, almost flat |
| 4-in-12 | 4 in | 18.4° | Minimum for most shingles |
| 6-in-12 | 6 in | 26.6° | Common residential |
| 8-in-12 | 8 in | 33.7° | Steeper traditional look |
| 12-in-12 | 12 in | 45.0° | Steep, equal rise and run |
Most asphalt shingle manufacturers specify a minimum pitch of 4-in-12 (some allow 2-in-12 with modified installation). Metal and membrane roofs can go lower. Always check the material specification before finalising pitch.
What these are line lengths
The lengths calculated are line lengths — the measurement along the top edge of the rafter, also called the theoretical length. When you cut actual boards:
- Deduct half the ridge board thickness at the peak (typically 3/4 in for a 1x ridge or 3/4 to 1 in for a 2x ridge board, measured horizontally then converted to the slope).
- Add a tail cut at the eave if a rafter tail extends past the wall plate.
- Bird’s mouth cut removes a notch where the rafter sits on the wall plate — this does not change the line length but affects the actual board length you buy.
These are line lengths measured along the rafter top edge; the tool does not apply any of these deductions automatically.