Rafter Length Calculator

Rafter length from building span, pitch and overhang, for a gable or a shed roof.

Measure in
Building span outside to outside
Building length along the ridge
Pitch, x/12
/12
Overhang horizontal
Roof type
Rafter spacing
in o.c.
RAFTER LENGTH
14.91 ft
run 12.00 ft · multiplier 1.1180
Shopping list
  • Body lengthridge to wall plate 13.42 ft
  • Tail16.0 in overhang 1.49 ft
  • Plumb cut angleat the ridge 26.6°
  • Rafters, both sidesat 16 in centers 62

How to calculate rafter length

Rafter length is the hypotenuse of rise and run. Find the run (half the span on a gable, all of it on a shed), multiply by the pitch multiplier, then add the tail for the overhang.

run = span ÷ 2 (gable) or span (shed) multiplier = √(1 + (pitch ÷ 12)²) rafter = run × multiplier tail = (overhang ÷ 12) × multiplier

Measuring the span, and the reference point everyone gets wrong

The run is measured horizontally from the centerline of the ridge to the outside face of the wall framing. Not to the inside face, not to the center of the top plate, and not to the outside of the sheathing. On a symmetrical gable that makes the run half the outside-to-outside span, which is what this calculator assumes.

Get the reference wrong by the 3 1/2 in of a plate and every rafter in the roof is out by nearly 4 in at 6/12 once the pitch multiplier has been applied.

Before you cut anything, measure the span at both gable ends and again in the middle, and pull both diagonals across the plates. Walls half an inch out of square are invisible at the plate and painfully obvious in a wavy ridge.

The span quoted in a rafter table is the horizontal projection, not the sloped length of the rafter. The IRC is explicit about it. Rafter spans are measured along the horizontal projection. A 24 ft gable is therefore two 12 ft spans, and the 2×8 is being asked to span 12 ft, not the 13.4 ft it physically measures at 6/12. Reading the sloped figure into a span table is merely conservative at a low pitch and expensive at a high one. At 12/12 the sloped length is 41% longer than the span, and you’ll usually end up buying 2×12s for a job a 2×10 covers comfortably.

Shortening for the ridge is measured level, not along the rafter’s top edge. The calculator’s length runs to the centerline of the ridge, so you take off half the ridge thickness (3/4 in for a 1 1/2 in ridge board). Mark it by drawing a second plumb line 3/4 in back from the first and cutting on that, rather than pulling 3/4 in back along the edge with a tape. A parallel plumb line gets it right at any pitch. Measured along the edge, the true deduction is the level distance times the pitch multiplier, which is roughly 0.84 in at 6/12, 0.94 in at 9/12, and more again as the roof steepens.

Sizing the rafter and stopping the walls from spreading

Rafter size comes from a span table, and which table you need depends on load. Take a 20 psf roof live load and a 20 psf dead load (the IRC heavy-covering column, the one meant for clay tile, concrete tile and slate), with the ceiling not attached to the rafters and an L/180 deflection limit. Douglas fir-larch No. 2 under that heavy covering gives roughly 12 ft 7 in in a 2×6 at 16 in centers and 16 ft in a 2×8. Those are the 20 psf dead-load columns. Ordinary shingle roofs read the 10 psf columns and reach further.

The rafter span calculator on this site reads the smallest passing size straight from those tables for your span. Widening to 24 in centers costs about 18% of the span, so that 2×8 drops to around 13 ft. Snow load takes more again. Pick the table matching your ground snow load rather than the one that gives the answer you want, and check your local code (or ask your lumber supplier) if you’re not sure which applies.

An asphalt-shingle roof reads the lighter 10 psf dead-load column instead, which allows a longer span in every size. Which column is your table printed for? Look before you size anything. In Canada rafters are sized from NBC Part 9.23 and the CWC span book rather than the IRC. The rack at your yard holds S-P-F No.1/No.2 rather than Douglas fir-larch, which gives up roughly 5 to 10 percent of span in the same size. Canadian snow loads are quoted in kPa on the NBC climatic data table, where 1.0 kPa is about 21 psf and 2.0 kPa about 42 psf.

A pair of rafters leaning on a ridge board pushes the walls outward, and something has to hold the feet together. Ceiling joists nailed to the rafter feet at the plate usually do the job.

Where they can’t, the IRC wants a rafter tie of at least 2×4 nominal in the bottom third of the rafter height. The spacing tightened from 4 ft on center in older editions to 24 in in recent ones, so it’s worth knowing which edition your jurisdiction has adopted. Collar ties are a different member doing a different job. They’re 1×4 minimum, in the upper third of the attic space, no more than 4 ft on center, and they resist uplift and separation at the ridge rather than spread at the walls.

If nothing ties the rafter feet, the ridge stops being a ridge board and becomes a structural ridge beam that has to be designed, sized and carried down to a footing at each end. The same applies to any roof pitched below 3/12, where the IRC requires ridges, hips and valleys to be designed as beams outright.

