Framing

Railing Calculator

Count balusters and posts for a railing that meets the 4 inch rule.

ft
in
A 2x2 baluster measures 1.5 in. Metal balusters are often 0.75 in.
ft
Six feet maximum for most deck codes. Closer for taller railings.
Balusters needed
Posts needed
Resulting gap in

What you'll need to order

Prices vary by region and haul distance. Get quotes from at least two local suppliers.

How this calculator works

balusters = railing length × 12 ÷ (baluster width + 3.875)

The 3.875 inch gap keeps a 4 inch sphere from passing through, which is the universal code requirement. Working to 3.875 rather than exactly 4 leaves a margin for construction error.

Worked example

With railing length 24 ft, baluster width 1.5 in, post spacing 6 ft, this calculator returns 53.58 .

Frequently asked questions

How far apart can balusters be?

Close enough that a 4 inch sphere cannot pass between them. In practice that means a maximum clear gap of just under 4 inches — most builders work to 3.875 inches to leave a margin.

How many balusters do I need?

Divide the railing length in inches by the baluster width plus 3.875. A 24 ft run with 2x2 balusters needs about 54.

How far apart should railing posts be?

Six feet maximum on most decks, and closer where the railing is tall or the guard load is high. The post connection to the framing, not the spacing, is what usually fails.

How tall does a deck railing have to be?

Thirty-six inches for residential decks under the IRC, and 42 inches in many commercial and some local codes. Measure from the walking surface to the top of the rail.