Home / Rafter Length Calculator
Roofing & Construction Calculators

Rafter Length Calculator

Rafter Length Calculator

Enter the building span, roof pitch, overhang and rafter size to get the cut length of each common rafter, the birdsmouth layout, cut angles, board length and rafter count.

The overhang is the level distance from the outside of the wall to the end of the rafter tail. On a shed roof the overhang is added at both the low and the high wall.

Rafter length with overhang
0

Line length (wall to ridge)0
Overhang tail length0
Total rise and slope factor0
Plumb cut / seat cut angle0
Birdsmouth heel and height above plate0
Board to buy and rafter count0

Calculation details

Use this free rafter length calculator to find the cut length of a common or shed roof rafter from the building span and roof pitch, with overhang, ridge board deduction, birdsmouth layout, cut angles, board size and rafter count.

Enter the span from outside wall to outside wall, the roof pitch and your overhang. Pick the rafter lumber and seat cut to lay out the birdsmouth, and add the building length to count rafters.

How to Calculate Rafter Length

Follow these four steps to work out a common rafter by hand, or let the calculator above do the math and round it to the nearest 1/16 inch.


01

Measure the Span

Measure the building width from the outside of one wall to the outside of the opposite wall. For a gable roof each rafter covers half of this span. For a shed roof one rafter covers the full span.

02

Find the Rafter Run

Divide the span by 2 and subtract half the ridge board thickness. A 24 ft (288 in) span with a 1-1/2 in ridge board gives a run of 144 − 0.75 = 143.25 in.

03

Multiply by the Slope Factor

The slope factor is √(1 + (pitch ÷ 12)²), which is 1.118 for a 6/12 roof. Multiply the run by it to get the line length: 143.25 × 1.118 = 160.16 in, or 13 ft 4-3/16 in.

04

Add the Tail & Lay Out Cuts

Multiply the level overhang by the same factor and add it: 12 in × 1.118 = 13.42 in, for 14 ft 5-9/16 in total. Mark the plumb cuts at the roof angle and the birdsmouth seat cut where the rafter sits on the wall.

FORMULA & EXPLANATION

Rafter Length Formulas & Glossary

A common rafter is the sloped side of a right triangle. The run is the level side, the rise is the vertical side and the rafter is the hypotenuse, so the Pythagorean theorem or the slope factor gives its length.

RAFTER LENGTH FORMULA

Rafter run

Gable: Run = Span ÷ 2 − Ridge thickness ÷ 2  |  Shed: Run = Span

Slope factor and line length

M = √(1 + (Pitch ÷ 12)²)  |  Line length = Run × M = √(Rise² + Run²)

Overhang and total rafter length

Tail = Level overhang × M  |  Total = Line length + Tail (two tails on a shed roof)

Birdsmouth and cut angles

Angle θ = arctan(Pitch ÷ 12)  |  Heel = Seat × Pitch ÷ 12  |  HAP = Depth ÷ cos θ − Heel  |  Depth left = Depth − Seat × sin θ

Rafter count and board length

Rafters per side = ceil(Length × 12 ÷ Spacing) + 1  |  Board ≥ Total + Depth × Pitch ÷ 12

Slope factors: 3/12 = 1.0308, 4/12 = 1.0541, 5/12 = 1.0833, 6/12 = 1.118, 7/12 = 1.1577, 8/12 = 1.2019, 9/12 = 1.25, 10/12 = 1.3017, 12/12 = 1.4142. Actual lumber depths: 2x4 = 3-1/2 in, 2x6 = 5-1/2 in, 2x8 = 7-1/4 in, 2x10 = 9-1/4 in, 2x12 = 11-1/4 in.


Lengths are measured along the slope from the outside of the wall to the ridge centerline, then out to the end of the tail. Always cut and test one pattern rafter before cutting the rest, and size rafters from your local code span tables.

S

Span (S)

