Baluster Calculator
Enter your railing length, post count and baluster size, and this baluster calculator returns how many balusters you need, the even gap between them, the on-center spacing and what to buy — checked against the 4-inch code limit.
The International Residential Code (IRC) requires that a 4-inch sphere cannot pass through any opening in a deck guard, so the gap between balusters must stay under 4 inches — this calculator caps the desired gap at 4 inches and flags any result over it. Standard square balusters are 1.5 inches wide (a 2x2 nominal), round balusters are typically 0.75 inch, and standard 4x4 posts are 3.5 inches wide. Decks 30 inches or more above grade need a guard at least 36 inches high. This is a planning estimate, not a code approval — verify spacing, height and local rules with your building department before ordering.
How the baluster calculator works
Subtract the total post width from the railing length to get the net span, then divide by one baluster width plus the desired gap and round down — a partial baluster cannot be bought. The actual gap is then recalculated so every gap is identical: (net span minus balusters times width) divided by (balusters + 1), because there is one more gap than balusters, counting the two end gaps. On-center spacing is baluster width plus the actual gap, the distance from the center of one baluster to the next. Order 10% extra for cuts, defects and measurement mistakes.
Worked example: a 12-foot railing with three 3.5-inch posts and 1.5-inch balusters at a 3.5-inch desired gap. Net span is 144 - (3 x 3.5) = 133.5 inches. Dividing 133.5 by (1.5 + 3.5) = 5.0 gives 26.7, rounded down to 26 balusters. The actual gap is (133.5 - 26 x 1.5) / 27 = 94.5 / 27 = 3.50 inches, on-center spacing is 1.5 + 3.50 = 5.00 inches, and with 10% extra you buy 29 balusters — $87 at $3 each. A 10-foot section the same way needs 22 balusters at a 3.8-inch actual gap; a 6-foot section needs 13 at a 3.9-inch gap.
Common mistakes: measuring the full railing length without subtracting the posts, spacing by eye instead of recalculating the even gap (the end gaps end up different), and forgetting the 4-inch sphere rule — a 4.5-inch gap fails inspection even if the railing looks fine. Round balusters (0.75 inch) need roughly the same count as square ones because the spacing is measured between balusters, not center to center. Pressure-treated wood balusters run about $1 to $3 each, cedar $2 to $5, aluminum $3 to $8 and composite $4 to $10. The Deck Stair Calculator sizes the stairs that meet this railing.
net span (in) = railing length x 12 - posts x post width · balusters = floor(net span / (width + gap)) · actual gap = (net span - balusters x width) / (balusters + 1) · buy = ceil(balusters x (1 + waste%))
Related tools
Also try the Deck Stair Calculator for the stairs, the Deck Post Spacing Calculator for post layout, and the Deck Build Cost Calculator for the whole deck budget.
Baluster calculator FAQ
How many balusters do I need?
Divide the net span (railing length minus post widths) by one baluster width plus the desired gap, and round down. A 12-foot railing with three 3.5-inch posts and 1.5-inch balusters at a 3.5-inch gap needs 26 balusters.
What is the maximum baluster spacing allowed?
The IRC requires that a 4-inch sphere cannot pass through any opening in a deck guard, so gaps must stay under 4 inches. This calculator flags any result over 4 inches — aim for 3.5 to 3.9 inches so the layout passes with margin.
What is on-center spacing?
The distance from the center of one baluster to the center of the next, equal to baluster width plus the actual gap. For 1.5-inch balusters at a 3.5-inch gap it is 5.00 inches — useful for marking out the layout on the rail.
How many balusters per foot of railing?
About 3 per linear foot with standard 1.5-inch square balusters at the code-maximum gap. A typical 6-foot railing section uses 13 balusters, a 10-foot section 22, and a 12-foot section 26.
Should I buy extra balusters?
Yes — order 10% extra for cuts, defects and measurement mistakes. For a 26-baluster run that is 29 balusters; a 10 to 15% allowance is the published guidance.
What size are standard balusters?
Square wood balusters are typically 1.5 inches wide (a 2x2 nominal); round metal balusters are usually 0.75 inch in diameter. Standard 4x4 posts are 3.5 inches wide.
How high must a deck railing be?
The IRC requires a guard at least 36 inches high on decks 30 inches or more above grade, with no opening that passes a 4-inch sphere — including the gap between the bottom rail and the deck surface. Some jurisdictions require 42 inches.