Watch the birdsmouth too. It’s a notch at the end of the member, and end notches are capped at a quarter of the member’s depth (1 13/16 in on a 2×8, whose actual depth is 7 1/4 in). Where the rafter overhangs, the notch sits on a cantilever and is generally accepted where enough rafter depth remains bearing over the plate. Ask your inspector what allowance they accept, because it moves between code editions.

When the common-rafter formula stops working

Hips and valleys don’t use the 12 in base this calculator does. A hip runs diagonally across the corner, traveling 16.97 in (call it 17) for every 12 in the common rafter travels, which is why framing squares carry a 17 line. The multiplier per foot of common run is the square root of 288 plus the pitch squared, all divided by 12. At 6/12 that works out at exactly 1.5, so a 12 ft common run gives an 18 ft hip. Hips also need a double cheek cut at the top and either dropping or backing along the top edge, so the two sheathing planes land flat instead of rocking on a corner.

Jack rafters shorten by a constant called the common difference, equal to the rafter spacing multiplied by the same common-rafter multiplier. At 16 in centers on a 6/12 roof that’s 16 × 1.118, or 17 7/8 in. Cut the longest jack, offer it up and check it, then step down by that figure for each one after. All of this assumes a regular hip with the same pitch on both sides. Put different pitches on the two planes and the hip no longer bisects the corner. You’re into laying out the real geometry rather than reaching for a multiplier, and the 17 constant stops applying.

Two more cases fall outside the formula. A shed roof between walls of different heights has a run equal to the full span, but its rise is the difference in plate heights, so derive the pitch from those two measurements rather than assuming a number. Trusses aren’t rafters either. They arrive engineered, and they can’t be cut, notched or drilled without the manufacturer’s approval.

The overhang here is horizontal, so a 16 in overhang gives a sloped tail of 16 × the multiplier (about 17 7/8 in at 6/12). Want 16 in measured along the rafter? Divide instead.

Rafter spacing for corrugated metal roof

Metal doesn’t change the rafter spacing. Sixteen or 24 in on center still comes off the span table for your load. What changes is what carries the panel. Over open framing, 29-gauge corrugated typically wants purlins at 24 in on center, and heavier 26-gauge profiles reach 3 to 5 ft.

Two systems are in play and people routinely conflate them. Rafters are sized by span and load. Purlins are the 2×4s laid flat across them that the panel screws into, and the panel’s published load table (profile by profile, gauge by gauge) fixes their spacing. Post-frame buildings almost always land on 24 in with 29-gauge. If instead you sheathe the roof solid and lay panel over decking and underlayment, purlins disappear and rafter spacing alone governs, with 24 in centers entirely normal.

Those spacings assume roughly 20 psf, though. Take the live load to 30 psf and the published tables pull 29-gauge corrugated back to about 18 in and 26-gauge R-panel from 48 in to 36 in.

So tighten the purlins wherever there’s real snow, an exposed site, or anyone likely to walk the roof. Thin panel dents between widely spaced supports.

How long are rafters for a 24 ft wide house

On a gable the run is 12 ft. The rafter body then comes to 12 ft 8 in at 4/12, 13 ft 5 in at 6/12 and 14 ft 5 in at 8/12. A 16 in horizontal overhang adds about 18 in of tail at 6/12, putting the full cut length near 14 ft 11 in.

Order 16 ft stock for all three, because a 14 ft board leaves nothing for the plumb and seat cuts.

Steeper pitches move fast. A 10/12 puts the body at 15 ft 7 in and 12/12 at nearly 17 ft, past a 16 ft board once the tail is added, which is one reason 24 ft gables above 10/12 usually go to trusses.

Check the span while you’re there. Twelve feet of horizontal run sits right at the limit of a 2×6 in Douglas fir-larch No. 2 at 16 in centers carrying 20 psf live and 20 psf dead. The IRC allows 12 ft 7 in there, and nowhere near it with snow. Frame the same building as a shed roof and the run becomes the full 24 ft. A 4/12 rafter is then 25 ft 3 in, beyond dimensional lumber.

Rafter length for a 12x16 shed

Run the ridge down the 16 ft length and the span is 12 ft, so the run is 6 ft. That gives a rafter body of 6 ft 4 in at 4/12 and 6 ft 9 in at 6/12. A 12 in overhang adds 13 in of tail at 4/12, so 8 ft stock covers the shallower pitch comfortably.

At 6/12 the same rafter totals 7 ft 10 in, which fits a 96 in board with two inches to spare. Buy 10 ft if your cuts are anything but perfect.

Count comes off the 16 ft length, not the span. That’s nine pairs at 24 in on center, so 18 rafters, or 13 pairs at 16 in centers for 26.

A 6 ft run is inside a 2×4 for a garden shed in mild country, but 2×6 is the safer default and probably the only sensible choice at 30 psf ground snow or more. Turn the shed the other way, ridge across the 12 ft dimension, and the span becomes 16 ft, the run 8 ft, and the 6/12 rafter grows to 8 ft 11 in before the tail.