The level width of the building, measured from the outside of one wall to the outside of the other. A gable rafter covers half the span and a shed rafter covers all of it.

U

Run (U)

The level distance one rafter covers before the overhang: half the span minus half the ridge board thickness on a gable roof, or the full span on a shed roof.

M

Slope Factor (M)

M = √(1 + (pitch ÷ 12)²). It turns level distances into sloped lengths. It is 1.0541 at 4/12, 1.118 at 6/12, 1.2019 at 8/12 and 1.4142 at 12/12.

HAP

Height Above Plate (HAP)

The plumb distance from the top of the wall plate to the top edge of the rafter at the outside of the wall. HAP = rafter depth ÷ cos(angle) − heel cut height.

Rafter Length Examples

These worked examples come straight from the calculator above, with lengths rounded to the nearest 1/16 inch.

24 ft Gable House at 6/12

A 24 ft wide house with a 6/12 roof, 2x6 rafters, a 1-1/2 in ridge board, 12 in overhang and a 3-1/2 in seat cut.


Given: Span 288 in, pitch 6/12, ridge 1.5 in, overhang 12 in, 2x6 (5.5 in)

Calculation:
Run = 288 ÷ 2 − 1.5 ÷ 2 = 143.25 in; M = 1.118
Line = 143.25 × 1.118 = 160.16 in; tail = 12 × 1.118 = 13.42 in
Heel = 3.5 × 0.5 = 1.75 in; HAP = 5.5 ÷ cos(26.57°) − 1.75 = 4.4 in

Answer: 14 ft 5-9/16 in per rafter (173.57 in), cut from a 16 ft 2x6

8x12 Shed Roof at 3/12

A lean-to shed 8 ft deep and 12 ft long with a 3/12 single slope, 2x6 rafters at 16 in on center and a 6 in overhang at both walls.


Given: Shed span 96 in, pitch 3/12, overhang 6 in each end, 2x6, length 12 ft

Calculation:
Run = 96 in (full span); M = √(1 + 0.25²) = 1.0308
Line = 96 × 1.0308 = 98.95 in; tails = 6 × 1.0308 × 2 = 12.37 in
Rafters = ceil(12 × 12 ÷ 16) + 1 = 10

Answer: 9 ft 3-5/16 in per rafter (111.32 in), 10 rafters from 10 ft boards

30 ft Garage at 8/12

A 30 ft by 40 ft garage with an 8/12 roof, 2x8 rafters at 24 in on center, a 1-1/2 in ridge and an 18 in overhang.


Given: Span 360 in, pitch 8/12, ridge 1.5 in, overhang 18 in, 2x8 (7.25 in), length 40 ft

Calculation:
Run = 180 − 0.75 = 179.25 in; M = 1.2019
Line = 215.43 in; tail = 18 × 1.2019 = 21.63 in
Rafters = (ceil(40 × 12 ÷ 24) + 1) × 2 = 42

Answer: 19 ft 9-1/16 in per rafter (237.06 in), 42 rafters from 22 ft 2x8s

Rafter Length Calculator FAQs

Answers to common questions about rafter length, overhangs, ridge board deductions, birdsmouth cuts, cut angles and how many rafters you need.

How do you calculate rafter length?

Find the run (half the span minus half the ridge board on a gable roof), then multiply it by the slope factor √(1 + (pitch ÷ 12)²). This is the same as √(rise² + run²). Add the overhang tail, which is the level overhang times the same factor. A 24 ft span at 6/12 with a 1-1/2 in ridge and 12 in overhang gives 143.25 × 1.118 + 13.42 = 173.57 in, or 14 ft 5-9/16 in.

On a gable roof each rafter runs 6 ft (72 in). At a 4/12 pitch the slope factor is 1.0541, so the rafter is 72 × 1.0541 = 75.89 in, or 6 ft 3-7/8 in, before any overhang or ridge deduction. At 6/12 it would be 72 × 1.118 = 80.5 in. Enter your own overhang and ridge thickness in the calculator for the cut length.

