Deck Railing & Baluster Calculator

Enter the total railing length. Balusters are spaced so the clear gap never exceeds your maximum.

Important: Guard height, strength and opening limits are code requirements. Verify post attachment and guard loads with the applicable code.

Results update as you type.

Code requires that a 4 in sphere cannot pass. 3⅞ in leaves a margin.

Loading animation…

Watch it explained

A step-by-step video using your numbers: what to enter, what the result means, and a “what if” example. On-screen instructions follow each step as it happens.

Loading animation…
0:00 / 0:00

What the animation shows

The animation and the step-by-step video above use your numbers. Here is the same walkthrough written out for the default example.

Finished frame of the deck railing & baluster calculator animation for the default example
The last frame of the animation for the default example.

What you enter

  • Total railing length: 40 ft.
  • Maximum post spacing: 6 ft.
  • Post width: 3.5 in.
  • Baluster width: 1.5 in.
  • Maximum clear gap: 3.875 in. Code requires that a 4 in sphere cannot pass. 3⅞ in leaves a margin.

What happens, step by step

  1. Posts go up first, at most 6 ft apart, splitting the rail into sections.
  2. Balusters fill each section, spaced so every gap is the same.
  3. 12 per section leaves 3.58 in gaps, under your 3 7/8 in limit.
  4. A 4 in sphere cannot slip through, so the spacing passes.

The answer: balusters is 84.

How it’s calculated

  • Sections = length ÷ max post spacing, rounded up; posts = sections + 1
  • Clear section = (length − posts × post width) ÷ sections
  • Balusters per section = (clear − gap) ÷ (baluster + gap), rounded up
  • Actual gap = (clear − balusters × width) ÷ (balusters + 1)

Worked example

40 ft of railing, posts at most 6 ft apart, 4×4 posts, 1½ in balusters.

Inputs

Total railing length
40 ft
Maximum post spacing
6 ft
Post width
3.5 in
Baluster width
1.5 in
Maximum clear gap
3.875 in

Results

Balusters
84
Posts
8
Sections
7
Balusters per section
12
Actual gap
3.58 in

Load this example into the calculator

Assumptions and limits

  • Straight run with equal sections. Corners and stair rails change the count.

Verify the result against the applicable local code, adopted code edition, manufacturer instructions and project requirements. See our methodology.

Questions

What is the 4 inch rule for balusters?

Residential codes generally require that a 4 in sphere cannot pass through guard openings. Keeping gaps a bit under 4 in allows for wood movement.

How many balusters per foot?

With 1½ in balusters and gaps just under 4 in, expect about 2.2 per foot of clear railing.