Skip to contentSkip to calculator
Free · Instant · US units

Rafter Length Calculator

Rafter length, lumber to buy and plumb cut angle.

Rafter length is the run times the pitch multiplier, plus the overhang. At 6/12 the multiplier is 1.118, so a 12 ft run gives 13.42 ft.

Reviewed by Shashikant YadavUpdated How we calculate1 sources

Units
Roof type
ft

Outside of wall to outside of wall

26.6° roof angle

in

How far the roof sticks out past the wall, measured level

More options
in
in
ft
  • 13′ 4 1/8″ to the wall + 1′ 1 3/8″ overhang tail
  • Speed square: pivot on the top edge and line up 6 on the COMMON scale.
  • Hip or valley rafter: 1.5 × the run
  • This gives the length only. Lumber size and spacing must come from span tables or local code.

Estimates only. Confirm sizes, grades and prices with your lumberyard.

Show the math
  1. Run24.0000 ft ÷ 2 − 0.0625 ft = 11.9375 ft
  2. Length(11.9375 ft × 1.1180) + 1.1180 ft = 14.4646 ft
  3. Cut anglesatan(6/12) = 26.6°; 90° − 26.6° = 63.4°

Add this calculator to your website

On this page(10)
  1. 1How to use the rafter length calculator
  2. 2Span, run and rise
  3. 3How to calculate rafter length
  4. 4Worked examples
  5. 5Rafter length per foot of run by pitch
  6. 6Rafter length table for gable roofs
  7. 7Lean-to and shed rafter lengths
  8. 8Plumb cut, seat cut and the birdsmouth
  9. 9Which lumber length to buy
  10. 10Special cases

Use this rafter length calculator to find how long to cut each common rafter for a gable or shed roof, and which board length to buy. Enter the building width, the roof pitch and the eaves overhang. It shows the rafter length to the nearest ⅛ inch, the stock length to order, the plumb and seat cut angles, the ridge height and, if you give the wall length, how many rafters you need.

How to use the rafter length calculator

  1. Pick the roof type. Gable has two slopes meeting at a ridge. Shed (one slope) covers lean-to roofs, sheds and porch roofs that slope one way.
  2. Enter the building width (span). Measure from the outside of one wall to the outside of the other. For a shed roof this is the distance from the low wall to the high wall.
  3. Set the roof pitch. Type the rise in inches per 12 inches of run (6 for a 6/12 roof), or switch the unit to degrees. If you only know the rise and the width, the roof pitch calculator works out the pitch first.
  4. Enter the eaves overhang. Measure it level, from the outside of the wall to where the rafter tail ends. Enter 0 for no overhang.
  5. Open More options if you need them. Ridge board thickness defaults to 1½ in, the thickness of a 2× board. A shed roof has High-side overhang in its place. Extra for trimming (2 in by default) is added before the calculator picks a board length. Add Wall length and Rafter spacing to get a rafter count, and tick Overhang measured along the rafter if you measured the tail on the slope.

Results update as you type. Rafter length is the full cut length from the ridge face to the tail. Lumber to buy is the shortest standard board that fits. The notes split the length into the part over the building and the overhang tail. Show the math walks through each step with your numbers, and Print shopping list puts the lengths, angles and count on one page for the lumberyard. Metric works too: span in meters, overhang and ridge in millimeters, and board lengths from 2.4 m to 7.2 m in 0.3 m steps.

Span, run and rise

Mixing these up is the quickest way to cut every rafter wrong.

  • Span is the full width of the building, wall to wall. It is the number you measure.
  • Run is the level distance one rafter covers. On a gable roof it is half the span, less half the ridge board. On a shed roof it is the whole span.
  • Rise is how far the roof climbs over that run. A 6/12 pitch rises 6 inches for every 12 inches of run, so a 12 ft run rises 6 ft.

The rafter is the sloped side of the triangle that run and rise make. It is always longer than the run, and the steeper the pitch, the bigger the gap.

Why the ridge board comes off

Rafters on a gable roof don’t meet each other. They each stop against one face of the ridge board, so each run is shorter by half the ridge thickness. With a 1½ in ridge board that is ¾ in of run per side. On a 24 ft span at 6/12 with a 12 in overhang, the rafter comes out at 14′ 6⅜″ without the deduction and 14′ 5⅝″ with it. Skip it and every rafter runs ¾ in too far, so the rafters won’t seat properly against the ridge. A doubled ridge or a ridge beam is thicker, so enter its real thickness.

