A common rafter is a sloping roof beam that runs from the wall plate to the ridge. Its length is not the same as the horizontal run, because it climbs as it goes. This rafter length calculator finds the true length from the run and the pitch, adds the overhang, takes off the thickness of the ridge board, and gives you the rise, the roof angle, the plumb-cut angle and the number of rafters for a building of a given length.
How to use the rafter length calculator
- Enter the run. This is the horizontal distance from the outer face of the wall (where the rafter bears) to the center of the ridge — half the span for a symmetrical roof.
- Enter the pitch, written as rise per 12 inches of run.
- Add the overhang as a horizontal distance, and the ridge board thickness.
- For a rafter count, enter the building length and spacing.
Rafter length formula
Rafter length = (run + overhang) × pitch factor − (ridge thickness ÷ 2) × pitch factor
Total rise = run × rise ÷ 12
Roof angle = arctan(rise ÷ 12)
This is the Pythagorean theorem in disguise: for each 12 inches of run the rafter climbs by the pitch in inches, so its length per 12 inches of run is √(12² + rise²) ÷ 12, which is the pitch factor. Allowing for the ridge board shortens the rafter by half the board’s thickness measured along the slope.
Worked example: 12 ft run, 6/12 pitch, 12 in overhang, 1½ in ridge
- Pitch factor: √(1 + 0.5²) = 1.1180.
- Rafter along the run: 12 × 1.1180 = 13.416 ft; rise = 6.0 ft.
- Overhang along the slope: 1 ft × 1.1180 = 1.118 ft.
- Ridge deduction: 0.75 in × 1.1180 ÷ 12 = 0.070 ft.
- Cut length: 13.416 + 1.118 − 0.070 = 14.465 ft, about 14 ft 5 9/16 in.
- Roof angle: arctan(0.5) = 26.57°; plumb cut 63.43°.
Pitch factors for a 12 ft run
| Pitch | Angle | Pitch factor | Total rise (ft) | Rafter along run (ft) |
|---|---|---|---|---|
| 3/12 | 14.04° | 1.0308 | 3.00 | 12.37 |
| 4/12 | 18.43° | 1.0541 | 4.00 | 12.65 |
| 5/12 | 22.62° | 1.0833 | 5.00 | 13.00 |
| 6/12 | 26.57° | 1.1180 | 6.00 | 13.42 |
| 7/12 | 30.26° | 1.1577 | 7.00 | 13.89 |
| 8/12 | 33.69° | 1.2019 | 8.00 | 14.42 |
| 9/12 | 36.87° | 1.2500 | 9.00 | 15.00 |
| 10/12 | 39.81° | 1.3017 | 10.00 | 15.62 |
| 12/12 | 45.00° | 1.4142 | 12.00 | 16.97 |
Using the number
- Rafter spacing. The count formula uses ⌊ building length ÷ spacing ⌋ + 1 rafters per side. Spacing of 16 or 24 inches on center is typical.
- Stock length. Lumber comes in 2-foot increments, so a 14.46 ft rafter needs a 16 ft board. Cut the longest pieces from the best stock.
- Size and span. The size of rafter (2×6, 2×8, etc.) comes from the span tables in your code, based on species, spacing and snow loads.
- Collar ties and ceiling joists. These resist the outward thrust of the roof; their sizes and positions are set by code.
Layout tips
Make one rafter first and test it on the building before cutting the rest. Mark the plumb cut at the ridge, the birdsmouth seat cut at the plate and the tail cut at the overhang. A framing square or a speed square marked with the pitch gives the lines directly. If the walls are out of level or the building is out of square, adjust.
See also the Roof Pitch Calculator for conversions between pitch, angle and percent, the Roof Sheathing Calculator for the deck, the Roofing Calculator for coverings and the Wall Framing Calculator for wall studs and joists.
Frequently asked questions
How do I calculate rafter length?
Multiply the run (the horizontal distance from the outside of the wall to the center of the ridge) by the pitch factor √(1 + (rise ÷ 12)²). For a 12 ft run at 6/12: 12 × 1.118 = 13.42 ft. Then add the overhang along the slope and subtract half the ridge board thickness along the slope.
What is the run of a rafter?
The horizontal projection: half the building span for a symmetrical gable roof. For a 24 ft wide building the run is 12 ft, measured from the outside of the wall to the centerline of the ridge.
Why subtract for the ridge board?
The rafter ends against the side of the ridge board, not its center line, so it is shorter by half the board’s thickness measured along the slope. For a 1½ in ridge at 6/12 this is 0.84 in.
What is the plumb cut?
The angle cut at the ridge end of the rafter so it sits flat against the ridge board. It is cut at 90° minus the roof angle measured from the rafter edge, for example 63.43° at 6/12.
Does this include the birdsmouth?
No. The birdsmouth notch is cut at the wall plate and does not change the overall length, but it must not remove more than about a third of the rafter depth. Structural spans and sizes come from code tables or an engineer.