Rafter Length Calculator

Rafter lengths span the distance between the peak of a roof and the outside edge of the walls. Rafters or trusses are the framing members that support roof deck sheathing and ultimately, shingles and other roofing products. They may have tails–extensions past the exterior walls–to provide roof overhangs.

Why Rafter Length is Important

Knowing rafter length provides builders with valuable information needed to construct house roofs that meet building codes and provide a safe structure.

  • Length. Length of wood required to reach from roof peak to exterior wall–plus the length of tail.
  • Size. Dimensions of lumber required to meet building code and span tables.
  • Span. The unsupported distance between ridge and wall.
  • Spacing. Smaller-sized lumber can be used if spaced closer together.
  • Snow Load. Areas that experience heavy snowfall require heavier rafter lumber.

Maximum Allowable Spans

For instance: If the distance between the peak and the outside wall is 20’ and the roof has a 6/12 pitch, the table above says the roof requires 2 x 10 rafters spaced 16” O.C. (on center).

None of the dimensional lumber listed will span 20’ if spaced 24” on center. Laminated Veneer Lumber (LVL) or Trus Joist I-Joists (TJI) can be engineered to the required load-bearing size to accommodate that distance at that spacing.

More detailed span tables differentiate between wood species. Harder woods like hemlock/fir will span greater distances than softer woods like pine.

Span tables are also available for areas that get significant snowfall. Rafter spans must be able to hold up under the weight.

Truss Slopes

Truss Slopes

Truss slopes are calculated in the same way as rafter slopes. Most trusses are manufactured of a 2 x 4 web gang-nailed together for strength and support. The rafter portion of a truss supports more weight than non-braced dimensional lumber because of the engineering.

Calculating Rafter Length

Rafter length–also known as roof pitch or slope–can be calculated in a number of ways. Regardless of the method used the length of a rafter is the hypotenuse of a 90-degree right angle triangle.

Using the Pythagorean Theorem.

run squared + rise squared = hypotenuse squared (rafter length)

  • Run. Distance from outside of the exterior wall to a point directly below the peak of the roof–measured horizontally.
  • Rise. Distance from the top of the walls to the peak of the roof.
  • Hypotenuse. Distance from the roof peak to the exterior wall of the building.

Rafter Length Calculator – based on roof rise

Enter the rise and run of the roof to calculate the rafter length:


For calculations based on the roof rise:

rise² + run² = rafter length²

rafter length = √(rise² + run²).


Use a Scientific Calculator to Find the Hypotenuse

Once the run and rise measurements have been taken, they can be plugged into a scientific calculator to find rafter length. The following short YouTube video gives excellent directions.

The illustration above shows a roof with an overhang. To get the full rafter length the run has to include the overhang distance. Measure horizontally from the exterior wall to the center of the wall. Add the preferred size of the overhang to the wall run distance. Standard overhang sizes are 12”, 16”, 18”, and 24 “. Designers, architects, and homeowners can specify many other sizes for personal or environmental reasons.

Measure from the top of the wall to the ridge board for the rise. Plug the numbers into a scientific calculator following the YouTube directions above. Include finding the square root. The answer will be as accurate as the information inputted into the machine. If the run is 12’ 3 ⅜” and the rise is 5’ 9 ½” use those numbers to get the exact rafter length.

Number and Size of Rafters Required

Knowing the rafter length enables a contractor or DIY builder to order the type and quantity of lumber required to construct a roof. Comparing the length to the span table above will provide:

  • Lumber Size. It is not necessarily the best practice to buy smaller lumber that just meets span code requirements. Using the next bigger size makes for a stronger roof structure–especially in heavy snow load locations.
  • Spacing. Most roof rafters are spaced at 24” on center if possible to reduce costs. 12” and 16” on center are used for more strength or to meet code because of the unsupported lengths involved.
  • Number of Rafters. Once the lumber size and spacing are determined, it is a simple mathematical exercise to measure the length of the building and divide by the spacing distance to get the number of rafters required. Multiply by two for both sides of the roof.

Rafter span tables do not include the length that extends outside the walls. The table only uses the unsupported distance between the ridge board and the wall. When ordering rafters make sure to add the overhang length. Because of the angle, the extra length will be longer than the horizontal distance of the overhang. Ordering an extra 24” of rafter will not result in a two-foot overhang.