Deck Railing Calculator
Calculate posts, balusters, and rail lengths for deck guards with IRC code checks — with an itemized AWC DCA-6 §3 (restates IRC §R312) compliance disclosure, L-shape corner-post deduction, and composite manufacturer spacing warning built in.
Compliance values from AWC DCA-6 §3 (restates IRC §R312) + AWC DCA-6 §3 (restates IRC §R311.7.8) (2021 International Residential Code) and AWC DCA-6 Figure 30. Post-to-deck connector capacity, lateral load anchorage, footing depth, local jurisdiction amendments (42-in height; 3-riser handrail trigger), and stair triangular opening field measurement are NOT verified by this calculator — confirm with a qualified framing professional or your local building authority before purchasing.
Quick Answer
For a standard residential deck, your railing guard must be at least 36 inches tall (AWC DCA-6 §3 (restates IRC §R312.1.2), restated in AWC DCA-6 Section 8) on any deck surface more than 30 inches above grade, with balusters spaced so no 4-inch sphere can pass between them (AWC DCA-6 §3 (restates IRC §R312.1.3), per AWC DCA-6 guard provisions). Enter your deck perimeter, deck height above grade, material type, and stair details to get an exact post count, baluster count, and top rail linear footage — with an itemized dimensional check built in. Use the calculator below to get started. See current price at Amazon.
Deck Railing — Guard Elevation + L-Shape Corner Detail
- Guard post (4×4 PT)
- Baluster (1.5″ PT or 1″ composite)
- Top cap rail (2×4 or 2×6)
- Bottom rail
- Decking surface / grade
- Guard post (4×4 PT)
- Shared inside-corner post (count once)
- Baluster (elevation) / cross-section (corner detail)
- Cap rail (elevation + corner plan)
- Bottom rail
- Decking surface / grade
Schematic, not to scale. Elevation: guard assembly per AWC DCA-6 Figure 30 + AWC DCA-6 §3 (restates IRC §R312.1). Height ≥ 36 in for decks 30 in above grade per AWC DCA-6 §3 (restates IRC §R312.1.1). L-shape corner detail: shared inside-corner post counted once — deduct 1 post from the sum of per-run post counts.
Schematic guard assembly elevation — not to scale. Top-down L-shape plan view shown when "L-shape" is selected. For planning estimates only — verify with your local building authority before ordering materials.
Size Your Deck Railing
Start from a preset:
Click any preset to fill the form, then adjust as needed.
Your Estimated Deck Railing Materials
Manufacturer-spacing notice
Deck Railing Dimensional Check Results
This compares your dimensional inputs (guard height threshold, baluster opening, post spacing, and stair handrail trigger) against the AWC DCA-6 §3 (restates IRC §R312) / AWC DCA-6 §3 (restates IRC §R311.7.8) prescriptive minimums and the AWC DCA-6 Figure 30 post-spacing guidance. It does not certify the full guard system — post-to-deck connector capacity (AWC DCA-6 (restates IRC §R507.10)), lateral load anchorage (AWC DCA-6 §3 (restates IRC §R301.5)), footing depth, post pressure-treatment use category, and stair triangular opening field measurement also determine compliance. It is NOT a code-compliance certificate, NOT a building permit application, and NOT a substitute for review by a licensed professional. Confirm with your local building department before construction.
Rise/run dimensional checks: 3 of 3 items passed
What was checked · 3 provisions
- Guard height ≥36 in (when deck is >30 in above grade) — actual 36 in above grade, standard Guard required when >30 in above grade; guard ≥36 in IRC §R312.1.2 ↗
- Baluster opening ≤4-inch sphere — actual 4.0 in gap, standard ≤4.0 in (IRC R312.1.3) IRC §R312.1.3 ↗
- Post spacing ≤ AWC DCA-6 Figure 30 max (2x6 cap rail) — actual 8 ft o.c., standard ≤8 ft o.c. (AWC DCA-6 Figure 30 for 2x6 cap) · AWC DCA-6 Figure 30 (not an IRC R312 numeric limit)
Not checked by this calculator · 7 other provisions
This calculator verifies dimensional minimums only. The following structural and field-verification items must be confirmed separately with a qualified framing professional or your local building authority:
- Post-to-deck connection method — IRC 2021 R507.10.2 explicitly BANS notching 4×4 posts (changed from pre-2021); requires full-depth post on approved post-base hardware (e.g., Simpson Strong-Tie ABA44) · AWC DCA-6 (restates IRC §R507.10.2 (2021 change — §13.d CATCH 4))
- Lateral load capacity — guard system must resist 200 lb concentrated load in any direction (R301.5 / R312.1.4). Post base hardware, through-bolt size, and rim-joist blocking must be sized accordingly. Not verified by this calculator. · AWC DCA-6 §3 (restates IRC §R301.5 / R312.1.4)
- Guard height measurement — this calculator checks whether a guard is required (>30 in above grade) but cannot verify the actual installed guard height. Measure vertically from deck surface to top of rail after installation. · AWC DCA-6 §3 (restates IRC §R312.1.2)
- Stair triangular openings (R312.1.3 Exception) — triangular openings formed by the stair riser, tread, and bottom rail must not allow a 6-inch sphere to pass (different from the 4-inch rule for level guard openings). Field-verify after installation. · AWC DCA-6 §3 (restates IRC §R312.1.3 Exception (§13.d CATCH 3))
- Handrail riser trigger — IRC 2021 R311.7.8 requires a handrail at ≥4 risers. Some jurisdictions lower this trigger to 3 risers or 2 risers — verify with your local building department before skipping a handrail on 3-riser stairs. · AWC DCA-6 §3 (restates IRC §R311.7.8 (local-amendment risk))
- Local code amendments — some states and municipalities require 42-inch minimum guard height (vs. IRC 36-inch minimum). Verify with your local Authority Having Jurisdiction (AHJ) before construction. · IRC administrative provisions
- Post pressure-treatment use category — posts within 6 inches of soil require UC4A or UC4B rated PT lumber; above-ground post applications (post base hardware, no soil contact) require UC3B minimum. Check the end-tag color code on lumber before purchase. · AWC DCA-6 §3 (restates IRC §R317.1.1(A) + R507.10.2)
Compliance values sourced from AWC DCA-6 §3 (restates IRC §R312) + AWC DCA-6 §3 (restates IRC §R311.7.8) (2021 International Residential Code) and AWC DCA-6 Figure 30 (post-spacing prescriptive guidance). Local jurisdictions may have adopted a different IRC edition or have amendments. Always confirm with your local building department before construction.
This is an estimate — confirm quantities and code compliance with a qualified framing professional before purchasing. It is NOT professional engineering advice; NOT a code-compliance certificate; NOT a building permit application; and NOT a substitute for review by a licensed structural engineer or your local building authority. Verify every quantity and IRC provision against your actual site conditions and local building department before construction. See our full disclaimer.
Your configuration
- Shape:
- Rectangular
- Perimeter:
- 40 ft
- Deck height:
- 36 in
- Post spacing:
- 8 ft
- Material:
- Pressure-treated wood
- Cap rail:
- 2×6
Need a reference? See common railing-spec lookup table →
Shopping List
Affiliate disclosure: CraftedCalcs earns commission on purchases made through the Home Depot and Amazon links below. The commission does not change your price. It helps us keep this site free.
- 6 pressure-treated 4x4x8 posts (UC3B above-ground; UC4A within 6 in of soil) Home Depot Amazon
- 85 2x2x42 pressure-treated balusters (cut to fit 36-in guard) Home Depot Amazon
- 4 2x6x12 pressure-treated cap rail boards (40 LF total) Home Depot Amazon
- 12 Simpson DTT2Z deck-tension ties (lateral load — two per post) Home Depot Amazon
- GRK Caliburn 3/8 in x 3-1/4 in structural screws (rail-to-post fastening, 1 box of 50) Home Depot Amazon
- 24 1/2 in x 3-1/2 in hot-dip galvanized carriage bolts (four per post) Home Depot Amazon
- 3 inch hot-dip galvanized deck screws (baluster-to-rail fastening, 1 lb box) Home Depot Amazon
- 12 bags of Quikrete Fast-Setting concrete (post-set application) Home Depot Amazon
Quantities reflect your current calculator inputs. Post pressure-treatment use category (UC3B vs UC4A), footing diameter and depth, and post-base hardware coating (standard vs ZMAX for coastal / wet) depend on site conditions — confirm with a qualified framing professional or your local building department.
What Else You'll Need
Calculator output covers the headline material. This list is the full bill — the fasteners, brackets, sealants, and safety hardware beginners typically forget to buy on the first trip.
Estimate only — not a professional bill of materials. It is NOT professional engineering, architectural, or contracting advice; NOT a code-compliance certificate; NOT a building permit application; and NOT a substitute for review by a licensed professional. Verify every quantity against your actual cut list, site conditions, and local building authority before purchasing. See our full disclaimer for details.
Posts and rails (pressure-treated lumber)
- Qty: 6 posts (one per railing post location) · Use UC4A ground-contact rated lumber for any post within 6 inches of soil per AWPA U1 (see AWC DCA-6 §R507.10.2). Check the end-tag color code before purchasing — "pressure-treated" alone does not identify the use-category. 4x4 nominal = 3.5 in actual face width.
- Qty: 4 boards (one per 12 LF of railing perimeter) · AWC DCA-6 Figure 30 specifies 2x6 cap rail for up to 8 ft post spacing. 2x6 cap rail at 8 ft o.c. is the prescriptive maximum for pressure-treated guard assemblies.
- Qty: 10 boards (top rail + bottom rail) · Top rail sits below the cap; bottom rail provides the lower attachment point for balusters. Set the bottom rail 2 to 4 inches above the decking surface — too high and the bottom gap alone exceeds the 4-inch sphere maximum in AWC DCA-6 guard provisions (IRC R312.1.3).
- Qty: 85 balusters (per the calculator output) · 42-inch precut balusters cut down to your installed length. 2x2 nominal = 1.5 in actual square face. The calculator deducts post actual width (3.5 in) from each section clear span before computing baluster count.
Post connection hardware (Simpson Strong-Tie + GRK)
- Qty: 12 ties (two per post for lateral load transfer) · Per IRC R301.5 and R312.1.4 (restated in AWC DCA-6 §8), guards must resist 200 lb concentrated lateral load. The DTT2Z transfers that load from the post base to the deck framing. Pair per post — two DTT2Z devices per railing post is the standard residential pattern.
- Qty: 6 bases (one per post) · IRC 2021 R507.10.2 (restated in AWC DCA-6) explicitly bans notching 4x4 posts at the connection to the deck framing. The ABA44 (or ABU44Z for ZMAX galvanization in coastal / wet environments) provides a full-depth post-base connection that maintains the post cross-section.
- Qty: 24 bolts (four per post through-bolt connection) · Two bolts at top and bottom of the post-to-rim-joist connection provide the prescriptive through-bolt fastener pattern. Hot-dip galvanized (HDG) rating required for compatibility with pressure-treated lumber (untreated steel reacts with PT preservatives).
- Qty: 24 sets (one per carriage bolt) · Pair every carriage bolt with a flat washer (to spread the bearing load) and a hex nut. Use HDG rated nuts/washers to match the carriage bolt rating.
- Qty: 1 box of 50 — covers a typical 40 LF residential railing run · GRK Caliburn structural screws are ICC-ES approved for pressure-treated lumber. Drive directly into the post for rail attachment — no pilot hole needed. Replace older lag-screw + washer patterns with a stronger and faster install.
- Qty: 1 box of 1 lb covers a typical residential railing run · Two screws per baluster end (top and bottom) into the top and bottom rails. HDG rating for PT lumber compatibility. Predrill pilot holes through the baluster to prevent splitting at the end.
Post setting (concrete for new-build footings)
- Qty: 12 bags (approximately two bags per railing post footing) · Fast-setting concrete is appropriate for railing post bases that are not full structural footings. For full deck footings under guard posts that carry lateral load, confirm depth and diameter with your local building authority per
and your local frost line.
Layout and install tools
Affiliate disclosure: CraftedCalcs earns commission on purchases made through the Home Depot and Amazon links above. The commission doesn't change your price. It helps us keep this site free.
17 items across 4 categories. Quantities assume standard residential practice — adjust up for longer spans, complex geometry, or pro-grade specification.
Post count (with L-shape corner deduction)
postCount = ceil(perimeterFt / postSpacingFt) + 1; lShape: postsRunA + postsRunB - 1 (shared corner)
For a rectangular deck, the number of guard posts equals ceil(perimeter ÷ post spacing) + 1 — the +1 accounts for the closed-end count (one post at each end of the run). For an L-shape deck, posts on run A and run B are computed independently, then 1 is subtracted to account for the shared inside-corner post. This corner-post deduction is the D4 differentiator versus competitor calculators that double-count the corner and over-order by 1 to 2 posts.
Source: AWC DCA-6 (Prescriptive Residential Wood Deck Construction Guide) — Figure 30
Baluster count per section (IRC 4-inch sphere derivation)
clearSpan = sectionLengthIn - postWidth; count = ceil((clearSpan - W) / (W + G))
For each post-to-post section, subtract the 4×4 post actual width (3.5 in) from the full section length to get the clear span. Then divide by the baluster-plus-gap unit width (W = baluster actual width; G = 4-inch maximum gap per IRC R312.1.3). Ceiling-rounding ensures the actual gap is less than the maximum — over-baluster rather than under-baluster. The 4-inch sphere passing test (R312.1.3) is the outcome constraint; this formula is the industry-standard derivation.
Source: IRC R312.1.3 (2021) — Guard infill 4-inch sphere passing test
Handrail trigger and length (IRC 2021)
handrailRequired = hasStairs AND stairRisers >= 4; handrailLF = stairRunLF when required
IRC 2021 R311.7.8 requires a handrail on at least one side of any stair flight with 4 or more risers. §13.d CATCH 2: this is 4 risers under IRC 2021, NOT 3 (some manufacturer guides cite 3 — that is a local-amendment or trade shorthand, not IRC 2021 prescriptive text). When triggered, the handrail must be continuous for the full length of the stair run (R311.7.8.4), 34–38 in above the tread nosing line (R311.7.8.1), with a graspable cross-section (R311.7.8.5: 1.25–2.0 in OD for circular profiles).
Source: IRC R311.7.8 (2021) — Handrails required and dimensional requirements
Inputs, assumptions, and derived-constant sources
Every numeric constant the formulas above use is paired with the authority that sets it. Dimensional values are restated from AWC DCA-6 §3 (restates IRC §R312) / AWC DCA-6 §3 (restates IRC §R311.7.8) via AWC DCA-6; nominal-to-actual lumber widths follow standard milling convention. Confirm with your local building department before purchase.
| Constant | Value | Source / authority | Used in |
|---|---|---|---|
| Guard required threshold | > 30 in above grade | AWC DCA-6 §3 (restates IRC §R312.1.1) (restated in AWC DCA-6 §8) | guard-required gate |
| Minimum guard height | 36 in | AWC DCA-6 §3 (restates IRC §R312.1.2) (restated in AWC DCA-6 §8) | guard-height check |
| Baluster opening max | < 4 in (sphere test) | AWC DCA-6 §3 (restates IRC §R312.1.3) (restated in AWC DCA-6 §8) | baluster-count derivation |
| Stair triangular opening max | < 6 in (exception) | AWC DCA-6 §3 (restates IRC §R312.1.3) Exception (restated in AWC DCA-6 §3) | surfaced as unverified provision |
| Handrail trigger | ≥ 4 risers | AWC DCA-6 §3 (restates IRC §R311.7.8) (restated in AWC DCA-6 §3) | stair-section handrail gate |
| Handrail height range | 34–38 in above nosing | AWC DCA-6 §3 (restates IRC §R311.7.8.1) (restated in AWC DCA-6 §3) | stair-section handrail height |
| Post spacing — 2×4 cap rail | ≤ 6 ft o.c. | AWC DCA-6 Fig. 30 (prescriptive; not an IRC numeric) | post-count formula |
| Post spacing — 2×6 cap rail | ≤ 8 ft o.c. | AWC DCA-6 Fig. 30 (prescriptive; not an IRC numeric) | post-count formula |
| 4×4 post actual width | 3.5 in | Nominal-to-actual milling convention; 4×4 posts permitted per AWC DCA-6 (restates IRC §R507.10.2) (restated in AWC DCA-6 §R507.10) | clear-span deduction |
| 2×2 PT baluster actual width | 1.5 in | Nominal-to-actual milling convention | baluster unit-width formula (PT) |
| Composite/aluminum baluster width | 1.0 in (assumed) | Manufacturer kit convention — confirm specific profile in TimberTech / Trex install guide | baluster unit-width formula (composite/aluminum) |
| Concentrated lateral load | 200 lb | AWC DCA-6 §3 (restates IRC §R301.5) / AWC DCA-6 §3 (restates IRC §R312.1.4) (restated in AWC DCA-6 §8) | surfaced as unverified provision |
L-shape inside-corner deduction = 1 shared post per inside corner. Stair triangular-opening field check (R312.1.3 Exception) and 200-lb anchorage are not verified by this calculator — they are surfaced in the §2 disclosure as unverified provisions for licensed-professional review.
What this calculator computes — and what it does NOT
Per CALCULATOR-STANDARDS §2, the scope of every check is itemized. Dimensional minimums are estimated from inputs; structural, anchorage, footing, and jurisdictional checks are out of scope.
| Check | In scope? | Authority / who verifies |
|---|---|---|
| Guard required threshold (30 in above grade) | YES (dimensional) | AWC DCA-6 §3 (restates IRC §R312.1.1) |
| Minimum guard height (36 in) | YES (dimensional) | AWC DCA-6 §3 (restates IRC §R312.1.2) |
| Baluster opening < 4 in (sphere) | YES (derived from inputs) | AWC DCA-6 §3 (restates IRC §R312.1.3) |
| Post spacing per cap-rail size | YES (prescriptive) | AWC DCA-6 Fig. 30 |
| Stair handrail trigger + height (≥4 risers, 34–38 in) | YES (gate + range check) | AWC DCA-6 §3 (restates IRC §R311.7.8) |
| Post-to-deck connector capacity | NO — out of scope | Licensed framing pro per AWC DCA-6 (restates IRC §R507.10) |
| 200-lb lateral-load anchorage | NO — out of scope | Licensed framing pro per AWC DCA-6 §3 (restates IRC §R301.5) |
| Post pressure-treatment use category (UC3B vs UC4A) | NO — out of scope | Lumber end-tag + local building department |
| Footing depth + frost-line compliance | NO — out of scope | Local building department per IRC §R403.1 (verify locally-adopted edition with your local building department) |
| Stair triangular opening (6-in sphere) field measurement | NO — out of scope | Field measurement per AWC DCA-6 §3 (restates IRC §R312.1.3) Exception |
| Local jurisdiction amendments (42-in height; 3-riser handrail) | NO — out of scope | Your local building department |
| Composite manufacturer warranty section length | WARNING only | Specific brand install guide |
How This Calculator Estimates
Guard required threshold drives the height check. Per AWC DCA-6 §3 (restates IRC §R312.1.1), a guard is required on any open-sided walking surface more than 30 inches above the floor or grade below, measured at any point within 36 inches horizontally from the edge. Below 30 inches, IRC 2021 does not require a guard (though local codes may be stricter — some jurisdictions trigger at 24 inches). Once required, the guard must be at least 36 inches tall per AWC DCA-6 §3 (restates IRC §R312.1.2). The calculator surfaces both checks in the compliance disclosure.
Baluster spacing follows the 4-inch sphere rule, derived per section. AWC DCA-6 §3 (restates IRC §R312.1.3) requires that a 4-inch sphere cannot pass through any opening in the guard infill — this is an outcome constraint, not a formula. The industry-standard derivation: subtract the 4×4 post actual width (3.5 in) from each post-to-post section length, then divide by the baluster-plus-gap unit width (baluster width + 4-inch max gap). The ceiling round-up ensures the actual gap is less than 4 inches. The most common field error is skipping the post-width subtraction, which produces gaps at section ends that exceed 4 inches and typically surface during inspection.
Post spacing comes from AWC DCA-6, NOT a numeric IRC limit. The IRC does not specify a numeric post-spacing maximum for guards. AWC DCA-6 Figure 30 provides the prescriptive guidance: 6 ft on-center for 2x4 cap rail, 8 ft on-center for 2x6 cap rail. The governing IRC constraint is the 200-lb concentrated load requirement (AWC DCA-6 §3 (restates IRC §R301.5)) — post spacing is a derived engineering result of cap-rail bending capacity, not a code numeric. The calculator uses AWC DCA-6 Figure 30 as the prescriptive upper bound and surfaces "AWC DCA-6 Figure 30 (not an AWC DCA-6 §3 (restates IRC §R312) numeric limit)" in the compliance disclosure to distinguish prescriptive guidance from code text.
Guard vs handrail distinction matters for stairs. A guard (AWC DCA-6 §3 (restates IRC §R312)) is the perimeter barrier — posts, balusters, top rail. A handrail (AWC DCA-6 §3 (restates IRC §R311.7.8)) is a graspable rail along a stair flight. IRC 2021 R311.7.8 requires a handrail at 4 or more risers; the cap rail of a guard does NOT satisfy this requirement unless it meets the graspability cross-section (R311.7.8.5: 1.25–2.0 in OD circular, or 4.0–6.25 in perimeter non-circular). Most flat 2x4 / 2x6 cap rails fail graspability — a separate graspable handrail must be installed along the stair flight, returns to the wall or post at both ends (R311.7.8.4), 1.5-in minimum clearance from the wall (R311.7.8.3).
L-shape corner-post deduction. On an L-shape deck, two railing runs meet at an inside corner. The post at that corner is shared — it terminates run A and starts run B. A naive calculation that treats each run independently double-counts the corner. The calculator deducts 1 shared post automatically when L-shape is selected. This is the D4 differentiator vs competitor calculators that consistently over-order by 1 to 2 posts on L-shape decks.
Composite manufacturer spacing — brand-specific, install-guide bound. Composite railing post spacing is bounded by the engineered section-kit length of the specific product line, not by IRC. Confirmed brand limits the calculator uses for the manufacturer warning: Trex Transcend 6-ft and 8-ft sections (max post spacing 8 ft on-center per the Trex Transcend installation guide); TimberTech AZEK Premier & Classic standard rails ship in 6-ft, 8-ft, and 10-ft sections (verify your specific Premier/Classic profile in the TimberTech railing installation guide); Fiberon Symmetry ships in 6-ft and 8-ft sections — confirm the current section length for your color/profile against the Fiberon install guide before exceeding 6 ft o.c. Exceeding the section length voids warranty and causes rail bow under self-weight + 200-lb concentrated load (AWC DCA-6 §3 (restates IRC §R301.5), restated in AWC DCA-6 §8). These are warranty constraints surfaced as warnings only — IRC and AWC DCA-6 do not regulate manufacturer warranty terms.
Rounding behavior and derived constants. Two ceiling rounds are applied: (a) posts — ceil(perimeterFt ÷ postSpacingFt) + 1 over-orders rather than under-orders; an 11-ft section at 8-ft spacing yields 2 posts at the run ends + 1 intermediate, never 1 post + a 5.5-ft cantilever section. (b) balusters per section — ceil((clearSpan − W) ÷ (W + 4)) guarantees the actual gap is strictly less than 4 in (AWC DCA-6 §3 (restates IRC §R312.1.3)). Derived constants: post actual width 3.5 in (4×4 nominal, restated in AWC DCA-6 §R507.10); baluster actual width 1.5 in for 2×2 PT (nominal-to-actual milling convention) and 1.0 in for typical composite/aluminum kit balusters (confirm in your specific product install guide); maximum gap 4 in from AWC DCA-6 §3 (restates IRC §R312.1.3) (restated in AWC DCA-6 §8). For L-shape decks, the inside corner post is subtracted exactly once after both runs are rounded independently — uneven runs (e.g., 21 ft + 13 ft) still round per leg so each leg ends on a post, then 1 post is removed for the shared corner.
Scope. See the full disclaimer above and the shaded box below for the complete checked-versus-not-checked itemization.
Common Mistakes — Deck Railing
Three forum-sourced errors that consistently surface during inspection or void composite manufacturer warranties.
"I divided post-to-post distance by baluster unit width without subtracting the post thickness."
"I set composite railing posts at 9 ft to reduce post count, exceeding the manufacturer maximum section length."
"I installed the stair handrail without returns at the top and bottom."
Deck Railing Sizing by Perimeter and Material — AWC DCA-6 / AWC DCA-6 §3 (restates IRC §R312) Reference
Common residential deck railing scenarios with post count, baluster count (per the 4-inch sphere derivation for 2x2 PT balusters), and handrail trigger. The "Meets AWC DCA-6 §3 (restates IRC §R312)?" column applies to the dimensional checks only — post-to-deck connector capacity, lateral load anchorage, footing depth, and local jurisdiction amendments are NOT verified by this calculator.
| Deck perimeter | Deck height | Material | Posts needed | Balusters (level) | Top rail LF | Handrail required? | Meets AWC DCA-6 §3 (restates IRC §R312)? |
|---|---|---|---|---|---|---|---|
| 20 LF | 36 in | PT wood (2x6 cap) | 4 posts | 42 balusters | 20 LF | Stairs: depends | Yes (gap 3.72 in) |
| 40 LF | 36 in | PT wood (2x6 cap) | 6 posts | ~85 balusters | 40 LF | Stairs: depends | Yes (gap 3.72 in) |
| 60 LF (L-shape 40+20) | 54 in | PT wood (2x6 cap) | 9 posts (shared corner) | ~127 balusters | 60 LF | Yes | Yes (corner post counted once) |
| 30 LF | 32 in | Composite (1-in baluster, 6-ft sections) | 6 posts (6-ft spacing) | ~78 balusters | 30 LF | No (32 in deck only — verify local amendments) | Yes — verify composite warranty |
| 20 LF | 31 in | PT wood (2x4 cap) | 4 posts (6-ft max for 2x4 cap) | ~42 balusters | 20 LF | Stairs: depends | Yes (right at 30-in threshold) |
| 50 LF + 7-ft stair run | 54 in | PT wood (2x6 cap) + handrail | 8 posts (perimeter) | ~106 balusters | 50 LF + 7 LF handrail | Yes (4 risers, R311.7.8) | Yes — handrail + returns required |
Reference values from AWC DCA-6 §3 (restates IRC §R312) + AWC DCA-6 §3 (restates IRC §R311.7.8) (2021 IRC) and AWC DCA-6 Figure 30. Baluster counts assume 2x2 PT (1.5 in actual) or 1-in composite balusters with 4-in max gap. ← Use the calculator above for your specific railing →
Deck Railing Terminology
12 terms — guard vs railing, baluster (spindle/picket), top/cap rail, bottom rail, post connection (no-notch rule), handrail (stair requirement), sphere passing test, lateral load, inside-corner post, composite spacing.
Guard (Deck Railing)
Baluster
AWC DCA-6 §6 (4-inch sphere infill rule) ↗ · Also called "spindle" (UK/Canadian usage) or "picket" (vinyl rail systems). All refer to the same vertical infill element.
Top Rail / Cap Rail
Bottom Rail
Post (Guard Post)
AWC DCA-6 §6 (guard-post connection, no-notch rule) ↗ · IRC 2021 R507.10.2 bans notching 4×4 posts at their connection. Use a full-depth post base or bolt-through connection.
Handrail
AWC DCA-6 §7 (stair handrail requirements) ↗ · Required for stairs with 4+ risers. A wide flat cap rail almost never qualifies as a graspable handrail — check IRC R311.7.8.3 cross-section requirements.
Sphere Passing Test (4-inch rule)
AWC DCA-6 §6 (4-inch sphere infill rule) ↗ · Stair exception: 6-inch sphere for the triangular tread-riser-baluster opening only (IRC R312.1.3 exception).
Lateral Load (200-lb requirement)
Post Connection (R507.10 no-notch rule)
AWC DCA-6 §6 (guard-post connection, no-notch rule) ↗ · Added explicitly in IRC 2021; prior editions were ambiguous. Many jurisdictions are still on 2018 IRC — check which edition your AHJ (Authority Having Jurisdiction) has adopted.
Inside-Corner Post (L-shape deck)
AWC DCA-6 Fig. 30 ↗ · This is the D3 differentiator for CALC-172: no competitor calculator auto-handles the inside-corner post deduction. Leads to purchasing 1–2 extra posts on L-shape decks.
Composite Manufacturer Max Post Spacing
Always cross-check your selected composite product's current installation guide — specs can change between product generations. · Deck railing calculator with composite spacing check
AWC DCA-6 (Deck Construction Guide)
AWC DCA-6 Deck Construction Guide ↗ · AWC DCA-6 Figure 30 is the source for the elevation diagram above.
Frequently Asked Questions
How high should deck railing be?
Under IRC 2021 R312.1.2, restated in AWC DCA-6 §8 (Guards), deck railing (called a "guard" in the building code) must be at least 36 inches tall — verify with your local building department — measured vertically from the deck surface to the top of the rail. This applies to decks more than 30 inches above grade per AWC DCA-6 §8. Some states and municipalities require a minimum of 42 inches — always check with your local building department before construction.
Does my deck need railing if it is under 30 inches above grade?
Generally no — IRC 2021 R312.1.1, restated in AWC DCA-6 §8, requires guards only for open-sided walking surfaces more than 30 inches vertically above the floor or grade below — verify with your local building department — measured at any point within 36 inches of the edge per AWC DCA-6 §8. A deck that is 29 inches above grade at its highest edge does not require a guard under the IRC. However, local codes can be stricter — some jurisdictions require guards at 24 inches. Confirm with your local building department.
How far apart should deck balusters be?
Under IRC 2021 R312.1.3, restated in AWC DCA-6 guard provisions, the openings between balusters (and between the bottom rail and decking) must not allow a 4-inch sphere to pass through. In practical terms, the clear gap between balusters should be less than 4 inches; a 3.5-inch gap is the common field standard per AWC DCA-6. For stair guards, triangular openings formed by the tread, riser, and bottom rail must not allow a 6-inch sphere to pass — the stair sphere-size exception is 6 inches, not 4 — verify with your local building department.
What is the difference between a guardrail and a handrail?
A guard (IRC R312, restated in AWC DCA-6 §8) is the full railing barrier that prevents falls off the side of a deck — it includes posts, balusters, and the top rail. A handrail (IRC R311.7.8, restated in AWC DCA-6 §3 (Stairs)) is a graspable rail along a stairway that you hold while going up or down steps. Many decks need both: a guard along the perimeter and a handrail along the stair run — verify with your local building department. Guards need 36 inches minimum height and pass the 4-inch sphere test — verify with your local building department; handrails need 34 to 38 inches height and specific graspable cross-sections (1.25 to 2 inches diameter for round profiles) — verify with your local building department.
How many balusters do I need for deck railing?
Divide the post-to-post clear span (in inches) by the baluster-plus-gap unit width. For 1.5-inch-wide PT balusters with a 3.5-inch gap (sized to satisfy the 4-inch sphere rule in AWC DCA-6 guard provisions), each unit equals 5 inches; a 10-foot (120-inch) section needs approximately 23 balusters. Use the calculator above to enter your section length and baluster width for an estimated count per section — the tool deducts post widths automatically before computing.
Do I need a handrail on deck stairs?
Yes, if your deck stairs have 4 or more risers — IRC 2021 R311.7.8, restated in AWC DCA-6 §3, requires a handrail on at least one side of any stair flight with four or more risers. The handrail must be 34 to 38 inches above the tread nosing line and run continuously for the full length of the flight. If your deck has only 2 or 3 steps, the IRC 2021 does not require a handrail, though local codes may.
How far apart should deck railing posts be?
AWC DCA-6 Figure 30 (the deck construction guide aligned with IRC) prescribes post spacing of no more than 6 feet on center for a 2x4 cap rail — verify with your local building department — and no more than 8 feet on center for a 2x6 cap rail per AWC DCA-6. Many composite railing systems limit post spacing to 6 feet or 8 feet based on their section lengths per TimberTech installation specifications — always check your specific manufacturer installation guide. The calculator uses 8 feet as the default maximum for pressure-treated wood with a 2x6 cap rail — verify with your local building department.
Can deck railing posts be 4x4?
Yes — IRC 2021 R507.10.2, restated in AWC DCA-6, allows 4x4 pressure-treated posts for deck guards. However, the 2021 IRC explicitly prohibits notching 4x4 posts at their connection to the deck framing (a change from pre-2021 editions). Posts must use approved post-base hardware (such as an ABA44 post anchor or equivalent) that connects the full-depth post to the rim joist or framing without cutting into the post — verify with your local building department.
What wood do I need for deck railing posts?
IRC R507.10.2, restated in AWC DCA-6, requires railing posts to be pressure-preservative treated lumber per R317.1.1(A). For posts that will be in ground contact or within 6 inches of soil, use UC4A-rated or UC4B-rated PT lumber (brown-tagged) per AWC DCA-6. For above-ground applications (post bolted to rim joist with no soil contact), UC3B (green-tag) is sufficient. Confirm the use-category label on the lumber end-tag before purchasing — "pressure-treated" alone does not specify the preservative retention level — verify with your local building department.
Does composite deck railing have the same post spacing rules?
No — composite railing manufacturers (Trex, TimberTech AZEK, Fiberon) sell engineered section kits with fixed maximum lengths that limit post spacing per TimberTech installation specifications. Trex Transcend: 8-ft sections maximum per Trex installation guidance. TimberTech AZEK standard rails: up to 10-ft sections (Reserve Rail over-the-post can span 16 ft) per TimberTech. Fiberon Symmetry: typically 6 to 8 ft. Exceeding the manufacturer maximum section length voids the warranty and can cause rail sagging. These are manufacturer warranty limits — surface them via the calculator material warning above, and verify against your specific product installation guide before purchasing.
Troubleshooting Tips
Post-install deck railing problems and how to inspect them. Severity ranges from high (structural, life-safety) to low (cosmetic, expected behavior). Click any item to expand.
My deck inspector failed my railing — what did they likely check?
My railing posts are wobbling — is that a safety hazard?
My stair handrail was flagged during inspection even though it is the right height — why?
My balusters measure 4 inches apart but the inspector failed the sphere test — what went wrong?
My composite railing is sagging in the middle — what is wrong?
My composite railing creaks and clicks when the temperature changes — is this normal?
My deck has stairs but the stairs only have 3 risers — do I still need a handrail?
My deck is right at the IRC guard-required threshold in one corner — does it need railing, and how do I measure the threshold correctly?
How to measure. Hold a 4-ft level horizontal at the deck edge with one end against the deck board; let a tape hang vertically from the level to the ground directly below the edge — that vertical drop is the controlling dimension, not the slope of the grade. Where grade slopes, take readings at the low point within 36 inches horizontally of the railing per AWC DCA-6 §8.
Per-corner check. Measure each corner separately per AWC DCA-6 §8. If grade slopes away from the house and one corner reads 31 in (AWC DCA-6 §3 (restates IRC §R312.1.1)) while another reads 29 in, the 31-in corner section requires a guard while the 29-in section does not under the IRC. Confirm with your local building department before omitting railing — some jurisdictions trigger at 24 in.
My pressure-treated railing posts are rotting at the base — how do I prevent this?
My railing meets dimensional minimums but I want to raise it taller (42 in) for safety — can I do that? Verify with your local building department.
My railing looks great but the post caps let water pool inside the hollow posts — is this a problem?
Related Calculators
- Deck Beam CalculatorSize your deck beam per AWC DCA-6 / IRC R507.5 — multi-species span tables, post count, and composite-decking joist spacing gate.Available now →
- Deck Joist CalculatorSize your deck joists first — joist span sets the tributary width input on the deck beam calculator. IRC R507.5 verdict + cantilever rule.Available now →
- Stair CalculatorRisers, treads, total rise and run with IRC R311.7 dimensional checks — for the stair that connects your deck to the ground (and triggers the handrail requirement).Available now →
- Concrete Slab CalculatorCubic yards of concrete, bags, and reinforcement for the footings that support your deck posts. ACI-cited.Available now →
Get notified when we ship new calculators
One concise email per week with the newest calculators and guides. No spam, no affiliate pitches.
By subscribing you agree to our privacy policy. Unsubscribe anytime.
Last updated 2026-05-12 · Formula sources: AWC DCA-6 §3 (restates IRC §R312) + AWC DCA-6 §3 (restates IRC §R311.7.8) + AWC DCA-6 (restates IRC §R507.10) (2021 International Residential Code) · AWC DCA-6 Figure 30 (Prescriptive Residential Wood Deck Construction Guide, plain text reference) · AI-assisted content disclosure · © 2026 Madabusi Ventures LLC