Common rafters all come off one pattern, so the job is to get that pattern right: the line length from ridge to wall, the plumb cut at the top, the birdsmouth that seats on the plate and the tail. A 6/12 roof on a 24 ft building with a 1-1/2" ridge works out to 13' 4-3/16" of rafter line at 26.57°, and the whole rafter including a 12" overhang comes out of a 16 ft board.
Rafter length from pitch and run
Pitch is rise per 12" of run. The rafter is the hypotenuse, so every foot of run needs √(144 + pitch²) inches of rafter: 13.42" at 6/12, 15.62" at 10/12. On a gable the run is half the building span, less half the ridge board thickness measured level.
line length = run × √(1 + (pitch ÷ 12)²) run (gable) = span ÷ 2 − ridge ÷ 2 tail = overhang × the same factor
Plumb and seat cuts
Hold the framing square with 12 on the body and the pitch on the tongue, both on the rafter’s top edge: the tongue gives the plumb cut and the body the level (seat) cut. On a speed square, pivot on the pitch number on the COMMON scale.
The birdsmouth
The birdsmouth is a seat cut that bears on the wall plate and a heel cut that drops plumb from it. Bear at least 1-1/2" on the plate. Keep the notch shallow: measured square to the rafter edge it should not exceed one quarter of the rafter depth, so at least three quarters of the depth stays intact above it (IRC R802.7.1 limits end notches in sawn rafters to 1/4 of the depth).
The height above plate (HAP) is the plumb distance from the top of the plate to the top edge of the rafter at the heel line. It is the same on every rafter, and it sets the ridge height: on the example roof the HAP is 6-3/8".
heel = seat × pitch ÷ 12 notch = seat × sin θ ≤ depth ÷ 4 HAP = depth ÷ cos θ − heel
What this calculator does not do
It lays out rafters; it does not size them. Rafter size and spacing for your snow load, dead load and span come from the IRC rafter span tables (R802.4) or an engineer. Ceiling joists or rafter ties are also needed to stop the walls spreading on most gable roofs.