Guardrail & Baluster Calculator
Space balusters evenly so no gap passes a 4-inch sphere, and check guard height against the code — residential (IRC) or commercial (IBC).
The clear opening between the two guard posts.
Width of one picket — 1½″ for a 2×2, ¾″ for many metal balusters.
- 11 balusters give an even 3.63″ gap — under the 4.00″ maximum (a sphere that size must not pass).
- Gaps are equal at each end (post-to-baluster) and between balusters.
Guard requirements — Residential (IRC)
2021 IRC §R312.1- Where required: Measured to the floor or grade below at any point within 36″ horizontally.
The rules behind the numbers
A guard (often called a guardrail) protects the open side of a walking surface more than 30" above what's below it (IRC §R312.1.1 / IBC §1015.3). Residential guards are at least 36" tall (IRC §R312.1.2); commercial guards at least 42" (IBC §1015.2). The infill — balusters, cable, or panels — must not let a 4" sphere pass from the walking surface to the guard height (IRC §R312.1.3 / IBC §1015.4), with a 6" sphere at the triangular opening beside a stair.
Because the sphere must not pass, a gap exactly equal to the sphere is non-compliant — so aim for clear gaps under 4". The baluster count above is sized for a gap strictly under your chosen maximum. Sizing the stair itself? Use the stair calculator; for accessible handrail geometry see ADA clearances.
These are model-code values (2021 IRC / IBC). Your jurisdiction's adopted edition and local amendments can differ, and ICC codes are copyrighted — we cite the sections and link out rather than reproduce the code. Verify the governing numbers with your AHJ.
Frequently asked questions
How tall does a guardrail have to be?
Residential guards must be at least 36 inches high (2021 IRC §R312.1.2). Commercial guards must be at least 42 inches (2021 IBC §1015.2). Guards on the open side of residential stairs may be 34 inches from the nosing line. Always verify against your adopted code and AHJ.
What is the 4-inch sphere rule for balusters?
Guard openings must not allow a 4-inch sphere to pass, from the walking surface up to the required guard height (IRC §R312.1.3 / IBC §1015.4). Because the sphere must not pass, a gap of exactly 4 inches fails — so keep clear gaps under 4 inches. At the triangular opening formed by a stair's riser, tread, and bottom rail, a 6-inch sphere must not pass.
How do I space balusters evenly?
Balusters divide the railing span into equal gaps — one at each post plus one between each pair. This tool finds the fewest balusters that keep every gap under your maximum, then reports the even gap and on-center spacing so you can lay it out from either post.
Where is a guardrail required?
On open-sided walking surfaces — decks, porches, balconies, landings, and stairs — more than 30 inches above the grade or surface below (IRC §R312.1.1 / IBC §1015.3).
Related tools
- Stair Stringer CalculatorStringer length, plumb/level cut angles, and the framing-square rise & run — plus the cut-stringer throat check.
- Stair CalculatorRisers, riser height, tread run, and pitch from a rise — cited to IRC R311.7.
- ADA Clearances & DimensionsTurning space, doors, toilets, counters, reach ranges & more — diagrams cited to the 2010 ADA Standards.