Deck railing calculator

Enter the length of a railing run. You get how many posts and balusters to buy, spaced so no gap reaches 4 in, and the rails and screws, with a drawing to scale.

Railing

One straight run, from the outside of the first post to the outside of the last

Post spacing, at most

6 ft is usual for wood. Railing kits list their own limit.

Balusters

The IRC limit is 4 in. 3 3/4 in leaves room for boards that move.

Your railing

Balusters

33

11 in each of 3 sections

5 ft 2 13/16 in36 in
Front view of the first two sections, to scale.
  • Posts4 × 4x4
  • Post spacing, centers5 ft 2 13/16 in
  • Gap between balusters3 9/16 in
  • Balusters33 × 2x2, 29 1/2 in long
  • Top rail1 × 2x6, 16 ft
  • Bottom rail3 × 2x4, 8 ft
  • Baluster screws132, two at each end

Code check

  • Gaps 3 9/16 inUnder 4 in
  • Bottom rail 3 1/2 in upUnder 4 in
  • Height 36 inIRC minimum

How to space deck balusters

  1. Measure the run from the outside of the first post to the outside of the last: 16 ft is 192 in.
  2. Space the posts no more than 6 ft (72 in) apart. Take off one post width and divide: (192 − 3 1/2) ÷ 72 = 2.6, so 3 sections and 4 posts, 5 ft 2 13/16 in center to center.
  3. The clear space between two posts is the spacing minus a post: 59 5/16 in.
  4. Each baluster and one gap take 1 1/2 + 3 3/4 = 5 1/4 in, and a section has one more gap than balusters: (59 5/16 − 3 3/4) ÷ 5 1/4 = 10.6, rounded up to 11 balusters.
  5. Share out what's left evenly: (59 5/16 − 11 × 1 1/2) ÷ 12 = 3 9/16 in gaps. Cut a spacer block to that width and every baluster lands in the same place.

Deck railing code

  • When you need one. Any deck surface more than 30 in above the ground within 36 in of its edge needs a guard (IRC Section R312.1.1).
  • Height. At least 36 in above the deck (Section R312.1.2). Some towns require 42 in.
  • Gaps. A 4 in ball must not pass through anywhere from the deck boards up to that height (Section R312.1.3). That covers the space under the bottom rail too. On the open side of stairs the limit is 4 3/8 in, and the triangle under the stair rail can take 6 in.
  • Strength. The top of the railing must hold a 200 lb push in any direction, and the balusters 50 lb on a square foot (IRC Table R301.5). The posts and how they're bolted to the deck carry most of that.

Many towns adopt the IRC with changes, so check your local code.

Railing posts

Space wood posts no more than about 6 ft apart, center to center. Composite, vinyl, aluminum and cable railing kits come with their own limits, often 6 or 8 ft, and their own post mounts. Wood posts are usually 4x4s bolted through the rim joist with blocking behind it, so the top of the post can take that 200 lb push. Your building department may have a standard detail for it.

Posts and balusters by railing length

Railing length Posts Post spacing Balusters Gaps
4 ft 2 3 ft 8 1/2 in 8 3 3/16 in
6 ft 2 5 ft 8 1/2 in 12 3 9/16 in
8 ft 3 3 ft 10 1/4 in 16 3 3/8 in
10 ft 3 4 ft 10 1/4 in 20 3 9/16 in
12 ft 3 5 ft 10 1/4 in 24 3 3/4 in
14 ft 4 4 ft 6 13/16 in 30 3 1/4 in
16 ft 4 5 ft 2 13/16 in 33 3 9/16 in
20 ft 5 4 ft 11 1/8 in 40 3 11/16 in
24 ft 5 5 ft 11 1/8 in 52 3 7/16 in

One straight run with 4x4 posts at most 6 ft apart and 2x2 balusters, gaps at most 3 3/4 in. For railing on more than one side, count each side; a corner post serves both sides.

Questions

How far apart should deck railing posts be?

For a wood railing, no more than about 6 ft apart, center to center. Railing kits set their own limit, often 6 or 8 ft, so follow the maker's instructions. A 16 ft run at 6 ft or less takes 4 posts, 5 ft 2 13/16 in apart.

How far apart should balusters be on a deck?

Close enough that a 4 in ball can't pass between them (IRC Section R312.1.3). With 2x2 balusters that's a gap of 3 1/2 to 3 3/4 in, or about 5 1/16 in center to center. Aim under 4 in, not at it: boards shrink and move.

How many balusters do I need for a 16 ft railing?

33 2x2 balusters with gaps of 3 9/16 in: 11 in each of the 3 sections between 4 posts. A 12 ft railing takes 24.

How many balusters per foot of railing?

About 2.2 per foot for 2x2s with gaps just under 3 3/4 in, after leaving room for posts every 6 ft. Count each run with the calculator, because posts and corners change the number.

How tall does a deck railing need to be?

At least 36 in above the deck under the IRC (Section R312.1.2), measured to the top of the rail. Some towns and states require 42 in, so check your local code. Stair handrails are lower: 34 to 38 in above the tread nosings.

Does my deck need a railing?

Yes if any part of the deck surface is more than 30 in above the ground within 36 in of its edge (IRC Section R312.1.1). Lower decks can go without one, though many people add a railing anyway. The deck calculator adds it for you above 30 in.