Deck Railing Calculator
A deck railing calculator that counts posts, rail sections, balusters, post caps and hardware for the whole guard, including the angled balusters on each stair.
By CalcBuilt Editorial TeamUpdated September 9, 2026Formulas checked against manufacturer specs, see how we calculate.
Results
- Balusters
- 87 balusters
- 78 on 6 level sections plus 9 cut to the stair angle of 34 degrees. Add 5% for splits and short cuts
- Guard posts
- 9 posts
- 6 level sections plus 1, and 2 per stair. DCA 6 wants 4x4 nominal minimum bolted to a rim or outside joist of 2x8 or deeper. Add one post at every corner the layout does not already land on
- Rails and cap
- 14 rails
- A top and a bottom rail per section, each about 6 ft long, plus 40.4 ft of continuous 2x6 cap. A bottom rail over 6 ft takes a foot block at mid-span
- Post caps and hardware
- 9 caps
- 18 half-inch through bolts with washers, 9 hold-down anchors rated 1,800 lb (8 kN), and about 348 baluster screws at 2 per end
- Gap and cut length
- 3.5 in
- Actual clear gap on a level section. Stair sections come out at 3.63 in. Balusters cut 28.5 in for a 36 in guard, measured from the finished deck surface
- Planning estimate
- Verify on site
- Measure every opening before ordering, since deck posts rarely land on equal centers. The local code and the inspector govern the guard, and a licensed pro should size any attachment this table does not cover
Deck Railing formula
Sections = (Guarded edge - openings) / post spacing, rounded up
Balusters per section = (post spacing x 12 - 3.5) / on-center spacing, rounded up, - 1
Posts = Sections + 1 + 2 per stair; Rails = 2 per section + 2 per stair
Stair rail run = Steps x sqrt(riser² + tread²), and its balusters are cut to that angleWorked example
A wraparound deck with 64 ft of open edge, 8 ft of that taken by two stair heads, posts 5 ft on center, 3/4 in square aluminum balusters at 4.5 in on center, two 6 step stairs. Level guard is 64 - 8 = 56 ft, so 56 / 5 = 11.2, or 12 sections. Each clear opening is 60 - 3.5 = 56.5 in, and 56.5 / 4.5 = 12.6, so 13 minus 1 gives 12 balusters per section, or 144.
Each stair runs 6 x sqrt(7.5² + 11²) = 6 x 13.31 = 79.9 in, so the clear opening is 76.4 in and 76.4 / 4.5 = 17, minus 1 gives 16 balusters per stair, or 32. Total is 176 balusters. Posts are 12 + 1 + 4 = 17, rails are 24 + 4 = 28, and the level gap works out to (56.5 - 12 x 0.75) / 13 = 3.65 in.
Quick reference
| Post spacing | Clear opening | 4-1/2 in OC | 5 in OC | 5-1/2 in OC |
|---|---|---|---|---|
| 4 ft | 44.5 in | 9 | 8 | 8 |
| 5 ft | 56.5 in | 12 | 11 | 10 |
| 6 ft | 68.5 in | 15 | 13 | 12 |
| 7 ft | 80.5 in | 17 | 16 | 14 |
| 8 ft | 92.5 in | 20 | 18 | 16 |
Taking off the whole guard, not just the gap
Start with the guarded edge. On a ledger-attached rectangle that is the three open sides, minus whatever the stair head and any gate take out. Divide by the post spacing and round up for sections. Posts are sections plus one, and each stair adds two more, one at the top landing and one at the bottom bearing on a footing. Every corner that does not already fall on a layout post needs its own.
Balusters come from the clear opening, not the post spacing. A 4x4 is 3.5 inches wide, so 6 foot centers leave 68.5 inches clear. Divide that by the on-center spacing, round up and subtract one, because a section always has one more gap than it has balusters. Stair sections use the sloped run instead: six steps at a 7.5 inch riser on an 11 inch tread is 79.9 inches of rail, and every baluster in it is cut at about 34 degrees top and bottom.
Posts and hardware do the structural work
The guard has to take a 200 pound push in any direction at the top rail (IRC Table R301.5), and nearly all of that load lands on the post connection. DCA 6 calls for a 4x4 nominal post minimum with an adjusted bending design value of 1,100 psi, two half-inch through bolts, and a hold-down anchor rated for 1,800 pounds at a 36 inch guard. The joist or rim it bolts to has to be 2x8 or deeper, because NDS 11.5.1.3 caps the bolt spacing at 5 inches.
Hardware quantity follows the post count: two bolts and washers and one hold-down each, plus a cap. Balusters take two fasteners per end, so 87 balusters is about 350 screws. Use hot dipped galvanized G185, ZMAX or stainless throughout on treated lumber, and stay with one metal. Aluminum balusters come with their own connectors, normally two per baluster, which are not interchangeable between brands.
What this calculator leaves out
The stair handrail. A guard cap is not graspable, so a stair with four or more risers needs a separate Type I or Type II rail 34 to 38 inches above the nosings (IRC R311.7.8), returned to the guard at each end. Also outside the count: the footing under each bottom stair post, the 2x4 bearing block the stringers sit on, lighting at the top landing, and post skirts or trim rings.
It assumes every section is the same width so it can multiply. Real decks are rarely laid out that way, so measure each opening before ordering and expect the end sections to differ. Prebuilt composite and aluminum kits change the arithmetic again, since they ship in fixed 6 and 8 foot lengths with a set baluster count, and cutting one down leaves you buying loose balusters to fill a short run.
Code limits that apply
- IRC R312.1.1
Guard required over 30 in of drop, measured 36 in horizontally from the edge
If you miss it: A deck that clears 30 in only at the far corner on sloping grade gets a guard added after the framing is closed in
- IRC R312.1.2
36 in min guard height from the finished surface, 34 in min above the stair nosings
If you miss it: Posts set to 36 in off the joists finish short once decking is laid, and the whole run comes apart to fix it
- IRC R312.1.3checked
4 in sphere at every opening; 4-3/8 in on a stair open side; 6 in at the tread triangle
If you miss it: One wide gap at a corner post means pulling the cap and respacing the entire section before the re-inspection
- IRC Table R301.5checked
200 lb concentrated load in any direction on the guard, 50 lb per sq ft on the in-fill
If you miss it: Posts set beyond 6 ft on center let the top rail flex under a lean, and the inspector pushes on it
- AWC DCA 6 guard post
4x4 nominal min at 1,100 psi bending, on a 2x8 or deeper rim, with a 1,800 lb hold-down
If you miss it: A post lagged through the decking into the rim pulls out under load and the guard hinges outward
- IRC R311.7.8
Stairs of 4 or more risers get a graspable handrail 34 to 38 in above the nosings
If you miss it: A capped guard with no separate handrail is written up at final and a Type I or II rail is added over the balusters
Rows marked checked produce a warning in the results when an entry crosses the limit. The others are on the plans or on site and this calculator does not test them. Local amendments can be stricter; the adopted edition and the inspector govern.
Mistakes that cost money
- Ordering balusters off the deck perimeter instead of section by section: openings rarely match, and half an inch changes the count.
- Hold-downs rated under 1,800 lb do not meet DCA 6 at a 36 in guard; read the model stamp rather than the bin label.
- Guard post bolts need 5 in maximum vertical spacing (NDS 11.5.1.3), so the outside joist or rim has to be 2x8 or deeper.
- 2x2 cedar sold wet shrinks to about 1-3/8 in, widening every gap by an eighth of an inch after the deck is signed off.
- Composite railing kits ship in fixed 6 and 8 ft lengths, so a 6 ft 4 in section means cutting an 8 ft kit and buying loose balusters.
- Field-cut ends of treated 4x4 posts need a brush coat of copper naphthenate (IRC R402.1.2) or they rot from the cut down.
Key facts
- IRC R312.1.1 requires a guard on any walking surface more than 30 in above the floor or grade below, measured 36 in horizontally from the edge.
- IRC R312.1.2 sets residential guards at 36 in minimum above the finished surface, and allows 34 in minimum measured from the stair tread nosings.
- IRC Table R301.5 requires a guard to resist a 200 lb concentrated load in any direction, and its in-fill to resist 50 lb spread over 1 sq ft.
- AWC DCA 6 requires guard posts of at least 4x4 nominal with an adjusted bending design value of 1,100 psi, attached to a rim or outside joist of 2x8 or deeper.
- A DCA 6 guard post hold-down anchor must carry at least 1,800 lb of tension at a 36 in guard height; a taller guard needs a designed connector.
Frequently asked questions
How many balusters do I need for a deck?
For 40 ft of guarded edge with a 4 ft stair opening, posts 6 ft on center and 1.5 in balusters at 5 in on center, six level sections take 13 each and a 4 step stair takes 9, so 87 balusters plus about 5 percent for splits.
How far apart can deck railing posts be?
6 ft on center is the working limit for a wood guard. The IRC sets no explicit spacing, but Table R301.5 requires the rail to hold a 200 lb push in any direction, and a 2x4 top rail flexes visibly past 6 ft. Composite kits are sold in 6 and 8 ft sections, and the 8 ft versions use a reinforced rail.
How long should deck balusters be?
About 28-1/2 in for a standard 36 in guard: the cap, top rail and bottom rail take 4-1/2 in and the bottom rail sits about 3 in off the deck. Cut a test piece and dry fit one section before cutting the whole bundle.
Do stair balusters have to be cut at an angle?
Yes, both ends, to match the stair pitch. A 7.5 in riser on an 11 in tread gives about 34 degrees. Each step adds 13.3 in of sloped rail, so a 4 step flight has 53 in of rail and takes 9 balusters at 5 in on center.
Sources and references
Next steps for this project
The usual order for a framing, decks & fences project. See all framing, decks & fences calculators.
Results are estimates based on standard formulas and typical product specifications. Confirm quantities with your supplier and local code before ordering.