Rafter Length Calculator
Enter your building width (or half-span), roof pitch, overhang, and ridge board thickness to get the exact rafter length you need to cut. The calculator applies the Pythagorean theorem with industry-standard slope-factor arithmetic, shows every step, and works in both metric and imperial units.
How to calculate rafter length
A common rafter spans from the ridge board at the peak to the wall plate at the eave. The core formula is a direct application of the Pythagorean theorem: rafter length = sqrt(rise squared + run squared). Because carpenters work in rise-per-12 notation, the industry rewrites this as a slope factor. The slope factor = sqrt(rise-squared + 144) divided by 12, where rise is the number of inches of vertical height per 12 inches of horizontal run. Multiply the adjusted run by this factor and you have the rafter line length. Two corrections are then applied: half the ridge board thickness is deducted from the run (because the rafter meets the ridge board, not the centre-line of the ridge), and the eave overhang is added to the run before multiplying. The result is the cut length of the rafter.
Birdsmouth cut and seat depth
The birdsmouth is the notch cut near the lower end of the rafter that lets it sit flat on the wall top plate. It has two parts: a level seat cut (horizontal) and a plumb heel cut (vertical). The seat-cut depth is the dimension measured plumb from the top edge of the rafter down to the bottom of the seat. It equals the plate width multiplied by the cosine of the roof angle. Building codes typically limit the seat depth to one-third of the rafter depth so that enough material remains above the notch for structural integrity. For example, on a 2x8 rafter (7.25 in actual depth) the maximum seat cut is about 2.4 in.
Roof pitch formats explained
Roof pitch is expressed in three equivalent ways. The most common in North America is the rise-over-12 ratio: a 6/12 pitch rises 6 inches for every 12 inches of horizontal run. The same slope can be expressed as an angle (26.57 degrees for 6/12) by taking the arctangent of rise divided by 12. It can also be expressed as a percentage (50% for 6/12), which is rise divided by run. This calculator accepts all three formats and converts between them automatically. Most building codes, blueprints, and framing square tables use the rise-in-12 format.
Hip and valley rafters
Hip and valley rafters run at 45 degrees to the building corners and must cover more ground than common rafters at the same pitch. Their length is calculated using the hip/valley slope factor: sqrt(rise-squared + 288) divided by 12. The 288 comes from sqrt(12 squared + 12 squared) squared = 288, reflecting the 45-degree plan angle. For a 6/12 pitch the hip/valley factor is approximately 1.3017, compared with 1.1180 for a common rafter. This calculator provides the hip/valley factor alongside the common slope factor so you can plan both rafter types from one result.
Common roof pitches - angle, slope factor, and typical use
| Pitch (rise/12) | Angle (deg) | Slope factor | Hip/valley factor | Typical application |
|---|---|---|---|---|
| 2/12 | 9.46 | 1.0138 | 1.2019 | Flat/low roofs (special membranes required) |
| 3/12 | 14.04 | 1.0308 | 1.2247 | Minimum for asphalt shingles |
| 4/12 | 18.43 | 1.0541 | 1.2500 | Low-slope residential |
| 5/12 | 22.62 | 1.0833 | 1.2748 | Common residential |
| 6/12 | 26.57 | 1.1180 | 1.3017 | Most common US residential pitch |
| 7/12 | 30.26 | 1.1577 | 1.3317 | Steeper residential |
| 8/12 | 33.69 | 1.2019 | 1.3634 | Cape Cod and similar styles |
| 10/12 | 39.81 | 1.3017 | 1.4289 | Steep, enhanced attic space |
| 12/12 | 45.00 | 1.4142 | 1.5000 | Equal rise and run, very steep |
Slope factor is the rafter-length multiplier per unit of run. Hip/valley factor applies to 45-degree hip corners.
Frequently asked questions
What is the formula for rafter length?
The core formula is the Pythagorean theorem: rafter length = sqrt(rise squared + run squared). In practice, carpenters use the slope factor shortcut: rafter length = (run + overhang - half ridge thickness) multiplied by the slope factor, where slope factor = sqrt(rise-in-12 squared + 144) divided by 12. This calculator applies both deductions automatically.
Why do I deduct half the ridge board thickness?
The horizontal run is measured to the centre-line of the ridge. But the rafter actually meets the face of the ridge board, not its centre. So half the ridge board thickness (typically 0.75 in for a 2x board) is deducted from the run before calculating rafter length. Omitting this deduction makes rafters slightly long, causing them to push the ridge up above the intended height.
How deep should the birdsmouth seat cut be?
The seat-cut depth should equal the bearing width of the top plate multiplied by the cosine of the roof angle. For a standard 2x4 wall (3.5 in plate width) at a 6/12 pitch (26.57 degrees), the seat depth is about 3.13 in. Building codes generally cap the seat depth at one-third of the rafter depth to preserve structural strength above the notch.
What pitch is best for a house roof?
6/12 is the most common residential pitch in North America. It sheds water well, allows standard asphalt shingles, provides usable attic space, and is straightforward to frame. Pitches below 3/12 need special low-slope roofing materials. Pitches above 9/12 are considered steep and add cost for material and labour.
How do I convert roof pitch to degrees?
Take the arctangent of the rise divided by 12. For a 6/12 pitch: atan(6/12) = atan(0.5) = 26.57 degrees. For a 4/12 pitch: atan(4/12) = atan(0.333) = 18.43 degrees. This calculator shows the angle automatically for any pitch format you choose.
What is the slope factor and how do I use it?
The slope factor is the number you multiply by the run to get the rafter line length. It accounts for the extra length the rafter must travel because it rises at an angle rather than running flat. For a 6/12 pitch the slope factor is 1.1180, meaning every foot of horizontal run requires 1.1180 feet of rafter. It is also printed in standard framing square rafter tables.