Want a Custom tool for Yourself?

Need a Custom Tool? We build custom tools that can save hours per employee per day.

Rafter Length Calculator

Find rafter length from roof pitch, building width, overhang, and beam thickness. Get a clear rafter length in feet and inches for cuts.

Enter the Details





Result will appear here...


Last updated: March 10, 2026

Created by: Eon Tools Dev Team

Reviewed by: Mahendra Thapaliya



What the rafter length calculator does

A rafter is the sloped beam that carries the roof, and to cut one you need its length along the slope, not just the width of the building. This works that out. You give it the building width, the overhang, the thickness of the ridge beam, and the roof pitch, and it returns the rafter length in feet and inches, ready to mark and cut.

It saves you laying out the triangle by hand on every rafter. Below is how it gets there and what the result is telling you.

How to use it

  1. Enter the building width. The full span the roof crosses, with its unit.
  2. Enter the overhang. How far the rafter runs past the wall to form the eave.
  3. Enter the beam thickness. The width of the ridge beam at the peak, which the rafter butts against.
  4. Pick the roof pitch from the list, then press Calculate, or Reset to clear it.

How the rafter length is worked out

A rafter is the long side of a right triangle whose base is the horizontal run and whose height is the rise. First the calculator works out that run: it takes half the building width, adds the overhang, and trims half the ridge beam thickness, since the rafter stops at the centre of the ridge.

Then it turns the run into the sloped length using the pitch:

Rafter length = run ÷ cosine of the roof angle

That is the same as the Pythagorean theorem on the rise and run, and the result is the true length of the rafter from the ridge out to the end of the overhang.

Reading the result

The main figure is the rafter length, given in feet and inches down to a sixteenth, which is what you measure and cut to. Alongside it are the roof angle in degrees, useful for setting a saw, and the slope factor.

The slope factor is worth knowing: it is the number the run is multiplied by to get the sloped length, and it grows with the pitch. At a 6 in 12 it is about 1.118, so every foot of run becomes 1.118 feet of rafter. The result also notes a hip and valley factor, since those rafters run diagonally across the roof and are longer again than a common rafter, which the last section gets into.

A worked example: a 24 ft building

Say the building is 24 feet wide, with a 12 inch overhang, a ridge beam 1.5 inches thick, and a 6 in 12 pitch.

Half the width is 12 feet, plus the 1 foot overhang, less three quarters of an inch for half the ridge, gives a run of about 155 inches. At a 6:12 pitch the slope factor is 1.118, so the rafter length is 155 × 1.118, which is about 14 feet 6 inches. The roof angle works out to about 26.6 degrees.

So each common rafter is cut at roughly 14 feet 6 inches, set to a 26.6 degree slope.

Common rafters, hips, and valleys

The length here is for a common rafter, the straight run from ridge to eave that makes up most of a roof. Two other kinds run at an angle. A hip rafter forms the outside corner where two roof slopes meet, and a valley rafter forms the inside corner where they fold together.

Because hips and valleys run diagonally across the plan rather than straight, they cover more horizontal distance for the same span, so they come out longer than a common rafter at the same pitch. How much longer depends on the pitch, so for those pieces it is worth measuring carefully or stepping them out, rather than cutting them to the common rafter length.

Questions people ask

How long does a rafter need to be?

It depends on the span, the overhang, and the pitch. For a 24 foot building at a 6:12 pitch with a 12 inch overhang, each common rafter is about 14 feet 6 inches along the slope.

What is the slope factor?

It is the number you multiply the horizontal run by to get the sloped rafter length. It rises with the pitch, and at a 6:12 it is about 1.118.

Does the overhang add to the rafter length?

Yes. The overhang is part of the run, so a longer eave means a longer rafter. The calculator adds it before working out the slope.

Are hip and valley rafters longer than common rafters?

Yes. They run diagonally across the roof, so they cover more distance and come out longer at the same pitch. Measure those separately rather than using the common length.

References

A quick note on the numbers. The rafter length is pure geometry, the run divided by the cosine of the roof angle, which is the Pythagorean theorem on rise and run. Roof framing practice, including ridge and rafter layout, follows the framing provisions of the International Residential Code. The unit conversions follow the US National Institute of Standards and Technology guide.

  1. International Code Council, International Residential Code, Chapter R802 (roof and ceiling framing). https://codes.iccsafe.org
  2. National Institute of Standards and Technology (NIST), Special Publication 811, Guide for the Use of the International System of Units (SI). https://www.nist.gov/pml/special-publication-811


Mahendra Thapaliya

Mahendra Thapaliya is a graduate student in Structural Engineering at the University of Bologna, with research interests in structural systems, FEM, earthquake engineering, and numerical modeling. At Eon Tools, he reviews construction tools.