SettingsSettings for this calculationUS
Two slopes and gable ends, four slopes with hips, or a single slope.
A hip roof's ends slope down to eaves too, so its rafters are commons along the ridge, hips from each corner and jack rafters between them that shorten toward the corners. A shed roof is one slope from a high wall to a low one, its rafters each the full span.
From one gable wall's outside face to the other's.
The rafters are laid out along this length on both slopes, with a rafter over each gable wall. On a hip roof it is the longer side, which the ridge runs along; on a shed, the run of the high and low walls.
Tools needed: Tape measure
From the outside of one eave wall's plate to the outside of the other.
Half of it, less half the ridge board, is each rafter's run in plan to the ridge. On a shed roof the whole of it is each rafter's run, from the low wall to the high one.
The rise for every 12 of horizontal run, both slopes the same.
Rise per 12 of run, not an angle: 6 in 12 is about 26.6°. The slope factor, sqrt(1 + (rise / 12)²), turns each run in plan into the rafter's length along the slope.
How far the rafter tail reaches past the wall plate, measured level.
Measured flat in plan from the outside of the plate to the tail's plumb cut; the page puts it on the slope. Enter nothing for a roof with no eave overhang.
How far the roof runs past each gable wall.
It lengthens the ridge board at both ends and, where it is more than nothing, adds a barge rafter on each slope at each end. Enter nothing for a flush gable. A hip roof has eaves at its ends instead and does not use it.
The width between a wing's eave walls, for an L, T or U-shaped house; 0 for none.
The wing comes off the main roof's long side at the same pitch and is no wider than the main span, so its ridge ties in below the main ridge with a valley each side. A gable or a hip main roof only; a shed has no wings here.
From the main roof's wall line out to the wing's end wall.
Measured at the walls; its end is a gable or a hip as the roof shape above says.
A second wing's span, on the same long side for a U or the other for a T; 0 for none.
Measured like the first wing; the two must not overlap along the main roof.
A second wing's length; 0 for none.
Measured like the first wing.
The centres your span table or framing plan gives.
Commonly 400 or 600 mm in metric framing and 16 or 24 in in North American framing; the span table that sizes the rafter is read at this spacing.
Half of it comes off each rafter's run, where the rafter meets the board's face.
The IRC asks for a ridge board no thinner than 1 in nominal; a 2x board is 1 1/2 in (38 mm). For a structural ridge beam enter its width. A shed roof has no ridge and does not use it.
Rafters to cut
40 rafters
18 rafters on each slope at the spacing, a pair over each gable wall, and a barge rafter on each slope at both overhanging gables; each runs from the ridge board's face to the tail's plumb cut.
- Common rafters, both slopes
- 36 rafters
- Barge rafters at the gable overhangs
- 4 rafters
- Slope factor
- 1.12
- Length of each rafter, ridge face to tail
- 15.96 ft
- Rafters, lineal
- 638.21 ft
- Ridge board length
- 34.96 ft
They open the calculator with your figures already in it
Rafter Quantity Calculator (Gable, Hip, Shed, L- and T-Shaped Roofs: Rafters, Hips, Valleys, Jacks and Ridge Board): 40 rafters — shown in imperial, US market. The link sets both, so the result they see is the one on your screen.
Show calculation logicHide calculation logic
How this was calculated
Formula source(s)
- California Residential Code (2025) § R802.3: a ridge board connecting opposing rafters not less than 1 inch (25 mm) nominal thickness and not less in depth than the cut end of the rafter; § R802.4.2: rafters framed opposite each other to a ridge board, offset no more than 1 1/2 inches (38 mm); § R802.4.6: collar ties not less than 1 x 4 nominal, no more than 4 feet (1219 mm) on centre
- Rafter line length: run x sqrt(1 + (rise / 12)^2), the run being horizontal from the outside of the wall plate to the ridge; the overhang's horizontal projection takes the same factor (this site's common gable rafter length page)
- Open Exam Prep, Louisiana roofing contractor guide, 3.2 Surface Area Calculations: the hip and valley multiplier sqrt(12² + 12² + R²) / 12 from the 17-inch diagonal run (1.500 at 6:12); length of one hip rafter = common run x the hip multiplier
- Jack rafters on an equal-pitch 45° hip: each spacing along the plate shortens a jack by the spacing x the common rafter's length per unit of run, the framing square's common difference (this site's hip and valley rafter cut list page)
- Southern Pine Inspection Bureau, "Nominal vs. Actual Lumber Sizes": dressed sizes per PS 20-20, the American Softwood Lumber Standard; a nominal 2-inch member dresses to 1 1/2 in
Inputs used
- Roof Shape
- Gable: two slopes, a gable wall at each end
- Building Length (along the ridge)
- 33 ft
- Building Width (the span)
- 26 ft
- Roof Pitch (rise per 12 run)
- 6
- Eave Overhang (in plan)
- 16 in
- Gable Overhang (each end)
- 11.75 in
- First Wing's Span (0 for none)
- 0 ft
- First Wing's Length (0 for none)
- 0 ft
- Second Wing's Span (0 for none)
- 0 ft
- Second Wing's Length (0 for none)
- 0 ft
- Rafter Spacing (on centre)
- 24 in
- Ridge Board Thickness
- 1.5 in
Intermediate steps
- Common rafters, both slopes
- 36 rafters
- Barge rafters at the gable overhangs
- 4 rafters
- Slope factor
- 1.12
- Length of each rafter, ridge face to tail
- 15.96 ft
- Rafters, lineal
- 638.21 ft
- Ridge board length
- 34.96 ft
Confidence note: 18 rafters on each slope at the spacing, a pair over each gable wall, and a barge rafter on each slope at both overhanging gables; each runs from the ridge board's face to the tail's plumb cut.
What this calculation does not cover
- Nothing here sizes a rafter or checks the roof. The section, grade and spacing for the span, the snow and the wind come from your code's rafter span tables or an engineer, and so do the ties, collars or ridge beam that stop the roof spreading.
- A rectangle with every slope at one pitch: a gable, a hip roof with its ridge along the longer side, or a shed, and up to two wings off its long sides for an L, a T or a U, each no wider than the main span. A wing off an end, a wing at another pitch, dormers and any other outline need the hip and valley pages, plane by plane.
- Where a wing ties in, the valley jacks are counted at the spacing from each valley's foot and the wing's commons from its end wall; the valley rafters run to the wing ridge's end, and the extra framing a wing near a hipped end of the main roof needs, and any blocking or ridge beam, is the framing plan's.
- Each rafter is its line length from the ridge board's face to the tail's plumb cut. The birdsmouth, the plumb cuts and rounding up to a stock length are not added; the common rafter page draws the cuts.
- Barge rafters are one per slope at each overhanging gable, cut like a common. The outlookers or ladder framing that carry them are not counted.
- On a hip roof each jack runs to the hip's centre line and each hip to the ridge's end, so half the hip's thickness, the hip's drop or backing and the king commons' cut against the ridge are not taken off; the hip and valley cut list page gives those cuts.
- On a shed roof the eave overhang is taken at the high side as well as the low eave, and the gable-shaped walls at each end, taller at the high side, are wall framing, not rafters.
- Ceiling joists or rafter ties, collar ties, blocking at the plate, the sub-fascia and the roof sheathing are separate items.
Estimated cost — your price
This site holds no price list for this material — local prices vary too much to publish honestly. Enter your supplier's price and the result is costed with it.
Part of a bigger job
This trade is one line of a job takeoff. Run the whole job and every other trade comes back with it, off the same measurements.
Computed in your browser — nothing you enter is uploaded. Presented in US customary units and US trade terminology. Where a formula follows a published standard, that standard and its edition are cited beside it on this page; where none governs, the page says so. Local amendments override model codes — verify against the code in force where you build.
Sources checked 2026-10-10 · v1.0.0
Regulatory standards & verification citations5
- California Residential Code (2025) § R802.3: a ridge board connecting opposing rafters not less than 1 inch (25 mm) nominal thickness and not less in depth than the cut end of the rafter; § R802.4.2: rafters framed opposite each other to a ridge board, offset no more than 1 1/2 inches (38 mm); § R802.4.6: collar ties not less than 1 x 4 nominal, no more than 4 feet (1219 mm) on centre
- Rafter line length: run x sqrt(1 + (rise / 12)^2), the run being horizontal from the outside of the wall plate to the ridge; the overhang's horizontal projection takes the same factor (this site's common gable rafter length page)
- Open Exam Prep, Louisiana roofing contractor guide, 3.2 Surface Area Calculations: the hip and valley multiplier sqrt(12² + 12² + R²) / 12 from the 17-inch diagonal run (1.500 at 6:12); length of one hip rafter = common run x the hip multiplier
- Jack rafters on an equal-pitch 45° hip: each spacing along the plate shortens a jack by the spacing x the common rafter's length per unit of run, the framing square's common difference (this site's hip and valley rafter cut list page)
- Southern Pine Inspection Bureau, "Nominal vs. Actual Lumber Sizes": dressed sizes per PS 20-20, the American Softwood Lumber Standard; a nominal 2-inch member dresses to 1 1/2 in
Cite this page
Your workspace
Most jobs need more than one number. Add the calculators you need next and they open right here, underneath this one — your figures stay on screen and nothing is lost to a page change.
Tools and safety for this job
To cut framing lumber and frame the roof structure. Generic types, no brands, no prices.
Protection this work requires
- Hardwood dust is a recognised carcinogen: extract at the tool and wear a P2/N95 respirator when cutting or sanding indoors.
- Saws, grinders and breakers run above 85 dB, where hearing damage accumulates and does not recover: defenders or plugs for every cut, not just the long ones.
- Boards, blocks and bagged material cause most lasting back injuries on small sites: two people or a lifter for full sheets, and never a bag on one shoulder up a ladder.
- Most fatal falls on small jobs are from under three metres: use a tower or a ladder tied at the top, and never work off the top two rungs.
Frame the roof structure: Rafters, joists, purlins and trusses, and the ties and straps that hold them, are sized by an engineer, a truss maker or accepted span tables, and this site never sizes them. A count of rafters or trusses at a chosen spacing is a quantity to order against; what each member must be is not something a count can say.
Show the 8 tools this job needsHide tools
Essential
Circular saw
Combination or framing square
Tape measure
Recommended
Framing nailer
Mitre saw
String line and pins
Tower scaffold or trestles
Optional
Hand saw
Also needed as materials: circular saw blades, framing nails, fuel cells, mitre saw blades.
what each carpentry tool is for, and the spec that decides which to buy where one does.