How many rafters do I need for a 40 ft long roof

Sixty-two at 16 in on center, or 42 at 24 in. Count along the 40 ft length rather than across the span, so 480 in divided by 16 is 30 bays, which means 31 rafters per slope, doubled for a gable roof. A shed roof with one slope needs half those numbers.

Treat that as the starting number, not the order. Openings for chimneys, skylights and dormers need doubled trimmers on each side. Gable ends often carry a fly rafter on 2×4 outriggers notched over the first common.

Two or three spares are cheap insurance, because the pattern rafter and the first cut rarely both survive. The ridge board comes in stock lengths and laps over a rafter.

Lay the spacing out with a story pole, or a tape run in one pull from one gable to the other. Measuring 16 in from the last mark each time stacks up saw-kerf error, and by the far end your sheathing joints stop landing on framing.

Common questions

Does this include the overhang?

It does. The headline figure is body plus tail, and the rows underneath break out each part separately so you can mark the birdsmouth without working backwards.

Do I subtract the ridge board?

Take half the ridge thickness off each rafter, so 3/4 in for a 1 1/2 in ridge board. The calculator’s length runs to the ridge centerline, so that deduction is on you.

What spacing should I use?

Most roofs go at 16 in on center. You’ll see 24 in fairly often too, usually with engineered rafters and heavier sheathing, though it costs you span in the same size.

What is the lowest roof pitch I can use asphalt shingles on?

The IRC allows asphalt shingles down to 2/12, two units vertical in twelve, but from 2/12 up to 4/12 it requires double underlayment. Below 2/12 you need a different covering. Standing-seam metal goes to 1/4:12, clay and concrete tile to 2 1/2:12, wood shingles to 3/12 and slate to 4/12.

How much extra roofing does a steeper pitch need?

Roof surface equals the footprint times the same multiplier used for rafter length. Over a 1,600 sq ft footprint, a 4/12 roof is about 1,687 sq ft of surface and a 10/12 roof about 2,083. That’s 23% more shingles, underlayment and sheathing for the same house. Price that in before you commit to a pitch.

Does going to 24 inch rafter spacing save money?

Less than you’d think. The same rafter loses roughly 18% of its allowable span moving from 16 in to 24 in centers, so you often step up a size and give the saving back. The sheathing also has to be rated for the wider bay, and thin panels over 24 in framing usually need H-clips or blocked edges.

What is HAP on a rafter?

Height above plate. It’s the vertical distance from the top of the wall plate to the top edge of the rafter, measured on the plumb line through the birdsmouth. It sets your ceiling height at the eaves and must be identical on every rafter. Set it once on a pattern rafter and trace that pattern rather than re-measuring each one.

Do I need collar ties and rafter ties?

They do different jobs, so usually yes. Rafter ties sit in the bottom third and stop the walls spreading. Collar ties sit in the upper third and stop the rafters separating at the ridge under wind uplift. Ceiling joists nailed to the rafter feet count as rafter ties. If nothing ties the feet, you’ll need a designed ridge beam instead.

How much further does a 2×8 rafter span than a 2×6?

Three to four feet at the same spacing and load. In the ordinary-shingle 10 psf dead-load column, Douglas fir-larch No. 2 at 16 in centers runs 14 ft 7 in for a 2×6 against 18 ft 5 in for a 2×8. Under a heavy covering (20 psf dead) the pair falls to 12 ft 7 in and 16 ft. The rafter span calculator reads the size for your exact span, species and spacing straight from the IRC table.

Can I use 2×6 rafters on a 24 ft wide house?

Usually yes on an ordinary shingle roof. The horizontal span is 12 ft. Douglas fir-larch No. 2 2×6 at 16 in centers is good for 14 ft 7 in at 20 psf live load, or 12 ft 1 in at 30 psf ground snow (close enough that you should confirm your local snow load). Tile and other heavy coverings read the 20 psf dead-load columns, where the same 2×6 stops at 12 ft 7 in, and real snow then pushes you to a 2×8 or beyond. Rafter ties or a designed ridge beam either way.

Does the rafter count include the gable end walls?

No. The count covers the common rafters spanning between the gable walls, and the end walls themselves are studded up to the roof line. Most builds still add a fly or barge rafter outside each gable, carried on 2×4 outriggers notched over the first common rafter, so order two extra full-length rafters on top of the calculated figure.

How this page is checked: written and maintained by Salman Khalid. Every formula on this site is pinned by an automated test suite: 140+ named checks against manufacturer data sheets and code sections, plus a property sweep of every option combination and edge input. The build refuses to publish if a single check fails. Full methodology on the how we calculate page. Spot an error? Tell us. Fixes are logged, dated, on the corrections page. Sources for this page: IRC R802.4.1 rafter span definition (UpCodes) · AWC span table tutorial
Cite or link this page: Salman Khalid, “Rafter Length Calculator,” LevelCalcs, levelcalcs.com/rafter-length-calculator/, updated August 31, 2026. The reference tables and worked figures are free to quote with a link back.