Rafter Spacing & Count Calculator (12"/16"/19.2"/24" O.C.)
Find your rafter count instantly.
🕒 Last updated: September 2, 2026
Inputs
ℹ️Gable: two equal slopes meeting at a center ridge. Shed/Lean-To: one continuous slope from a low wall to a high wall. Hip and valley roofs aren't modeled.
ℹ️Outside wall to outside wall, perpendicular to the ridge — each rafter's run is half this span.
ℹ️The length running along the ridge (or along the low/high walls for a shed roof) — determines the rafter count.
ℹ️Rise per 12 inches of run — a 6/12 roof rises 6 inches for every 12 inches of horizontal run. Common residential pitches range roughly 4/12 to 12/12.
ℹ️Half of this thickness is subtracted from each rafter's run, since both rafters meet at the ridge board.
ℹ️Horizontal projection of the rafter tail past the outer wall face, before any fascia trim.
ℹ️Sets the rafter's actual depth, used for the birdsmouth notch-depth check and HAP — verify span adequacy separately against a span table.
ℹ️The wall this rafter lands on — sets the birdsmouth seat cut length (2x4 = 3.5", 2x6 = 5.5").
Waste & Lumber
ℹ️Accounts for cut-offs, damaged pieces, and layout adjustments — 10% is a common estimating default.
ℹ️Standard stock length used to buy ridge board lumber — affects how many boards are needed after joints.
Cost
Total Rafters Needed
69
2x8, includes 10% waste — both slopes
Rafter Length to Buy
16 ft
Cut length 173.57" (14.46 ft) including the overhang tail
Rafter Geometry
Pitch: 6/12 (26.57° from horizontal)
Run: 143.25" (11.94 ft)
Rise: 71.63" (5.97 ft)
Line length (ridge to wall): 160.16"
Overhang tail: 13.42" (12" horizontal overhang)
Total rafter length: 173.57"
Birdsmouth & Cuts
Plumb cut angle: 26.57° (speed square/saw bevel setting)
Seat cut length: 3.5" (2x4 plate)
Notch depth (perpendicular to rafter): 1.57"
Max notch depth (1/4 rule): 1.81"
Heel height (plumb rise of the heel cut): 1.75"
Height above plate (HAP): 6.36"
Rafter Count
Rafters per side: 31 (16" O.C. over 40 ft)
Both slopes: 31 × 2 = 62
Total with 10% waste: 69
Ridge Board
Length: 40 ft (building length)
Boards needed: 3 (16 ft stock)
Assumptions Used
Standard US residential common-rafter framing (gable or shed, no hip/valley rafters). Rafter length, run, rise, and cut angles are direct trigonometry from your entered pitch, span, and overhang — not a code-table lookup, so they apply regardless of your local code edition. Notch depth (perpendicular to the rafter) and heel height (the vertical rise of the heel cut) are two distinct birdsmouth measurements — the 1/4 notch-depth limit is commonly cited as required by IRC R802.7.1 (some code editions cross-reference the equivalent R502.8 floor-joist rule) — verify against your locally adopted code edition before cutting. Rafter count uses the same on-center spacing formula as field studs, and total rafter length is rounded up to a real stock lumber length where one covers it — a rafter exceeding the longest standard stock length (24 ft) is flagged for a special-order, spliced, or engineered solution instead. This is a reference estimate for a material takeoff, not a structural design — snow load, wind uplift, and rafter size adequacy for your span must be verified against the adopted code and a structural professional.
Bill of Materials
Main material: 69 pcs + recommended tools
+−
Bill of Materials
Main material: 69 pcs + recommended tools
Computed items reflect your entered span, pitch, and length; consumables below are general recommendations — actual needs vary by product, wind/seismic zone, and site conditions.
For Your Job
Rafters
Ridge Board
General Tools & Consumables
Framing nails / rafter fasteners
Hurricane ties / rafter-to-plate connectors
Rafter ties or collar ties (lumber)
Framing nailer or hammer
Circular saw or miter saw
Speed square / framing square
Tape measure
Chalk line
4 ft level
Roof/ridge bracing or temporary supports
Safety glasses, work gloves & fall protection
Diagram simplified for clarity (not to scale)
Looking for the verification checklist, reference tables, tips, or common mistakes?See the complete Rafter Calculator.
Rafter count by spacing
Rafter spacing (12, 16, 19.2, or 24 inches on-center) directly determines how many rafters a given building length needs, using the same even-spacing formula as wall studs.
This page defaults to standard 16" O.C. spacing on a 40 ft building length — edit the inputs above to match your actual roof.
- 16" O.C. is the standard default; 12" O.C. is common for heavier snow loads or roofing materials.
- 24" O.C. spacing needs roughly 33% fewer rafters than 16" O.C. for the same building length — confirm it's adequate for your rafter size and load.
- A gable roof's rafter count is doubled to cover both slopes; a shed roof's is not.
Rafter Calculator Formula: How Is It Determined?
Rafter geometry, birdsmouth cuts, and rafter count, calculated separately and combined into a material takeoff.
Step 1 — Rafter Run, Rise & Length
Run = Gable: (Span − Ridge Thickness) ÷ 2 | Shed: full Span
Angle = arctan(Pitch ÷ 12)
Rise = Run × (Pitch ÷ 12)
Line Length = Run ÷ cos(Angle)
Tail Length = Overhang ÷ cos(Angle)
Total Rafter Length = Line Length + Tail Length
This is direct trigonometry applied to your entered span, pitch, and overhang — a Pythagorean relationship between run and rise, not a code-table lookup, so it applies regardless of code edition. Total length is then rounded up to the nearest real stock lumber length.
Step 2 — Birdsmouth & Cuts
Seat Cut = Wall Plate Width
Plumb Cut Angle = Angle (from horizontal)
Notch Depth = Seat Cut × sin(Angle)
Heel Height = Seat Cut × tan(Angle)
Max Notch Depth (1/4 rule) = Rafter Depth ÷ 4
HAP = (Rafter Depth ÷ cos(Angle)) − Heel Height
The seat cut rests flat on the top plate. Notch depth (measured perpendicular to the rafter, the figure the 1/4 rule applies to) and heel height (the vertical rise of the plumb heel cut) are two distinct measurements — HAP (Height Above Plate) is the rafter's full vertical extent minus the heel height the notch removes. The 1/4 notch-depth rule is commonly cited as required by IRC R802.7.1 — this calculator flags any pitch/lumber combination that exceeds it, but verify against your locally adopted code edition.
Step 3 — Rafter Count & Ridge Board
Rafters per Side = ceil((Building Length in inches) ÷ Spacing) + 1
Total Rafters = Gable: Rafters per Side × 2 | Shed: Rafters per Side
Ridge Board Length = Building Length (Gable roofs only)
Rafter count uses the same on-center spacing formula as field studs. A gable roof doubles the count to cover both slopes; a shed roof has only one slope and no ridge board.
Worked Example
This example walks through your current inputs above, using the same steps as the Formula section.
Input Values Used
| Input | Value | Why it is used |
|---|---|---|
| Roof type / span | Gable / 24 ft | Sets whether run is half or full span |
| Pitch | 6/12 (26.57°) | Sets rise, length, and cut angles |
| Rafter lumber / wall plate | 2x8 / 2x4 | Sets birdsmouth notch depth check and HAP |
Step 1 — Rafter Run, Rise & Length
| Calculation | Result |
|---|---|
| Run | 143.25" |
| Rise | 71.63" |
| Line length | 160.16" |
| Overhang tail | 13.42" |
| Total rafter length | 173.57" (16 ft stock) |
Step 2 — Birdsmouth & Cuts
| Calculation | Result |
|---|---|
| Seat cut | 3.5" |
| Plumb cut angle | 26.57° |
| Notch depth (max 1.81") | 1.57" |
| Heel height | 1.75" |
| HAP | 6.36" |
Step 3 — Rafter Count & Ridge Board
| Calculation | Result |
|---|---|
| Rafters per side | 31 |
| Total rafters (with 10% waste) | 69 |
| Ridge boards (16 ft, 40 ft total) | 3 |
Therefore, this 24 ft span, 6/12 pitch roof needs approximately 69 rafters (16 ft stock) and 3 ridge boards.
Related Calculators
Disclaimer: This calculator provides approximate results for planning and estimation purposes only. Actual requirements may vary based on site conditions, materials, workmanship, and local building regulations. Always consult a qualified engineer, architect, or construction professional before making final decisions.