Roof Pitch and Rafter Length, Explained
After reading this you can convert a roof pitch between rise-per-12, degrees and percent, and compute the common rafter length, cut angles, ridge height and rafter count from first principles.
A roof is a right triangle repeated along a ridge. The horizontal half-span is one leg, the vertical rise is the other, and the rafter you cut is the hypotenuse. Once you see it that way, every number on the tool follows from the same triangle and a little trigonometry.
Here is the hook. A building spans 8000 mm wall to wall at a 6/12 pitch. The rafter's top edge line is not 4000 mm (the half-span) and it is not 4472 mm either unless you know why. It is 4472 mm before you subtract for the ridge and add for the eave. This article shows exactly where that number comes from and what to change when reality intrudes.
What pitch actually means
Pitch is the steepness of the roof plane. Builders express it three ways, and the tool converts between all three because different trades and drawings prefer different units.
- Rise per 12
- How many units the roof climbs for every 12 units of horizontal run. A 6/12 roof rises 6 for every 12 across. This is the framing-square convention.
- Degrees
- The angle \theta between the rafter and the horizontal.
- Percent grade
- Rise divided by run, as a percentage. A 6/12 roof is
6/12 = 0.5 = 50%.
The link between them is one equation. If the rise per 12 is r, then:
Here r is the rise per 12 of run and \theta is the roof angle. For r = 6: \theta = \arctan(0.5) = 26.57^\circ and the grade is 50%. Note that percent and degrees are not the same thing. A 100% grade is a 45 degree roof, not vertical.
When this calculator fits and when it does not
Use it for a straight gable or a single roof plane where every common rafter is identical. It handles the geometry: line lengths, angles, ridge height, hip and valley diagonals, and rafter count.
Do not treat the output as a structural design. Nothing here checks whether a rafter will carry snow, wind or its own weight. Span tables and an engineer decide the timber size. The tool tells you how long to cut a 45 x 195 rafter, not whether 45 x 195 is strong enough over 4 metres.
Line length is not board length. The calculator returns the length along the rafter's top edge. Your board must be longer so you have material for the plumb cut at the ridge and the tail. Always cut a test rafter and offer it up before batching the rest.
The common rafter formula
Start with the run. The run is the horizontal distance the rafter covers, from the outside of the wall plate to the centre of the ridge. For a symmetric gable that is half the span, minus half the ridge board thickness, because each rafter stops at its own face of the ridge.
Here span is the outside-to-outside wall distance and ridge is the ridge board thickness. The rafter's top edge line over that run is the hypotenuse of a triangle with angle \theta:
L_{\text{body}} is the line length from the ridge to the wall plate. Dividing by \cos\theta stretches the horizontal run into the sloped length. The overhang adds its own sloped piece over its horizontal projection:
The plumb cut (the vertical face where the rafter meets the ridge) is marked at \theta from square. The seat cut (the level face that sits on the wall plate) is marked at 90^\circ - \theta. They are complementary because one is vertical and the other horizontal on the same sloped board.
Worked example: the demo numbers
An 8 m span at 6/12
Load the demo: pitch 6/12, span 8000 mm, ridge 38 mm, overhang 400 mm, spacing 406 mm, roof length 10000 mm.
- Angle: \theta = \arctan(6/12) = 26.565^\circ, so \cos\theta = 0.8944.
- Run: 8000/2 - 38/2 = 4000 - 19 = 3981\ \text{mm}.
- Body line length: 3981 / 0.8944 = 4451\ \text{mm}.
- Tail: 400 / 0.8944 = 447\ \text{mm}. Total line length 4451 + 447 = 4898\ \text{mm}.
- Ridge height above the plate: \text{run}\times \tan\theta = 3981 \times 0.5 = 1991\ \text{mm} (geometric, to the top edge line).
- Plumb cut 26.57^\circ from square, seat cut 63.43^\circ.
Without the ridge subtraction the body length would be 4000/0.8944 = 4472\ \text{mm}, the hook figure from the intro. The 38 mm ridge trims 21 mm off it.
Hip and valley rafters
A hip or valley rafter runs diagonally across the corner, so its horizontal run is longer than the common run. In plan the common run and an equal run at right angles form a square; the hip crosses the diagonal, which is \sqrt{2} longer.
The rise is the same as the common rafter, but it is now spread over the longer diagonal run, so the hip sits at a shallower angle \theta_{\text{hip}}. This is the old framing-square trick: mark the common rafter with the rise against 12, and mark the hip with the same rise against 17, because 12\sqrt{2} = 16.97 \approx 17.
For the demo triangle the hip run is 3981\times 1.4142 = 5630\ \text{mm} and its line length is \sqrt{5630^2 + 1991^2} = 5972\ \text{mm}. That is why hip stock is bought longer than common stock.
Reading the results
The rafter count comes from dividing the roof length by the spacing and adding one for the rafter at the start.
With 10000 mm of ridge at 406 mm spacing: \lceil 10000/406 \rceil = \lceil 24.6 \rceil = 25, plus one end rafter gives 26 rafters per slope. Both slopes together need 52. The 406 mm default is 16 inches on centre; 610 mm is 24 inches.
The chart below shows how steeply line length grows as pitch rises for a fixed 3981 mm run.
Common mistakes
Four errors account for most miscut rafters.
- Forgetting the ridge subtraction. Using half the span as the run makes every rafter \text{ridge}/(2\cos\theta) too long. That is 21 mm here, enough to push the ridge up and open the seat cuts.
- Confusing line length with board length. The line length is measured along the top edge. You need extra stock past the plumb and tail cuts.
- Ignoring the bird's mouth drop. The geometric ridge height is measured to the top edge line. Cutting a seat notch drops the whole rafter by the seat depth, so measure ridge height from a test rafter in place, not from the formula alone.
- Percent versus degrees. A 50% grade is 26.57 degrees, not 50 degrees. Enter the value in the mode that matches your source drawing.
Related tools
Once the rafter lengths are set, plan the cutting. The Cut List Optimizer packs your rafter and blocking lengths onto the fewest boards. For roof sheathing, the Sheet Goods Cut Optimizer nests panels on plywood. If the roof leads to a loft, the Stair Calculator sizes safe risers and treads. Shop machinists may also want the CNC Feeds & Speeds Calculator and the 3D Print Cost & Time Calculator.
Frequently asked questions
Why divide by cosine and not multiply?
The run is the horizontal leg and the rafter is the hypotenuse. From \cos\theta = \text{run}/L, solving for L gives L = \text{run}/\cos\theta. Cosine of an angle is less than 1, so dividing makes the sloped length longer than the run, which is correct.
What ridge thickness should I enter?
The actual thickness of the ridge board, commonly 38 mm for a 45 mm nominal timber dressed down. Each rafter run shortens by half of it. For a ridge-less pair where two rafters butt directly, enter 0.
Why does the hip rafter use 17 instead of 12?
The hip's horizontal run is the diagonal of a square whose side is the common run, so it is \sqrt{2} times longer. Against a base of 12 that diagonal is 12\sqrt{2} = 16.97, rounded to 17 on a framing square. The rise per unit stays the same, so the hip is shallower than the common rafter.
Is the ridge height the height I build to?
Not directly. The formula gives the height to the rafter's top edge line. Cutting the bird's mouth lowers the rafter by the seat depth. Set your real ridge height from a test rafter resting in its seat, then measure to the top of the ridge board.
How many rafters for a hip roof?
The count formula covers the common rafters on one straight slope. Hip roofs add jack rafters of decreasing length near each corner, which this tool does not enumerate. Use the common count as a baseline and add jacks by hand from your framing plan.