Why a hip rafter runs on the diagonal, not the 12
A common rafter runs in a straight line from the wall plate to the ridge, covering a horizontal distance you can measure directly along one wall. A hip rafter is different: it sits at the corner where two roof planes meet, and in plan view it runs at 45 degrees across that corner, along the diagonal of the square formed by the two walls' runs. For every 12 units of run each wall covers, the diagonal across that 12 by 12 square is the square root of 12 squared plus 12 squared, which comes out to about 16.9706, the number framers round to 17. A hip rafter's horizontal run is always longer than a common rafter's run for the same building, because it is covering the diagonal of a square instead of one side of it.
Where the 17 actually comes from
This is ordinary Pythagorean geometry, not a framing convention pulled from a table. Picture the building corner from above: one wall's run extends 12 units in one direction, the other wall's run extends 12 units perpendicular to it, and the hip rafter's horizontal projection is the straight line connecting the far ends of those two runs, the hypotenuse of a right triangle with two 12 unit legs. That hypotenuse is the square root of 288, about 16.9706. Every hip and valley length calculation on a regular, equal-pitch roof starts from this single fact: the hip's horizontal run is roughly 1.4142 times a common rafter's run for the same building, not the same 12 a common rafter uses.
Hip versus valley: location, not length
A hip rafter sits at an outside corner of the roof, where two sloped planes meet and lean away from each other, shedding water down and away on both sides. A valley rafter sits at an inside corner, typically where an addition or a wing meets the main roof, where two sloped planes meet and lean toward each other, forming a channel that collects and sheds water off both sections into one line. The role and the water management are different, but for a regular, equal-pitch intersection the rafter length geometry is identical in both cases: same diagonal run, same slope factor, same length formula. This calculator uses one set of math for both and simply changes the label depending on which one you select.
How overhang works on the diagonal
The overhang portion of a hip rafter follows the same diagonal relationship as the main run. A horizontal overhang projection, the same measurement you would use for a common rafter's overhang, becomes that value times the square root of 2 when expressed as diagonal run for the hip, then gets the hip's own slope factor applied, since the overhang is simply the same straight board continuing past the wall plate at the same slope. This calculator computes that diagonal overhang length separately and adds it to the main hip line length for the total.
Worked example
Take a 24 foot building span, giving a 12 foot common run on each side, at a 6/12 pitch. The shared rise is 12 times 6 divided by 12, which is 6 feet. The hip's diagonal run is 12 times the square root of 2, about 16.9706 feet. The hip line length is the square root of 16.9706 squared plus 6 squared, which is the square root of 288 plus 36, or the square root of 324, exactly 18.000 feet. Compare that to a common rafter over the same 12 foot run at the same pitch, which comes out to only 13.416 feet: the hip rafter is noticeably longer, about 34 percent more, purely because it runs the diagonal instead of the straight run. That gap is the entire reason a hip rafter needs its own calculation instead of reusing the common rafter's numbers.
When to bring in a professional
This calculator gives geometric length only. It does not determine bevel angles, backing angles, or how the hip meets the ridge board and jack rafters, all of which are practical carpentry decisions best confirmed with a test cut before committing full-length stock. It also says nothing about whether the resulting rafter, at whatever length, is strong enough for your span and load. For cut angles, framing details, and any question of allowable span or lumber sizing, work with a licensed professional and your local building code. For the common rafter this hip pairs with, see the Rafter Length Calculator, and for the pitch and slope factor inputs this page needs, see the Roof Pitch Chart.