How run, span, overhang, and ridge deduction fit together
Building span is the full width the roof covers, wall to wall. Because two common rafters meet at the ridge from opposite sides, each one only spans half that width, the run, minus a small deduction for half the ridge board's thickness, since the ridge board itself takes up physical space between the two rafter ends. Overhang is separate: it is the horizontal distance the rafter continues past the wall plate to form the eave, and it is not reduced by the ridge deduction because it has nothing to do with the ridge end of the board. Line length uses the run after the ridge deduction; total length adds the overhang portion on top of that.
Line length versus total length
Line length is the sloped distance from the ridge centerline down to the point where the rafter crosses the wall plate. It is the number that matters for framing the main triangle of the roof. Total length adds the overhang tail, the part of the same board that keeps going past the wall to create the eave overhang. When you are buying lumber, total length, rounded up to the next stock board length, is what you actually order, since the overhang is cut from the same physical board as the rest of the rafter, not added on separately.
What a birdsmouth is, and why it does not change the length
A birdsmouth, sometimes called a seat cut or a heel and plumb cut, is a notch cut into the underside of the rafter at the point where it crosses the wall plate. It lets the rafter sit flush and bear its load properly on top of the wall instead of resting on a single sharp corner. The notch removes a wedge of material at that one location, but it does not shorten the rafter along its slope: the line length from ridge to plate is measured along the top edge of the board regardless of what is cut away underneath at the plate crossing. Think of the birdsmouth as where the rafter sits, not how long it is.
A worked example
Take a 24 foot building span, a 6/12 pitch, a 12 inch overhang, and a 1.5 inch ridge board. Half the span is 12 feet, or 144 inches; half the ridge thickness is 0.75 inches, so the run used for the calculation is 143.25 inches. The slope factor for a 6/12 pitch is the square root of 6 squared plus 12 squared, divided by 12, which is 1.118. Line length is 143.25 times 1.118, about 160.16 inches, or roughly 13 feet 4.2 inches. The overhang adds 12 inches times the same 1.118 slope factor, about 13.4 inches. Total rafter length comes out to roughly 173.6 inches, a little over 14 feet 5 inches, which is the number you would round up to the nearest stock board length when ordering material.
When to bring in a professional
Everything on this page is geometry: given a span, a pitch, an overhang, and a ridge thickness, how long is the board. It says nothing about whether a given piece of lumber is strong enough to span that distance under roof load, snow load, or point loads from equipment. Allowable span depends on species, grade, spacing, and the load requirements in your local building code, and that is a structural engineering question, not a geometry one. Once you know the length you need from this page, take the span and load question to a licensed professional or your local code office before you buy lumber.
This page pairs with the Roof Pitch Chart for the full standard 1/12 to 24/12 reference table, and the Roof Pitch Calculator for solving angle, slope factor, and grade from any rise, run, or angle, including the inverse direction this page's pitch input assumes.