📏 Baluster Calculator: Count, Spacing, Layout, and Code
Deck railing, stair railing, multi-section — count, spacing, layout, and cost
| Railing Length | @ 4″ gap, 1.5″ bal. | @ 3″ gap, 1.5″ bal. | Rule of 3/ft |
|---|---|---|---|
| 4 ft (48″) | ~8 | ~10 | 12 |
| 6 ft (72″) | ~13 | ~16 | 18 |
| 8 ft (96″) | ~17 | ~21 | 24 |
| 10 ft (120″) | ~22 | ~27 | 30 |
| 12 ft (144″) | ~26 | ~33 | 36 |
| 16 ft (192″) | ~35 | ~44 | 48 |
| 20 ft (240″) | ~44 | ~55 | 60 |
Related Calculators
- Decking Calculator — Estimate deck boards and materials for your deck surface
- Board and Batten Calculator — Calculate board spacing and quantity for siding
- Square Footage Calculator — Measure deck or porch area for any shape
- Concrete Calculator — Estimate concrete for deck footings and post bases
- Board Foot Calculator — Calculate lumber volume for deck framing
This baluster calculator gives you the exact number of balusters for any railing section, the actual gap between each one, and center-to-center spacing for marking layout. Enter your railing length, post count, post width, baluster width, and maximum gap. The result is instant and includes a visual layout preview and a live IRC code compliance check.
The tool covers level deck railings, stair railings with rake angle, multi-section project totals, and a full spacing code guide. Use it before buying materials to avoid a second trip to the lumber yard and before installing to avoid failing a building inspection.
What Is a Baluster and Why the Count Matters
A baluster is one of the vertical members that fills the open space between railing posts. They are also called spindles, especially on stairs. Together with the top rail, bottom rail, and posts, balusters form the complete balustrade, which is the safety barrier on a deck, porch, balcony, or staircase.
Getting the count right matters for two reasons: safety code and material ordering. Buy too few and you make a second trip. Buy too many and you absorb the extra cost. Order without calculating first and you risk a spacing that fails the building inspector’s 4-inch sphere test.
- Posts define the sections. Balusters fill each section between posts.
- Every baluster takes up width, which reduces the space available for the gaps.
- The gap is what code regulates, not the center-to-center distance.
- A 1/8-inch error in spacing, repeated across 25 balusters, shifts your final gap by over 3 inches.
How to Calculate the Number of Balusters
The formula has four steps. All measurements must be in the same unit before you start.
- Subtract post space from railing length. Multiply post count by post width and subtract from total railing length. A 120-inch railing with 2 posts at 3.5 inches each leaves 120 minus 7 = 113 inches available.
- Divide by baluster unit width. Add one baluster width to your target gap. For a 1.5-inch baluster with a 4-inch gap: 1.5 + 4 = 5.5 inches per unit.
- Divide and round up. 113 / 5.5 = 20.5, rounded up to 21 balusters.
- Recalculate the actual gap. Actual gap = (available space minus total baluster width) divided by (number of balusters plus 1). This gives the true even spacing, which is almost never exactly your target.
The baluster calculator on this page runs all four steps automatically and shows the actual gap in the result panel, not just the input gap.
The Baluster Spacing Formula
Number of balusters = floor [ (Rail Length – Posts x Post Width) / (Baluster Width + Max Gap) ]
After getting the count, recalculate the actual gap:
Actual gap = (Available Space – Count x Baluster Width) / (Count + 1)
This actual gap is the number that matters for code inspection. It tells you the real clear distance between each baluster face. If it is under 4 inches, you pass. If it is over 4 inches, you need one more baluster.
Worked Example: 10-Foot Level Railing
Railing length: 120 inches. Posts: 2 at 3.5 inches each. Baluster width: 1.5 inches. Target gap: 4 inches.
- Available space: 120 – (2 x 3.5) = 113 inches
- Unit width: 1.5 + 4 = 5.5 inches
- Baluster count: floor(113 / 5.5) = 20
- Actual gap: (113 – 20 x 1.5) / (20 + 1) = (113 – 30) / 21 = 83 / 21 = 3.952 inches
- Code compliant: yes (3.952 inches is under 4 inches)
- Center-to-center: 1.5 + 3.952 = 5.452 inches
Add 10 percent for waste and breakage: 20 x 1.10 = 22 balusters to order.
Baluster Spacing Code Requirements (IRC 2024)
Building codes in the United States regulate the gap between balusters through the International Residential Code (IRC), which most states adopt for one- and two-family residential construction. The relevant section is IRC R312.1.3.
The IRC mandates that required guards shall not have openings that allow passage of a sphere 4 inches in diameter. This applies to the spaces between balusters, between the bottom rail and the deck surface, and between a post and the nearest baluster.
During an inspection, an inspector may use a physical 4-inch ball to test every opening in the railing. If the ball passes through at any point, the railing fails. Always calculate for the clear gap between baluster faces, not the center-to-center distance.
When Is a Railing Required?
According to the 2024 IRC, guards shall be provided for portions of open-sided walking surfaces located more than 30 inches above the floor or grade below at any point within 36 inches horizontally of the open edge. In plain terms:
- Decks less than 30 inches above grade: no railing required by IRC, though local codes may differ.
- Decks 30 inches or more above grade: railing required, minimum 36 inches tall.
- Commercial buildings and multifamily structures follow the International Building Code (IBC), which has stricter load and height requirements.
Railing Height Requirements
- Residential decks under 30 inches above grade: no railing required by IRC.
- Residential decks 30 inches and above: 36-inch minimum railing height.
- Decks more than 30 inches above grade (some jurisdictions): 42-inch minimum may apply.
- Stair handrail height: 34 to 38 inches measured vertically above the nose of each step.
Local amendments often add stricter requirements. Always verify with your local building department or authority having jurisdiction (AHJ) before finalizing your design or pulling a permit.
Stair Railing Spacing Rules
The spacing between balusters on stairs is allowed to be 4-3/8 inches. The triangular space beneath the bottom rail and stair treads and risers must prevent a 6-inch sphere from passing through.
This means stair railings get a small additional allowance on the standard gap but the triangular opening at the base of each baluster (formed by the tread, riser, and bottom rail) has a tighter check. Most builders target 4 inches on stairs as well to stay comfortably inside both limits.
How to Use the Baluster Calculator
Tab 1 handles level deck and porch railings. Tab 2 handles stair railings. Tab 3 tracks totals across multiple sections of a project. Tab 4 is the code and reference guide.
For a level railing on Tab 1:
- Enter the railing length between the inside faces of the two end posts.
- Enter the number of posts in the section.
- Select the unit (inches, feet, mm, or cm).
- Enter the post width and baluster width at their widest point.
- Set the maximum gap. The default is 4 inches, the IRC maximum.
- Optionally enter a price per baluster for a cost estimate.
- Check the waste box to add 10 percent to the order count.
The result shows total balusters to order, actual gap, center-to-center spacing, the IRC compliance status, and a scaled visual layout of the full section.
For stair railings on Tab 2, enter the horizontal run and total rise of the stair. The calculator converts those two dimensions to the rake length using the Pythagorean theorem, then calculates the baluster count along the slope. The rake angle is shown in degrees so you can cut balusters or order pre-cut stair balusters at the correct length.
Baluster Spacing by Material Type
Baluster width varies significantly by material. Using the wrong width in the formula produces the wrong count.
Wood Balusters
Standard wood balusters are cut from 2×2 lumber, which has an actual dimension of 1.5 inches x 1.5 inches. Some decorative turned balusters are wider at the widest point. Thicker balusters like 2×2 wood require fewer units to fill a space than thin spindles. Always measure at the widest face for code purposes, since the narrowest gap is what the inspector measures.
- 2×2 pressure-treated pine: 1.5 inches actual width
- Cedar 2×2: 1.5 inches actual width
- Decorative turned wood: measure the widest point, typically 1.75 to 2.25 inches
- Wood balusters (2×2 pressure-treated or cedar) cost $1 to $2 each.
Composite Balusters
Composite balusters are typically 1.5 inches square, the same as a wood 2×2. Some manufacturers produce 2-inch composite balusters for a more substantial look. Composite does not warp, splinter, or rot, but it expands slightly with heat, so leave the gaps fractionally wider than the code minimum in hot climates.
- Standard composite: 1.5 inches wide
- Heavy composite: 2 inches wide
- Composite balusters run $3 to $5 each.
Metal Balusters (Aluminum and Wrought Iron)
Metal balusters have much smaller profiles than wood. Round aluminum spindles are typically 0.75 inches in diameter. Square aluminum balusters are usually 0.75 inches or 1 inch square. Iron balusters are typically 0.5 to 0.75 inches square. The thinner the baluster, the more units you need to fill the same railing length.
- Round aluminum: 0.75-inch diameter. Use 0.75 inches as the baluster width.
- Square aluminum: 0.75 or 1 inch. Use the actual face dimension.
- Wrought iron twist: measure at the widest twist point.
- Aluminum balusters cost $4 to $8 each but last the longest with zero maintenance.
Cable Railing
Cable railing replaces vertical balusters with horizontal stainless steel cables. The spacing rule still applies: cables must be spaced close enough that a 4-inch sphere cannot pass through between them or under the bottom cable. Standard cable spacing is 3 inches center-to-center, which prevents horizontal passage as well as diagonal access. Cable railing does not use this calculator. Count cables by dividing the post height by the cable spacing instead.
Glass Panel Railing
Glass infill panels have no individual balusters. The panel count and frame post spacing determine the material list. For glass railing, calculate the number of panels by dividing the total railing length by the panel width plus the frame post width.
Measuring Your Railing Section Correctly
Measurement errors at this stage create wrong counts, failed inspections, and extra material trips. Follow these steps for every section.
- Measure between post faces, not center to center. The baluster space starts at the inside face of one post and ends at the inside face of the next.
- Measure each section separately. If your deck has multiple railing sections between posts, calculate each one independently. Do not add all sections together and calculate once.
- For tapered balusters, measure at the widest point. Code inspectors check the narrowest gap, which occurs at the widest part of the baluster.
- For stair railings, measure along the slope. Do not measure the horizontal run alone. The rake length (hypotenuse of run and rise) is the correct input for baluster count on stairs.
- Account for corners and transitions. Corners where two railing sections meet may require a shared post or a separate corner post. Each side of the corner is a separate section.
Center-to-Center Spacing for Layout Marking
Once you have the baluster count and actual gap, center-to-center (c-to-c) spacing is the number you use to mark positions on the top and bottom rail before installation.
Center-to-center = baluster width + actual gap
For the worked example above: 1.5 + 3.952 = 5.452 inches center-to-center.
To mark positions on the rail: start from the first post face, add half a baluster width (0.75 inches for a 1.5-inch baluster) to find the first center mark, then step off at 5.452-inch intervals. Mark every center, then drill or cut at each mark. This method distributes any rounding error evenly across the whole run instead of pushing it to one end.
Common Mistakes When Planning Baluster Layout
- Measuring from the center of the post instead of the face. This overstates the available space by the full post width, which gives you one too few balusters.
- Using the target gap as the actual gap. The actual gap is almost never the same as your target gap once balusters are distributed evenly. Always recalculate after getting the count.
- Calculating all sections as one length. A 40-foot deck with four sections between posts is four separate calculations, not one calculation for 40 feet.
- Using the center-to-center distance for code compliance. Inspectors measure the clear gap between faces. A 5.5-inch center-to-center with a 1.5-inch baluster leaves a 4-inch gap, which is the absolute maximum. Any rounding that makes c-to-c 5.501 inches produces a gap over 4 inches and fails.
- Forgetting the waste allowance. Balusters crack, split, and get cut wrong. Adding 5 percent overage for cuts, breakage, or measurement adjustments is cheap insurance. The calculator’s waste checkbox adds 10 percent, which covers even complex installs.
- Using baluster width from the packaging label instead of a tape measure. Manufacturing tolerances mean the actual width may differ from the nominal width. Measure the actual piece.
How Many Balusters Do I Need: Quick Reference
The table below uses 2 posts at 3.5 inches each, 1.5-inch-wide balusters, and a 4-inch maximum gap. Use it for a fast rough estimate before running the full calculation.
| Railing Length | Balusters @ 4″ max gap | Balusters @ 3.5″ gap | Order qty (with 10% waste) |
|---|---|---|---|
| 4 ft (48 in) | 8 | 9 | 10 |
| 6 ft (72 in) | 12 | 14 | 16 |
| 8 ft (96 in) | 17 | 19 | 21 |
| 10 ft (120 in) | 20 | 23 | 26 |
| 12 ft (144 in) | 25 | 28 | 31 |
| 16 ft (192 in) | 34 | 38 | 42 |
| 20 ft (240 in) | 42 | 47 | 52 |
For metal balusters at 0.75-inch width, add approximately 20 to 25 percent more balusters to the count above. The thinner the baluster, the more units needed to maintain the same maximum gap.
Baluster Cost Estimates by Material
Material cost is the easiest variable to control if you have an accurate count before ordering. The table below covers current average retail pricing per baluster in the US market.
| Material | Width | Cost per baluster | Per 10-ft section (20 balusters) |
|---|---|---|---|
| Pressure-treated pine 2×2 | 1.5 in | $1.00 to $2.00 | $20 to $40 |
| Cedar 2×2 | 1.5 in | $2.00 to $3.50 | $40 to $70 |
| Composite | 1.5 in | $3.00 to $5.00 | $60 to $100 |
| Square aluminum | 0.75 to 1 in | $4.00 to $8.00 | $130 to $260 (25 balusters) |
| Round aluminum | 0.75 in | $3.50 to $6.00 | $115 to $195 (25 balusters) |
| Wrought iron | 0.5 to 0.75 in | $5.00 to $12.00 | varies by design |
Enter your price per baluster in the calculator to get a total cost estimate for the exact count your railing section requires.
Frequently Asked Questions
How far apart should balusters be?
The gap between balusters must be less than 4 inches per IRC R312.1.3. Most builders target 3.5 to 3.75 inches to stay inside that limit with a safety margin. On stairs, the gap along the rake may be up to 4-3/8 inches, but the triangular opening at the base of each baluster must prevent a 6-inch sphere from passing through.
How do I calculate how many balusters I need?
Subtract the total post width from the railing length to get available space. Divide by (baluster width + target gap) and round up. Then recalculate the actual gap using (available space minus total baluster width) divided by (baluster count plus 1). That actual gap is the number that determines code compliance.
What is the 4-inch rule for balusters?
The gap between balusters cannot exceed 4 inches. Picture a 4-inch sphere, roughly the size of a young child’s head. Building codes are written so that sphere cannot pass through any opening in your railing. This rule applies to the clear space between baluster faces, not the center-to-center measurement.
What is center-to-center spacing?
Center-to-center (c-to-c) is the distance from the center of one baluster to the center of the next. It equals baluster width plus actual gap. For a 1.5-inch baluster with a 3.952-inch gap: c-to-c = 5.452 inches. This is the measurement you mark on the rail before drilling or cutting.
Do I need a baluster at each end of the section?
No. The posts themselves serve as the boundaries of the section. The first and last balusters sit against the posts with the same gap as between any two balusters. There is no extra baluster at each end, only a gap between the post face and the first baluster face. The calculator accounts for this in the formula.
How many balusters per foot of railing?
At 4-inch maximum gap with 1.5-inch wood balusters, the rule of thumb is 3 balusters per linear foot of railing. For 0.75-inch aluminum balusters at the same gap, the count rises to about 3.5 to 4 balusters per foot. Use the rule of thumb for quick estimates only. Use the calculator for ordering quantities.
Do stair balusters use the same spacing as deck balusters?
The same 4-inch maximum gap applies to stair railings. However, the balusters are measured along the rake (the slope of the stair) rather than horizontal, which means the same gap produces a different count than a level railing of the same horizontal length. The stair railing tab handles the rake geometry automatically.
Should I add extra balusters for waste?
Yes. Adding 5 percent overage for cuts, breakage, or measurement adjustments is cheap insurance. For wood and composite, 10 percent is the standard recommendation since cuts and splits are more common. For metal balusters, 5 percent is usually sufficient. The waste checkbox in the calculator adds exactly 10 percent to the order count.
Related Calculators
This tool is part of the Construction Calculator collection at calculatorzhub, covering estimating tools for decking, framing, concrete, and more.
- Decking Calculator — Estimate deck boards and materials for your deck surface
- Board and Batten Calculator — Calculate board spacing and quantity for board and batten siding
- Square Footage Calculator — Measure deck or porch area for any shape
- Concrete Calculator — Estimate concrete for deck footings and post bases
- Board Foot Calculator — Calculate lumber volume in board feet for framing
Conclusion
Accurate baluster count comes from four inputs: railing length, post dimensions, baluster width, and the maximum gap you are designing to. The baluster calculator on this page handles the formula, recalculates the actual gap from the count, checks the result against the IRC 4-inch rule, and shows a visual layout so you can see the spacing before you buy. Use it per section, add the waste allowance, and confirm the final count with the multi-section planner before placing your material order.

