Rafter Length Calculator: Common Rafters, Pitch and Overhang
Rafter length calculator
- Rafter length (with overhang)
- 14' 4 3/16"
- In decimal feet
- 14.35 ft
- Roof angle
- 26.6°
- Height, plate to ridge
- 5' 11 5/8"
- Rafters (both sides)
- 62
- Board at least
- 16 ft
Type the width of the building, the roof pitch and the overhang, and the calculator returns the rafter length in feet and inches, the roof angle, the height from the top of the wall plate to the ridge, and a rafter count. The sections below show the arithmetic, so you can check the result with a calculator or a framing square.
What the calculator measures
A common rafter runs from the ridge down to the exterior wall top plate and usually continues past it as a tail to form the eave overhang. Under IRC Chapter 8 and AWC Wood Frame Construction Manual terminology, rafters are the repetitive sloped framing members extending from the ridge or hip down to the wall plate or eave that support the structural roof sheathing and covering. This page deals with the plain gable case—the common rafter—which has the same cut length at every bay along a uniform gable roof. Hip, valley and jack rafters have different lengths and compound bevel angles, and the hip and valley calculator covers them.
The length returned is measured along the slope between two plumb lines: one at the ridge board and one at the end of the tail. It is the number you mark on the board, before you cut the notch where the rafter sits on the plate.
Pitch, slope and how to enter them
In North American framing and IRC Chapters 2, 8 and 9, roof steepness is expressed as unit vertical rise per 12 inches of horizontal run, so a 6:12 roof climbs 6 inches vertically for every 12 inches it travels horizontally. That is what the calculator’s Pitch field expects. Note that in classic carpentry terminology, everyday “pitch” (like 6:12) is technically unit slope (rise ÷ run), whereas historical fractional “roof pitch” meant total rise divided by the full two-sided building span—converting to unit slope per 12 inches by multiplying by 24. A fractional pitch of 1/6 describes the same roof as a 4:12 slope, because 1/6 × 24 = 4. The rafter tables stamped onto a standard steel framing square list unit lengths per foot of run against slopes per 12 inches.
If you only know the roof angle in degrees, take the tangent and multiply by 12. A 30° roof is tan 30° × 12 = 6.93 in of rise per 12.
The formula
The rafter, the run and the rise form a right triangle, so Pythagoras gives the length:
run (in) = building width ÷ 2 − ridge thickness ÷ 2
slope factor = sqrt( 1 + (rise ÷ 12)² )
rafter length = (run + overhang) × slope factor
ridge height above plate = run × rise ÷ 12
roof angle = atan( rise ÷ 12 )
The ridge deduction matters because the rafters on opposite sides do not meet on the centre line. They butt against the faces of the ridge board, so each one loses half its thickness from the run. A 1.5 in ridge board takes 0.75 in off the run, which is about 0.84 in off the length at 6:12. Enter 0 if your rafters meet at a peak with no ridge board.
Slope factors you can reuse
| Pitch | Slope factor | Roof angle | Rafter per 12 in of run |
|---|---|---|---|
| 3:12 | 1.0308 | 14.04° | 12.369 in |
| 4:12 | 1.0541 | 18.43° | 12.649 in |
| 5:12 | 1.0833 | 22.62° | 13.000 in |
| 6:12 | 1.1180 | 26.57° | 13.416 in |
| 7:12 | 1.1577 | 30.26° | 13.892 in |
| 8:12 | 1.2019 | 33.69° | 14.422 in |
| 9:12 | 1.2500 | 36.87° | 15.000 in |
| 10:12 | 1.3017 | 39.81° | 15.620 in |
| 12:12 | 1.4142 | 45.00° | 16.971 in |
The 5:12 row is a 5-12-13 triangle and the 9:12 row is 9-12-15, so those two come out as whole numbers. These values are plain trigonometry, not tied to any manufacturer, and you can regenerate any row with the formula above.
Worked example 1: 24 ft wide, 6:12, with an overhang
A 24 ft wide building, 6:12 pitch, 1.5 in ridge board and a 12 in level overhang:
- run = 144 − 0.75 = 143.25 in
- slope factor = sqrt(1 + 0.5²) = 1.118034
- rafter length = (143.25 + 12) × 1.118034 = 173.57 in
- 173.57 in = 14 ft 5 9/16 in, or 14.46 ft
- ridge height above the plate = 143.25 × 6 ÷ 12 = 71.6 in, about 5 ft 11.6 in
- the board must be at least 15 ft long, because 14.46 ft does not fit in a 14 ft piece
Standard framing-square layout tables carry unit rafter multipliers to two or three decimal places and field layout rounds cut marks to the nearest 1/16 inch on a tape rule, which is why the calculator displays fractional inches to sixteenths.
Worked example 2: 28 ft wide, 8:12, deeper eave
A garage 28 ft wide with an 8:12 roof, 1.5 in ridge and a 16 in overhang:
- run = 168 − 0.75 = 167.25 in
- slope factor = sqrt(1 + (8/12)²) = 1.2019
- rafter length = (167.25 + 16) × 1.2019 = 220.24 in = 18 ft 4 1/4 in
- ridge height above the plate = 167.25 × 8 ÷ 12 = 111.5 in, about 9 ft 3.5 in
Standard North American solid-sawn dimension lumber yards commonly stock lengths in 2-foot increments up to 16 or 20 ft, whereas structural composite lumber such as laminated veneer lumber (LVL, covered in the AWC NDS) or metal-plate-connected wood trusses are the standard choices for longer clear runs. At 18 ft 4 1/4 in this garage rafter requires at least a 20 ft board and sits near the practical stock limit for sawn lumber—a good moment to ask whether prefabricated trusses or an engineered ridge/rafter system suit the job better. Our roof truss calculator shows the span and pitch relationship for trusses.
Counting rafters
Rafters sit at a fixed spacing along the length of the building, and the last one closes the end. So the count per side is:
rafters per side = round up( building length (in) ÷ spacing (in) ) + 1
total = rafters per side × 2
A 40 ft building at 16 in on centre: 480 ÷ 16 = 30 spaces, plus 1 gives 31 per side and 62 in total. At 24 in on centre the same building needs 21 per side, 42 in total. The count covers common rafters only. Add the extra members for gable-end lookouts, hips, valleys, dormers and any doubled rafters at openings.
Choosing the rafter size
This calculator tells you how long a rafter is, not how deep it needs to be. Size comes from the span, the spacing, the species and grade of the lumber and the loads on the roof, including snow where it applies. The American Wood Council’s span calculator works out joist and rafter spans for the species and grades in the National Design Specification supplement, for common loading conditions, and publishes a tutorial on understanding loads. Treat the code tables or an engineer’s stamped design as the authority. Spans, load assumptions and allowable lumber differ between jurisdictions.
Note that the horizontal span of a rafter is not the same number as its length. The 2021 International Residential Code sizes rafters from the span tables in section R802.4.1 and states that rafter spans are measured along the horizontal projection of the rafter. That is the run, not the longer length along the slope, so do not type the length from this calculator into a span table.
Common mistakes
- Using the full width as the run. The rafter on each side spans half the building. Divide the width by 2.
- Skipping the ridge thickness. On a long roof, a half inch of error per rafter adds up to a visible step at the ridge.
- Entering the overhang along the slope. The calculator expects the level distance from the outside of the wall plate to the end of the tail. It applies the slope factor itself.
- Confusing pitch and slope. Typing 1/6 into a field that wants 4 gives a nearly flat roof. Multiply a pitch fraction by 24 first.
- Cutting every rafter from the same pattern without a test. Cut one, set it in place with the ridge board and check the fit before cutting the rest, because the plate and ridge are rarely perfect.
- Treating the result as a stock length. Round up to a length your lumber yard stocks. The calculator’s “board at least” figure rounds up to the next whole foot, which may not be a length you can buy.
For roofing material quantities once the framing is known, see the roofing underlayment calculator, and the roofing hub lists the other roof calculators on this site. Roof area itself is covered by the square footage calculator.
Drives 1-1/4" galvanized coil nails flush with depth dial
Full-body harness, reusable roof anchor, 50 ft lifeline & rope grab
Pries old shingles and pulls nails cleanly from roof deck
Dimensional Lumber & LVL Section Properties (AWC NDS / PS 20)
Nominal vs. actual dressed dimensions, cross-sectional area A, section modulus S, moment of inertia I, board-foot factor, and unit weights.
| Nominal Size | Actual (b × d) | Area A (in²) | Section Mod. S (in³) | Inertia I (in⁴) | BF / lin ft | Dry Wt (lb/ft) |
|---|---|---|---|---|---|---|
| 2x4 | 1.5" × 3.5" | 5.25 | 3.063 | 5.359 | 0.6667 | 1.28 |
| 2x6 | 1.5" × 5.5" | 8.25 | 7.563 | 20.797 | 1 | 2.01 |
| 2x8 | 1.5" × 7.25" | 10.875 | 13.141 | 47.635 | 1.3333 | 2.64 |
| 2x10 | 1.5" × 9.25" | 13.875 | 21.391 | 98.932 | 1.6667 | 3.37 |
| 2x12 | 1.5" × 11.25" | 16.875 | 31.641 | 177.979 | 2 | 4.1 |
| 4x4 | 3.5" × 3.5" | 12.25 | 7.146 | 12.505 | 1.3333 | 2.98 |
| 4x6 | 3.5" × 5.5" | 19.25 | 17.646 | 48.526 | 2 | 4.68 |
| 6x6 | 5.5" × 5.5" | 30.25 | 27.729 | 76.255 | 3 | 7.35 |
| 1-3/4x9-1/2 LVL | 1.75" × 9.5" | 16.625 | 26.323 | 125.034 | 1.6667 | 4.85 |
| 1-3/4x11-7/8 LVL | 1.75" × 11.875" | 20.781 | 41.13 | 244.207 | 2 | 6.06 |
| 1-3/4x14 LVL | 1.75" × 14" | 24.5 | 57.167 | 400.167 | 2.3333 | 7.15 |
Reference standard: AWC National Design Specification (NDS) Supplement & NIST PS 20. Click any column header to sort or click a highlighted preset pill inside the calculator to auto-fill values.
Enter your ZIP or postal code to compare bids from vetted local licensed roofing contractors matched to your calculated scope.
Enter a valid 5-digit US ZIP (or 3–8 character postal code) to check local availability.
Frequently asked questions
How do you calculate rafter length from pitch?
Multiply the horizontal run by the slope factor, which is the square root of 1 plus (rise ÷ 12) squared. The run is half the building width. For a 6:12 roof on a 24 ft wide building the run is 12 ft, the factor is 1.118, and the rafter is 13.42 ft before the overhang and the ridge board are considered.
Do I measure rafter length to the wall or to the end of the overhang?
Both, added together. The calculator measures from the plumb cut at the ridge to the plumb cut at the tail, so the overhang is included. Enter the overhang as a level distance past the outside of the wall plate, not as a length along the slope.
How many rafters do I need for a 40 foot building?
Count the spaces and add one: 40 ft is 480 in, and at 16 in on centre that is 30 spaces, so 31 rafters per side and 62 in total. Gable-end overhangs, hips and valleys add members that this count does not include.
What size lumber should the rafters be?
This page gives length only. Size depends on the species and grade of lumber, the spacing, the span and the snow and wind loads for your site. The American Wood Council has a free span calculator, and your local building department decides which tables apply.
Sources
- 2021 International Residential Code, Chapter 8, section R802.4.1 Rafter size, International Code Council, accessed November 2026.
- Span Options Calculator for Wood Joists and Rafters, American Wood Council, accessed November 2026.
- National Design Specification (NDS) for Wood Construction & Wood Frame Construction Manual (WFCM), American Wood Council, accessed November 2026.
- 2021 International Residential Code, Chapter 2 Definitions & Chapter 9 Roof Assemblies (roof slope in units of vertical rise per 12 units of horizontal run), International Code Council, accessed November 2026.