Gable framing: a 24 ft span, 1½ in ridge board and 12 in overhang at 6/12 give a 14′ 5⅝″ rafter.

How to calculate rafter length

The calculator finds the run, scales it by the pitch multiplier, then adds the tail.

Multiplier = √(1 + (pitch ÷ 12)²)


Run (gable) = span ÷ 2 − ridge thickness ÷ 2


Run (shed) = span


Rafter length = run × multiplier + overhang × multiplier


Plumb cut = arctan(pitch ÷ 12); seat cut = 90° − plumb cut

All lengths in feet. Ridge board and overhang in inches ÷ 12 = feet.

If you already know the rise, √(rise² + run²) gives the same main length. The multiplier is quicker because it only needs the pitch. The step-by-step layout with a framing square, stepping off and marking the birdsmouth is in our guide to calculating rafter length.

Worked examples

Example 1: a 24 ft garage at 6/12

A two-car garage 24 ft wide and 40 ft long, 6/12 pitch, 1½ in ridge board, 12 in overhang, rafters 16 in on center.

  • Run: 24 ÷ 2 − 0.0625 = 11.9375 ft
  • Multiplier at 6/12: 1.118
  • Main length: 11.9375 × 1.118 = 13′ 4⅛″ from the ridge face to the outside of the wall
  • Tail: 1 ft × 1.118 = 1′ 1⅜″
  • Rafter length: 14′ 5⅝″
  • Ridge height above the wall plate: 5′ 11⅝″
  • Cuts: plumb 26.6°, seat 63.4°
  • Rafters needed: 40 ft at 16 in on center is 31 per side, so 62 rafters

With 2 in added for trimming, each rafter needs 14′ 7⅝″ of board. A 14 ft board is too short, so you order 62 boards 16 ft long, and each one leaves an offcut of about 1½ ft.

Example 2: a lean-to shed at 3/12

A shed roof 10 ft from the low wall to the high wall, 3/12 pitch, 12 in overhang at the low side, 12 ft long, rafters 24 in on center.

  • Run: the whole span, 10 ft
  • Multiplier at 3/12: 1.031
  • Rafter length: 11′ 4″, which is 10′ 3¾″ over the building plus a 1′ ⅜″ tail
  • Rise from the low wall to the high wall: 2′ 6″
  • Cuts: plumb 14.0°, seat 76.0°
  • Rafters needed: 7

Order 7 boards 12 ft long. Watch the high side, though. Add a 6 in overhang there and the rafter grows to 11′ 10¼″. With the 2 in trimming allowance that no longer fits a 12 ft board, so you need 14 ft boards. Decide on both overhangs before you order.

Rafter length per foot of run by pitch

Each foot of level run needs this much rafter. Multiply the run in feet by the multiplier to get the main length. The plumb and seat angles are the saw or square settings for each pitch.

Rafter multiplier and cut angles by pitch
PitchMultiplierRafter per foot of runPlumb cutSeat cut
2/121.01412.17″9.5°80.5°
3/121.03112.37″14.0°76.0°
4/121.05412.65″18.4°71.6°
5/121.08313.00″22.6°67.4°
6/121.11813.42″26.6°63.4°
7/121.15813.89″30.3°59.7°
8/121.20214.42″33.7°56.3°
9/121.25015.00″36.9°53.1°
10/121.30215.62″39.8°50.2°
12/121.41416.97″45.0°45.0°

For hip and valley rafters on a roof where both slopes share the pitch, the calculator also shows a hip or valley factor (1.5 × the run at 6/12). For the full set of pitches up to 24/12, see the chart in the roof pitch calculator.

Rafter length table for gable roofs

Each cell shows the rafter length and the board to buy. All rows assume a 1½ in ridge board, a 12 in level overhang and 2 in for trimming. Change any of these and the numbers move, so use the calculator for your own roof.

Gable rafter length / board to buy, by span and pitch
Span4/126/128/1210/1212/12
12 ft7′ 3 3/4″ / 8 ft7′ 9 1/8″ / 8 ft8′ 4″ / 10 ft9′ 3/8″ / 10 ft9′ 9 3/4″ / 10 ft
16 ft9′ 5″ / 10 ft9′ 11 7/8″ / 12 ft10′ 8 7/8″ / 12 ft11′ 7 5/8″ / 12 ft12′ 7 5/8″ / 14 ft
20 ft11′ 6 3/8″ / 12 ft12′ 2 3/4″ / 14 ft13′ 1 3/4″ / 14 ft14′ 2 7/8″ / 16 ft15′ 5 5/8″ / 16 ft
24 ft13′ 7 5/8″ / 14 ft14′ 5 5/8″ / 16 ft15′ 6 5/8″ / 16 ft16′ 10 1/8″ / 18 ft18′ 3 1/2″ / 20 ft
28 ft15′ 9″ / 16 ft16′ 8 3/8″ / 18 ft17′ 11 3/8″ / 20 ft19′ 5 3/8″ / 20 ft21′ 1 1/2″ / 22 ft
32 ft17′ 10 1/4″ / 20 ft18′ 11 1/4″ / 20 ft20′ 4 1/4″ / 22 ft22′ 5/8″ / 24 ft23′ 11 1/2″ / Over 24 ft

