Deck railing posts = sections + runs − shared corner posts, where each run is split into sections no longer than your post spacing. A 16 × 12 ft deck railed on the front and both ends, with a 4 ft opening for the stairs in the middle of the front, has 36 ft of railing in 6 sections and needs 8 posts, 78 balusters and six 12 ft boards for the top and bottom rails.
How the deck railing is calculated
The calculator adds up the rail runs. On a rectangular deck that is every railed side, less the stair or gate opening: the 16 ft front loses 4 ft in the middle and becomes two 6 ft runs, and the two 12 ft ends stay whole. Each run is divided into equal sections that are no longer than the post spacing (6 ft by default). A run of 6 ft is one section, a run of 12 ft two sections. A section has a post at each end, so a run has one more post than it has sections, and where two runs meet at a corner they share one post.
Sections = ⌈run ÷ post spacing⌉ for each run. Posts = sections + runs − shared corner posts. Balusters per section = ⌈(clear span − max gap) ÷ (width + max gap)⌉.
For the default deck: runs of 6, 6, 12 and 12 ft make 1 + 1 + 2 + 2 = 6 sections and 6 + 4 = 10 posts, minus the two corners where the front runs meet the ends, which are shared: 8 posts. Each section is 72 in between post centers and 68½ in clear between 3½ in posts. That takes (68.5 − 3.75) ÷ 5.25 = 12.3, so 13 balusters, with equal 3½ in gaps. Six sections hold 78 balusters, or 86 with 10% spare.
What goes into the material list
- Posts: 4×4 posts (3½ in square, NIST PS 20). The American Wood Council's DCA 6 requires guard posts of at least 4×4 with an adjusted bending value of 1,100 psi, bolted through to joists or rim joists of at least 2×8.
- Post-mount hardware: DCA 6 says to use only hold-down anchors rated for at least 1,800 lb of tension with a guard up to 36 in high. The list carries one set per post; count the anchors as the maker's instructions say.
- Rails: two 2×4 rails a section, top and bottom. The default job cuts 12 pieces of 68½ in, two from each 12 ft board, so six boards.
- Cap rail: an optional 2×6 laid flat over the posts, one piece per run: three 16 ft boards for the example.
- Balusters: 2×2 wood, 1¼ in spindles or ⅝ in metal balusters; the width is an input. Cut length is the guard height less the top rail and cap, the bottom rail and the 3½ in gap under the bottom rail, about 28 in for a 36 in guard with a cap.
Code limits for a deck railing
Deck guards are required where the walking surface is more than 30 in above grade (IRC R312.1.1, restated in DCA 6). The IRC wants them at least 36 in high (R312.1.2) with openings that do not pass a 4 in sphere (R312.1.3). The baluster spacing calculator gives the exact equal gap and a marking list for one section, and lets you switch to the 100 mm rule used in Canada and New Zealand or the 125 mm one in Australia. Local codes change these numbers, so confirm them with your building department before you order.
Deck railing cost
Railing is priced per linear foot. Fixr's 2023 ranges are $10 to $15 a foot for wood materials, $25 to $50 for aluminum or steel, $50 to $100 for composite and $70 to $125 for cable, and installed prices of $30 to $50, $45 to $85, $80 to $165 and $115 to $175. The calculator scales them by state. For the default 36 ft of wood railing at the US average the range is $1,100 to $1,800 installed with a typical $1,450, or about $450 in materials if you build it yourself. Add the deck, footings and stairs with the deck cost calculator.
Before and after the railing
Posts land on the framing, so size the frame first with the deck calculator and put footings under it with the deck footing calculator. The stair opening leads into the stair tread calculator for the boards, and the stair calculator for the rise and run. Finish the wood with the deck stain calculator. More decks and stairs tools are on the decks and stairs hub.