Rafter Length Calculator
Enter the span of the building, the roof pitch and the overhang to find the length of a common rafter, the rise and the roof angle. Add the building length to count the rafters.
How to use this rafter length calculator
- Enter the span of the building, from the outside of one bearing wall to the outside of the other.
- Enter the roof pitch as the rise in inches for every 12 inches of run. A pitch of 6 is written 6 in 12.
- Enter the overhang measured horizontally, and the thickness of the ridge board if you want it deducted.
- Add the building length and the rafter spacing if you want the rafters counted.
- Press Calculate. Use Copy result to keep the numbers for your cut list.
How to calculate rafter length
A common rafter is the hypotenuse of a right triangle made by the run and the rise.
- Run = span / 2 – half the ridge board thickness
- Rise = run x pitch / 12
- Slope factor = the square root of (1 + (pitch / 12) squared)
- Rafter length = run x slope factor, plus overhang x slope factor
- Roof angle = arctan (pitch / 12)
- Rafters per side = building length (in) / spacing, rounded down, plus 1
Worked example
A building has a span of 24 ft, a roof pitch of 6 in 12 and a 12 inch overhang. The run is 12 ft and the rise is 12 x 6 / 12 = 6 ft. The slope factor is the square root of 1.25, which is 1.118. The rafter to the ridge is 12 x 1.118 = 13.42 ft, and the overhang adds 1 x 1.118 = 1.12 ft. The total is 14.53 ft, or 14 ft 6.4 in. The roof angle is 26.57 degrees. For a building 30 ft long with rafters 16 inches on center, each side has 360 / 16 = 22.5, rounded down to 22, plus 1 gives 23 rafters, or 46 in all.
Assumptions & limits
- The roof is a simple gable with equal slopes and a level ridge. Hip roofs, valleys and dormers have different rafter lengths.
- The length is measured along the top edge of the rafter from the ridge to the tail. It does not subtract the birdsmouth or include the plumb cut at the tail.
- The span is measured to the outside of the bearing walls, and the overhang is the horizontal distance beyond that point.
- The number of rafters counts one rafter at each end and spacing in between. It does not include collar ties or rafter pairs at the gable ends beyond that.
- Rafter size, spacing and spans must come from your code tables or an engineer.
Frequently asked questions
How do I calculate the length of a rafter?
Find the run, which is half the span, multiply it by the slope factor, and add the overhang times the slope factor. The slope factor is the square root of 1 plus the pitch over 12, squared.
What is the run of a rafter?
The run is the horizontal distance from the outside of the wall to the center line of the ridge. For a gable roof it is half the span.
What does a 6 in 12 pitch mean?
The roof rises 6 inches for every 12 inches of horizontal run. The angle is about 26.57 degrees.
Does the length include the overhang?
Yes. The calculator shows the length with the overhang and the length to the bearing point.
Why subtract half the ridge board?
Rafters meet the sides of the ridge board, not its center line, so the run is shortened by half of its thickness.
Can I use this for a hip roof?
No. Hip and valley rafters are longer because they run along the diagonal, so they need a different calculation.
Related calculators
Related articles
Last updated: November 2026