Railing & Baluster Spacing Calculator
Enter your railing length to get post count, baluster count per section, actual spacing, and total rail count — with automatic IRC 4" sphere rule checking. All inputs saved in the URL.
Enter total railing length to see your material list.
What do these results mean?
Posts — the vertical structural posts anchored to the deck frame. Spaced at your chosen interval.
Sections — the spans between posts. Each section gets its own set of balusters.
Balusters per section — the number of vertical spindles in each span. Calculated so the actual gap ≤ your max gap.
Actual gap — the precise spacing between each baluster after distributing them evenly. Must be < 4" to pass IRC inspection.
Total balusters — balusters per section × number of sections. This is your lumber-yard quantity.
Total rails — sections × rail rows. Buy this many horizontal rail boards.
Shopping List
Enter railing length to generate a shopping list.
Important: Minimum railing height for residential decks ≥ 30" above grade is 36" (IRC R312). Local codes may require 42". Verify with your building department. See our code requirements guide.
Related Calculators
Methodology
How the baluster calculator works.
Posts and sections
Posts = ⌈ length ÷ post spacing ⌉ + 1. Each span between two posts is one section. Sections = posts − 1.
Balusters per section
For each section (in inches): n = ⌈ (sectionLength − maxGap) ÷ (balusterWidth + maxGap) ⌉.
The actual gap after spacing n balusters evenly: gap = (sectionLength − n × balusterWidth) ÷ (n + 1). This gap is always ≤ the requested max gap.
IRC 4" sphere rule
The calculator hard-caps the maximum gap at 4 inches — the IRC requirement that a 4-inch sphere cannot pass through any railing opening. The actual gap displayed is what passes inspection, assuming your posts are also properly spaced and anchored.
Rails
Total rails = sections × rail rows. If your railing system uses 2 rails (top and bottom), multiply sections by 2. Most residential wood railing systems need 2 horizontal rails per section.
FAQ
Frequently asked questions.
What is the 4-inch sphere rule for balusters?
The IRC requires that a 4-inch sphere cannot pass through any opening in a railing. This means the gap between any two balusters — or between a baluster and a post — must be less than 4 inches. This calculator enforces a hard maximum of 4" and displays the actual calculated gap so you can verify compliance.
What is the minimum railing height for a residential deck?
IRC Section R312 requires guards (railings) on decks 30 inches or more above grade. The minimum height for residential guards is 36 inches. Some local codes require 42 inches. This calculator outputs railing linear footage; height is specified separately in your railing system.
How are balusters calculated per section?
For each section between posts: balusters = ⌈(section length − max gap) ÷ (baluster width + max gap)⌉. The calculator then computes the actual equal gap that results, ensuring it never exceeds the IRC 4" maximum.
What is a typical post spacing for deck railings?
Most railing systems use posts spaced 4–8 feet on center, with 6 feet being common. This calculator defaults to 6 feet. The maximum post spacing depends on your railing system's structural rating — composite and aluminum systems often allow up to 8 feet.
Can I use this as a baluster spacing calculator?
Yes — that is exactly what the per-section calculation does. Enter your total railing run and post spacing to get the baluster count per section and the exact gap between each baluster.
Can I save my railing calculation?
Yes — all inputs are saved in the URL. Bookmark the page or share the link to save your exact calculation.