Materials & Quantities

Rafter Quantity Calculator (Gable, Hip, Shed, L- and T-Shaped Roofs: Rafters, Hips, Valleys, Jacks and Ridge Board)

Count the rafters of a gable, hip or shed roof at your spacing and their lengths, with the hips, jacks, a wing's valley rafters and the ridge board.

  • Answers as you type
  • Every formula cited
  • Calculated in your browser
SettingsSettings for this calculationUS
Market
Imperial · sales tax
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

High confidence

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
Then change the inputs to see how far the answer moves.

Show 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
Final result40 rafters

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.

26.6°26 ft66/12
Schematic, drawn to the proportions you entered — not to scale on screen.

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
  1. 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
  2. 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)
  3. 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
  4. 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)
  5. 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 needs

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.

Now that you have the number

These guides cover the work this quantity is for.

How to calculate rafter quantity (gable, hip, shed, L- and T-shaped roofs: rafters, hips, valleys, jacks and ridge board) in 13 steps

  1. Roof ShapeTwo slopes and gable ends, four slopes with hips, or a single slope.
  2. Building Length (along the ridge)From one gable wall's outside face to the other's.
  3. Building Width (the span)From the outside of one eave wall's plate to the outside of the other.
  4. Roof Pitch (rise per 12 run)The rise for every 12 of horizontal run, both slopes the same.
  5. Eave Overhang (in plan)How far the rafter tail reaches past the wall plate, measured level.
  6. Gable Overhang (each end)How far the roof runs past each gable wall.
  7. First Wing's Span (0 for none)The width between a wing's eave walls, for an L, T or U-shaped house; 0 for none.
  8. First Wing's Length (0 for none)From the main roof's wall line out to the wing's end wall.
  9. Second Wing's Span (0 for none)A second wing's span, on the same long side for a U or the other for a T; 0 for none.
  10. Second Wing's Length (0 for none)A second wing's length; 0 for none.
  11. Rafter Spacing (on centre)The centres your span table or framing plan gives.
  12. Ridge Board ThicknessHalf of it comes off each rafter's run, where the rafter meets the board's face.
  13. Rafters to cutThe tool computes the rafters to cut from those figures and shows the formula, its sources, and a confidence rating alongside it.

Rafters to cut by building length (along the ridge)

Page defaults, not your figures above.

Building Length (along the ridge)Rafters to cut (rafters)
20 ft28
30 ft38
40 ft48
50 ft58
60 ft68

Frequently asked questions

How many rafters does a gable roof need?
On each slope, the building's length divided by the spacing, rounded up, plus one, then twice that for both slopes. A 10 m (32.8 ft) roof at 600 mm (24 in) centres takes 18 a slope, 36 in all, and four barge rafters more if the gables overhang.
How long is each rafter?
Half the span less half the ridge board, plus the eave overhang, all measured level, times the slope factor. On an 8 m (26.2 ft) span at 6 in 12 with a 400 mm (15.7 in) eave and a 38 mm (1 1/2 in) ridge that is 4.381 m (14.37 ft) level, times 1.118, or 4.898 m (16.07 ft) along the slope before the cuts.
Is a ridge board enough, or do I need a ridge beam?
That is the roof's design. A ridge board only gives the rafters something to meet; it carries nothing when the walls are tied by ceiling joists or rafter ties. A roof without those ties, such as a vaulted ceiling, needs a ridge beam an engineer or the span tables size.
How many rafters does a hip roof need?
Commons along the ridge on both long sides, a king common at each hip end, four hips, and jack rafters each side of every hip at the spacing from the corner. A 12 by 8 m (39.4 by 26.2 ft) hip roof at 6 in 12 with 600 mm (24 in) centres and a 400 mm (15.7 in) eave has a 4 m (13.1 ft) ridge, 16 commons along it and 2 kings, 4 hips of 6.6 m (21.65 ft), and 48 jacks, 134.2 m (440.2 ft) of them: 70 pieces.
What does a wing add to the rafters of an L-shaped roof?
Two valley rafters, valley jacks on both roofs where they meet, and the wing's own commons. A 6 m (19.7 ft) wing standing 4 m (13.1 ft) off a 12 by 8 m (39.4 by 26.2 ft) gable at 6 in 12, with 600 mm (24 in) centres and a 400 mm (15.7 in) eave, takes two valley rafters of 5.1 m (16.73 ft), nine valley jacks on the main roof in place of nine of its commons, eight on the wing, and 16 wing commons: 74 pieces with the barges, against 46 for the plain gable.
How are a shed roof's rafters counted?
One slope, so one rafter at each spacing along the walls plus one, each the whole span and both overhangs times the slope factor. A 6 m (19.7 ft) lean-to over a 3 m (9.8 ft) span at 3 in 12 with 300 mm (11.8 in) eaves takes 11 rafters at 600 mm (24 in), each 3.711 m (12.17 ft), and the high wall stands 0.75 m (2.46 ft) above the low one.
Does this include the ceiling joists?
No. Ceiling joists or rafter ties are counted on the ceiling joist page; run it with the same building and spacing.
Preliminary estimate, not certified engineering. This tool produces an indicative quantity calculation for planning purposes only — it is not a certified structural analysis, a guaranteed material takeoff, or a substitute for building department approval. Always verify measurements on-site and have a licensed contractor or structural engineer review any load-bearing, code-sensitive, or safety-critical work before purchasing materials or starting construction. Spotted an arithmetic or standards error? Report it to contact@craftquantities.com with your inputs — a confirmed fix gets a permanent check of its own, so the same mistake cannot come back.