Every Single CalculatorOne place for every calculator
⌂Roofing

Rafter length calculator

Enter the width of the building and the roof pitch to get the length of each common rafter, the cut angles, the board to buy and how many rafters you need.

Example: You are framing a garage roof and need to cut the first rafter as a pattern. You know the span and the pitch and want the length, the cut angles and how many boards to order.

Your building

Span is the full width of the building, outside of wall to outside of wall. Only span and pitch are required.

ft
/12
Not sure? Use the roof pitch calculator.
in
Measured level, from the wall out to the rafter tip.
in
Standard 2x lumber is 1.5 inches thick. Enter 0 for no ridge board.
ft
Optional. Used to count rafters.
in
Usually 16 or 24 inches on center.
  • Total rafter length0
  • Ridge to wall0
  • Overhang tail0
  • Roof rise0
  • Plumb cut angle0
  • Seat cut angle0
  • Board to buy0
  • Rafters needed0

Rafter length calculator. Estimate from everysinglecalculator.com

Materials list
ItemBuyHow it was worked out

Ridge Rake Eave Overhang Span (width) Run Rise Length
The run is half the span. Rakes are the sloped edges at the gable ends, and eaves are the level edges where gutters go.

How rafter length is worked out

A common rafter is the long side of a right triangle. The level side is the run, which is half the building span less half the ridge board. The upright side is the rise. The pitch tells you how the two relate.

Run = (span − ridge thickness) ÷ 2

Rafter length = run × √(1 + (pitch ÷ 12)²)

The overhang is worked out the same way and added on. A 12 inch overhang measured level is longer along the slope of the rafter, because the tail runs at the same angle as the rest of the roof.

A worked example

A building 30 feet wide with a 6/12 roof and a 1.5 inch ridge board has a run of 179.25 inches. Multiply by 1.118 and the rafter measures 16 feet 8⅜ inches from the ridge to the outside of the wall. A 12 inch overhang adds 1 foot 1⅜ inches along the slope, for a total of 17 feet 9⅞ inches. That comes out of an 18 foot board.

The ridge sits 7 feet 5⅝ inches above the top of the walls. On a building 40 feet long with rafters every 16 inches, you need 31 on each side, or 62 in all.

The cut angles

The plumb cut is the cut at the top of the rafter where it meets the ridge, and again at the tail if you want a vertical fascia. Its angle is the same as the roof angle, so a 6/12 roof gets a 26.6 degree cut. On a speed square, you can skip the degrees and line up the number 6 on the common scale.

The seat cut is the level part of the birdsmouth, the notch where the rafter sits on the wall. It is always 90 degrees minus the plumb cut.

Before you cut

  • Cut one rafter, test it in place, and use it as the pattern for the rest.
  • Measurements here run along the top edge of the rafter. The birdsmouth depth depends on your lumber size and is not included.
  • This calculator gives length, not strength. Whether you need 2x6, 2x8 or larger depends on span, spacing, snow load and wood species. Use the span tables in your local building code or ask your building department.

Common questions

Does the rafter length include the overhang?

The total does. The ridge to wall figure does not, which is useful for marking where the birdsmouth goes.

Why subtract the ridge board?

The two rafters meet the ridge board from either side, so each one stops short of the center line by half the board's thickness. Leaving this out makes each rafter about three quarters of an inch too long with standard lumber.

What if my rafter is longer than 24 feet?

Lumber yards rarely stock dimensional lumber past 24 feet. Longer spans usually call for engineered rafters or trusses, which a supplier or engineer should size for you.

Does this work for hip or valley rafters?

No. Hip and valley rafters run diagonally and are longer than common rafters at the same pitch. This calculator covers common rafters on a gable roof.

How we know this calculator is right

Every time the site is rebuilt, this calculator is run against answers worked out separately from its code. It is not published unless all of them match.

  • A 30 foot span at 6/12 with a 1½ inch ridge board gives a rafter of 16 ft 8⅜ in, and 17 ft 9⅞ in with a 12 inch overhang.
  • A 24 foot span at 9/12 with no ridge board gives exactly 15 ft 0 in, because run 12, rise 9 and rafter 15 make a 3-4-5 triangle.
  • Rise, run and rafter length are checked against the Pythagorean theorem.
  • A flat roof with a 20 foot span gives 10 ft 0 in, which is simply half the span.
  • A 12/12 pitch gives a 45° plumb cut.

What this proves: the calculator does the arithmetic of the formulas shown, correctly. What it cannot prove: your measurements, or figures such as waste and coverage, which are typical starting values you can change. Go by the product label and your local code.

Used by: roofers, framers and carpenters, solar installers.