Boards longer than 20 ft are often special order, so ask your lumberyard before you plan around them. Past 24 ft the calculator says no standard board fits. At that point people usually switch to engineered lumber or trusses.

Lean-to and shed rafter lengths

Shed rafters run the full width of the building, so they get long quickly. These rows assume a 12 in overhang at both the low and the high side, plus 2 in for trimming.

Shed rafter length / board to buy, by width and pitch
Width2/123/124/12
8 ft10′ 1 5/8″ / 12 ft10′ 3 3/4″ / 12 ft10′ 6 1/2″ / 12 ft
10 ft12′ 2″ / 14 ft12′ 4 3/8″ / 14 ft12′ 7 3/4″ / 14 ft
12 ft14′ 2 3/8″ / 16 ft14′ 5 1/8″ / 16 ft14′ 9 1/8″ / 16 ft
14 ft16′ 2 5/8″ / 18 ft16′ 5 7/8″ / 18 ft16′ 10 3/8″ / 18 ft
16 ft18′ 3″ / 20 ft18′ 6 5/8″ / 20 ft18′ 11 5/8″ / 20 ft

Many roofing products need more than a minimum pitch to shed water. Check what your shingles or panels allow before you set a very low shed pitch. The roof pitch calculator flags pitches that are too flat for shingles.

Plumb cut, seat cut and the birdsmouth

A common rafter has three cuts. The plumb cut at the top is vertical once the rafter is in place, so it sits flat against the ridge. The birdsmouth is a notch where the rafter sits on the wall. It is made of a seat cut that rests level on the top plate and a short heel cut that is plumb and sits against the outside of the wall. The tail cut at the eave is usually plumb too, so fascia can go on square.

The calculator gives the plumb angle as the roof angle and the seat angle as 90° minus that. On a speed square you rarely need degrees. Hold the pivot against the top edge of the board and swing the square until the pitch number on the COMMON scale lines up with the same edge. Mark along the square for the plumb line. The seat line is square to that.

Make the seat cut as wide as the wall plate, which is 3½ in on a 2×4 wall and 5½ in on a 2×6 wall. Keep the notch shallow so enough of the rafter is left above it. Your local code limits how deep you can notch, so check before you cut.

Which lumber length to buy

Dimensional lumber is sold in 2 ft steps, usually 8 to 24 ft. The calculator adds your trimming allowance to the rafter length and picks the shortest board that is still long enough.

Rafter lengthBoard to buy (with 2 in for trimming)
Up to 7′ 10″8 ft
Up to 9′ 10″10 ft
Up to 11′ 10″12 ft
Up to 13′ 10″14 ft
Up to 15′ 10″16 ft
Up to 17′ 10″18 ft
Up to 19′ 10″20 ft
Up to 21′ 10″22 ft
Up to 23′ 10″24 ft

Board ends are often split or out of square. The 2 in allowance lets you trim both ends clean. Order a few spare boards for crowned or twisted pieces you reject at the yard.

Special cases

Overhang measured along the rafter. The calculator expects a level overhang, because that is how eaves are usually drawn on plans. If you measured the tail along the slope of an existing rafter, tick Overhang measured along the rafter and it is used as entered.

Shed roofs with two overhangs. The low-side overhang goes in Eaves overhang and the high-side one in High-side overhang. Both add to the same board.

Hip and valley rafters. These run at 45° in plan, so they are longer than common rafters. The calculator shows the factor only. Hip jacks and valley rafters need their own layout.

Walls out of square. Measure the span at both ends and in the middle. If the numbers differ by more than a fraction of an inch, cut one pattern rafter to the average, test it at several points and adjust before cutting the rest.

Rafter count. The count is one rafter per spacing along the wall plus one to close the end, doubled for a gable. It doesn’t add gable-end ladder framing, doubled rafters at openings or spares.

Cost

