Deck Railing Calculator

Railing posts = one per section plus one per run, less shared corners: a 16 × 12 ft deck railed on three sides with a 4 ft stair opening needs 8 posts at 6 ft spacing.

Units
Measure by
Deck length
ft
in

Front and back sides.

Deck width
ft
in

Out from the house.

Sides with a railing
in

Subtracted from the railing. 0 for none.

Opening sits
in

6 ft is a common limit for wood sections.

in

36 in in the IRC (R312.1.2).

in
in

Widest gap you accept.

%

Spare balusters for bad boards and cuts.

Deck railing posts

8posts

36 ft of railing in 6 sections, 86 balusters and 6 rail boards, after taking out a 4 ft opening.
Railing length
36 ft
Sections
6
Balusters
86
Rail boards
612 ft
Cap boards
316 ft
Widest gap
3 ½in
House16 ft12 ft

Railing cost installed, typical

$1,450

Low $1,100High $1,800

Labor and material prices are scaled to typical levels in your state.

$1,100 to $1,800 for 36 linear ft. US ranges per linear foot from Fixr (2023), scaled by state.

The math
  1. Railing length

    sum of the railed sides less the 4 ft opening = 36 ft

  2. Sections

    each run ÷ 72 in maximum spacing, rounded up = 6 sections

  3. Posts

    6 sections + 4 runs − 2 shared corner posts = 8 posts

  4. Balusters per section

    (clear span − 3.75 in) ÷ (1.5 in + 3.75 in), rounded up, clear span = spacing − 3.5 in post = 78 in all

  5. Rails

    6 sections × 2 rails cut from 12 ft boards = 6 boards

Material list

36 ft of railing, 8 posts, 86 balusters

QuantityItem
8pcs

4×4 posts

cut to the 36 in guard height plus the joist depth each one laps

8sets

Post-mount hardware (hold-down anchors and bolts)

DCA 6: anchors rated 1,800 lb tension for a 36 in guard; count per the anchor maker

6pcs

2×4 rails, 12 ft

12 rail pieces, top and bottom, cut 68 ½ in and longer between posts

3pcs

2×6 cap rail, 16 ft

one piece per run, laid flat over the posts

86pcs

Balusters, 1 ½ in wide

about 28 in long, 78 plus 10% spare, gaps under 4 in

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.