Measure the overhang level, from the outside of the wall to where the fascia will be, and multiply it by the slope factor. A 12 in overhang on a 6/12 roof adds 12 × 1.118 = 13.42 in along the rafter, and an 18 in overhang on an 8/12 roof adds 18 × 1.2019 = 21.63 in. On a shed roof with overhangs on both walls, add a tail at each end.

The rafter run is measured to the center of the ridge, but each rafter stops at the face of the ridge board. So each rafter is shortened by half the ridge thickness, measured level. With a 1-1/2 in ridge you take 3/4 in off the run, which shortens a 6/12 rafter by 0.75 × 1.118 = 0.84 in along the slope.

Under IRC section R802.7.1.1 (2021), a rafter tail that cantilevers past the wall may be notched only if at least 3-1/2 in of rafter depth remains and the cantilever is no more than 24 in. A 3-1/2 in seat on a 2x6 at 6/12 removes 1.57 in, leaving 3.93 in, which passes. The calculator warns you when the remaining depth is too small. Always check your local code.

HAP is the plumb height from the top of the wall plate to the top edge of the rafter at the outside of the wall. It equals the rafter depth ÷ cos(roof angle) minus the heel cut height. For a 2x6 at 6/12 with a 3-1/2 in seat, HAP = 5.5 ÷ 0.8944 − 1.75 = 4.4 in. Keeping HAP the same on every rafter keeps the roof plane flat.

A shed or lean-to rafter spans the whole building depth, so its run is the full span. For an 8 ft deep shed at 3/12, the line length is 96 × 1.0308 = 98.95 in. With a 6 in overhang at both walls the rafter is 111.32 in, or 9 ft 3-5/16 in, so 10 ft boards work. Choose Shed roof in the calculator.

Divide the building length in inches by the rafter spacing, round up and add one for the end rafter. That gives one side of the roof, so double it for a gable roof. A 40 ft garage at 24 in on center needs (40 × 12 ÷ 24 + 1) × 2 = 42 rafters. At 16 in on center, a 12 ft shed needs 144 ÷ 16 + 1 = 10 rafters.

The plumb cuts at the ridge and tail are cut at the roof angle, arctan(pitch ÷ 12), measured from a line square across the board. That is 26.57° for 6/12, 18.43° for 4/12 and 33.69° for 8/12. On a speed square you pivot to the pitch number on the common scale. The level seat cut of the birdsmouth is square to the plumb cut.

Rafter size depends on the span, spacing, wood species, grade, snow load and dead load, so use the rafter span tables in IRC section R802.4.1 or your local code, or an engineer. This calculator finds lengths, not structural size. It does tell you the board length to buy: the rafter length plus the rafter depth × pitch ÷ 12 for the plumb cut, rounded up to the next even length.

No. Span is a level measurement: the building width, or the horizontal distance a rafter covers in code span tables. Rafter length is measured along the slope and is always longer. A 6 ft run at 6/12 needs an 80.5 in rafter, about 8.5 in longer than the run, before the overhang is added.

Rafters are most often set 16 in or 24 in on center, measured from the center of one rafter to the center of the next. Closer spacing lets a given rafter size span farther or carry more load, so the spacing has to match the span table you used. The calculator also supports 12 in and 19.2 in layouts.

Explore More Calculators

Get fast, precise, and beautifully designed solutions for all your personal, financial, and health calculations.

About the authors

CalcNova Editorial Team

CalcNova was created and is maintained collaboratively by two friends who want to make everyday calculations simpler and more accessible. We build practical online calculators and clear explanations to help people understand results and the methods behind them.

Our focus is on clear formulas, useful examples, and regularly maintaining our tools. Calculator results are intended for guidance; for important financial decisions, confirm figures with the relevant provider or a qualified professional.

Scroll to Top