The cost of rafters is the number of rafters times the price of one board at the length shown. Lumber prices change often and vary by region, size and grade, so this page does not quote one. Ask your lumberyard for a current price per board at the length the calculator gives, and remember to price the ridge board, ties and connectors separately. The board foot calculator helps if your yard prices framing lumber by the board foot.

Common mistakes

  • Using the full span as the run on a gable roof. The run is half the span, so the rafters come out twice as long.
  • Measuring the overhang along the slope and entering it as level. The tail ends up longer than you planned.
  • Forgetting the ridge board. With a standard 2× ridge, each rafter’s run comes out ¾ in too long.
  • Ordering boards exactly as long as the rafter. With no room to trim, one split end means a new board.
  • Picking rafter size or spacing from a chart that does not state its loads, species and grade. Use your local span tables.
  • Cutting all the rafters from the first measurement. Cut one pattern rafter, test it at both ends of the building, then cut the rest.

Frequently asked questions

How do you calculate rafter length?

Find the run (half the building width minus half the ridge board on a gable roof), multiply it by the pitch multiplier √(1 + (pitch ÷ 12)²), then add the overhang tail. A 24 ft wide gable roof at 6/12 with a 1½ in ridge board and a 12 in overhang needs rafters 14′ 5⅝″ long.

How do I calculate rafter length from the roof pitch?

Multiply the run by the multiplier for your pitch. At 4/12 the multiplier is 1.054, at 6/12 it is 1.118 and at 8/12 it is 1.202. A 12 ft run at 6/12 gives 13.42 ft of rafter before the ridge deduction and overhang.

How do I calculate rafter length from the rise and run?

Use the Pythagorean theorem: rafter length = √(rise² + run²). A run of 12 ft and a rise of 6 ft gives √180 = 13.42 ft, or 13′ 5″. Add the overhang tail on top of that.

How long are the rafters for a 12 ft span?

At 4/12, the rafter from the wall to the center of the ridge is 6′ 3⅞″. With a 1½ in ridge board and a 12 in overhang it is 7′ 3¾″, which you cut from an 8 ft board. Lumber size and spacing for that span must come from your local code or span tables.

What size rafters do I need?

That depends on the span, spacing, lumber species and grade, and the snow, wind and dead loads where you build. Look it up in the span tables your local code adopts, such as the American Wood Council span tables, or ask your building department or an engineer. This calculator gives lengths and angles only.

How far apart should rafters be?

Rafters are most often set 16 or 24 inches on center, with 12 and 19.2 inches used for heavier loads or engineered layouts. The spacing you can use depends on the rafter size and the loads, so take it from your local span tables.

Do I subtract the ridge board from the rafter length?

Yes. Each rafter stops at the face of the ridge board, so take half the ridge thickness off the run. For a standard 1½ in ridge board that is ¾ in of run per side. On a 24 ft span at 6/12 with a 12 in overhang, the rafter drops from 14′ 6⅜″ to 14′ 5⅝″.

What angle do I cut rafters at?

The plumb cut at the top is the roof angle: 18.4° for 4/12, 26.6° for 6/12 and 33.7° for 8/12. The seat cut is 90° minus that, so 63.4° at 6/12. On a speed square, pivot on the top edge and line up the pitch number on the COMMON scale.

How long is the rafter tail for an overhang?

Measure the overhang level, from the outside of the wall to the end of the eave, then multiply it by the pitch multiplier. A 12 in level overhang at 6/12 needs a tail of 1′ 1⅜″ along the rafter. If you measured along the rafter, tick that option and the calculator uses it as is.

How do I calculate rafters for a lean-to or shed roof?

Pick Shed (one slope). The run is the full building width, because there is no ridge in the middle. A 10 ft wide shed at 3/12 with a 12 in overhang needs rafters 11′ 4″ long, cut from 12 ft boards.

What is the difference between a rafter and a truss?

A rafter is a single board cut and fitted on site, running from the wall to the ridge. A truss is a factory-built triangle of boards joined with metal plates and designed by an engineer. You order trusses by span and pitch from a truss maker, so you do not need this calculator for them.

How accurate is a rafter length calculator?

The geometry is exact for the numbers you enter, and the calculator rounds lengths to the nearest ⅛ inch. Real walls are rarely perfectly straight or parallel, so measure the building at both ends, cut one pattern rafter, test it at a few spots and then cut the rest.

Sources & methodology

How we calculate

Shashikant Yadav

Writes practical DIY guides for home and yard projects and checks every calculator against published sources.

Spotted an error? Report it