A rafter calculator works out the common rafter length for a gable roof from just the building span and the pitch — then adds the overhang, the plumb-cut angle and how many rafters you'll need for the whole roof. It saves stepping off rafters or wrestling with the rafter tables on a framing square.
Enter the span (the full width the rafters cross), the pitch, your overhang and the building length, and it returns everything to lay out and order the framing.
Run = span ÷ 2. Slope factor = √(pitch² + 12²) ÷ 12. Line length = run × slope factor; the overhang adds its run × slope factor. The plumb-cut angle = arctan(pitch ÷ 12). Rafter count = (building length ÷ spacing + 1), doubled for both roof slopes.
A 24 ft span at 6/12 with a 12 in overhang gives a common rafter about 14.5 ft long (13.4 ft to the ridge), a 26.6° plumb cut, and 62 rafters for a 40 ft-long building at 16 in OC.