Introduction
Rafter math looks intimidating until you see that it’s one triangle, repeated. Every rafter length, cut angle, and birdsmouth on a roof comes from a single right triangle: the run (horizontal), the rise (vertical), and the rafter itself as the hypotenuse. This guide derives each formula from that triangle, with worked numbers in both unit systems.
The Rafter Calculator applies these formulas instantly — enter span, pitch, and spacing, and it returns lengths, angles, and counts. What follows is the derivation behind the button: why the unit-rise method works, where the hip rafter’s diagonal comes from, and how the cut angles fall out of the pitch.
The Core Triangle: Rise, Run, and Rafter
Picture one common rafter in cross-section. Its horizontal shadow on the attic floor is the run — for a gable roof, exactly half the building span, measured from the ridge centerline to the outside face of the wall plate. Its vertical height above the plate is the rise. The rafter itself is the hypotenuse of this right triangle, so by Pythagoras:
Rafter length = √(run² + rise²)
For a 24-ft (7.315 m) span at 6:12 pitch: run = 12 ft (3.658 m), rise = 12 × 6/12 = 6 ft (1.829 m). Length = √(12² + 6²) = √180 = 13.416 ft. Metric: √(3.658² + 1.829²) = √(13.381 + 3.345) = √16.726 = 4.090 m. Same triangle, same answer — 13.416 ft × 0.3048 = 4.090 m exactly.
The Unit-Rise Method
Framers rarely compute the whole triangle at once. Instead they reduce it to one foot of run — the unit triangle with run = 12 in, rise = pitch inches:
Unit length = √(12² + pitch²) (inches of rafter per foot of run)
| Pitch | Unit triangle | Unit length (in/ft) | Unit length (mm per 300 mm) |
|---|---|---|---|
| 4:12 | √(144 + 16) | 12.65 | 321 |
| 6:12 | √(144 + 36) | 13.42 | 341 |
| 8:12 | √(144 + 64) | 14.42 | 366 |
| 10:12 | √(144 + 100) | 15.62 | 397 |
| 12:12 | √(144 + 144) | 16.97 | 431 |
Then: Rafter length = unit length × run in feet. A 6:12 rafter with a 12-ft run: 13.416 × 12 = 160.99 in = 13.42 ft. The method works in metric directly: the unit rise is pitch millimeters per 300 mm of run (150 mm for 6:12), and rafter length = unit length × run in meters. This single-triangle approach is also the foundation of the complete guide’s worked example.
Deriving the Hip and Valley Rafter
A hip rafter sits at 45° in plan between two roof planes. Its horizontal run is therefore the diagonal of the square formed by one foot of run on each plane:
Unit hip run = √(12² + 12²) = √288 ≈ 16.97 per foot of common run
The vertical rise is unchanged — the hip rises the same pitch over its longer diagonal run. So the hip is the hypotenuse of a triangle with horizontal leg 16.97 and vertical leg equal to the pitch:
Unit hip length = √(16.97² + pitch²) (inches of hip rafter per foot of common run)
At 6:12: √(287.98 + 36) = √323.98 = 18.00 in per ft of run. A 12-ft common run gives an 18.00-ft hip rafter (5.486 m). Cross-check in metric: diagonal run = 3.658 × √2 = 5.173 m; rise = 1.829 m; √(5.173² + 1.829²) = √(26.760 + 3.345) = √30.105 = 5.487 m — matching to the millimeter. Valley rafters use the identical formula; only their position differs.
Jack rafters then follow by subtraction: each jack is shorter than the previous one by one spacing × unit length. At 24 in o.c. on a 6:12 roof, successive jacks differ by 2 × 13.416 = 26.83 in (682 mm) — the regular “step” that makes jack layout a simple sequence.
Cut Angles From the Pitch
Both saw angles come straight from the pitch triangle:
Plumb cut angle = atan(pitch ÷ 12) — the angle of any vertical cut (ridge cut, birdsmouth plumb cut), measured from the rafter’s edge. For 6:12: atan(0.5) = 26.57°.
Seat (level) cut angle = 90° − plumb angle — the birdsmouth seat cut and the tail/fascia cut. For 6:12: 90 − 26.57 = 63.43°.
Framing squares encode these directly: the pitch number on the tongue and 12 on the blade give you the plumb cut; reverse them for the seat cut. A speed square’s degree scale does the same job — set it to 26.6° for the plumb cuts on a 6:12 roof. Layout technique for transferring these angles to the board is covered in the pro tips guide.
The Ridge Deduction
The formulas above measure to the ridge centerline — but the rafter board stops at the ridge board’s face. The correction:
Layout length = theoretical length − (ridge board thickness ÷ 2)
With a 2× ridge board (1.5 in / 38 mm actual): deduct 0.75 in (19 mm). Our example: 160.99 − 0.75 = 160.24 in (4.070 m). Skip this step and every rafter lands 3/4 in long — enough to bow the ridge or push walls out of plumb across a 36-ft span. On hip roofs, the same deduction applies where jack rafters meet the hip’s face.
The Birdsmouth Geometry
The birdsmouth is defined by two cuts from one layout point on the rafter’s bottom edge:
- Plumb cut: vertical line down from the layout point, at the plumb-cut angle to the rafter edge.
- Seat cut: horizontal line from the bottom of the plumb cut, at the seat-cut angle, with length chosen so the rafter sits fully on the plate.
The layout point is placed so that the outside of the plate aligns with it when the rafter is at its theoretical position — typically found by measuring the run distance along the rafter from the ridge cut: run × unit length. For our 12-ft run at 6:12: 12 × 13.416 = 160.99 in down the rafter from the ridge cut (before the ridge deduction is applied at the top).
Seat cut depth is the critical limit: a common guideline caps it at about one-third of the rafter depth — for a 2×8 (7.25 in / 184 mm deep), that’s 2.42 in (61 mm), so a 2-in (50 mm) seat leaves 5.25 in of heel, safely above the guideline. Treat this as a rule of thumb, not a code citation: the enforceable limit is whatever your local code specifies, as the code compliance guide explains.
Rafter Count and Board Feet
Two final formulas complete the takeoff:
Rafter pairs = (ridge length ÷ spacing) + 1; total commons = 2 × pairs. Ridge 36 ft, spacing 24 in: 36 ÷ 2 + 1 = 19 per side → 38 rafters.
Board feet = (thickness × width × length in inches, nominal) ÷ 12. A 2×8×16: (2 × 8 × 16) ÷ 12 = 21.33 bf. Times 38 rafters = 810.7 bf. Metric: 0.0508 × 0.2032 × 4.877 m = 0.05034 m³ per board × 38 = 1.913 m³ (1 bf ≈ 0.00236 m³). The estimating guide builds the full material takeoff on these two formulas.
Related Guides
- Complete Guide — terminology, the worked example, and common roof types.
- Pro Tips — transferring these angles to real boards on site.
- Estimating Guide — counts, board feet, and waste allowances.
- Common Mistakes — where the math goes wrong in practice.
- Code Compliance — which limits are code and which are convention.
Check Your Math
Every rafter formula on a roof is the same right triangle wearing different clothes: commons use run directly, hips use the diagonal run, jacks step down by spacing, and the angles are just the triangle’s corners expressed in degrees. Work one example by hand — 6:12, 12-ft run, 13.42 ft, 26.6° — and the pattern is memorized. Then let the Rafter Calculator do the repetitive arithmetic across the whole roof, and spot-check its output against the derivations above before you cut.
Disclaimer: Formulas shown are standard geometric derivations for planning purposes. Actual rafter sizing, notching limits, and connection requirements are governed by lumber properties and local building codes. Verify dimensions with your supplier and consult a licensed professional or your local building authority for structural or code-related decisions.
