Almost everyone searching for deck railing spacing wants one number. Four inches on center, say, written somewhere official, that you hand to a framer and are done with.
That number does not exist. The residential code never says how far apart to put balusters. It describes a ball. A guard, the barrier that keeps people from falling off a deck, has to be built so a sphere of a stated size will not pass through any opening in it. The spacing of the uprights is not the rule. It is the consequence of the rule.
That sounds like a technicality until it costs you a day. Once you are thinking about a ball rather than a tape, the rest of the deck answers itself: the odd gap at the end of a run, the triangle under a stair rail, and why a cable railing that measures correctly still fails.
The Short Answer: Two Questions Wearing One Name
Deck railing spacing is two problems sharing a phrase.
- Post spacing is structural. It is set by the load the railing carries between supports. The code gives the load, not the spacing. The number comes from the system you bought or an engineered design.
- Baluster and opening spacing is geometric. A baluster is one of the vertical uprights. Collectively the balusters, panels or cables filling the frame are the infill. This half answers to the sphere.
Three numbers cover nearly every opening on a deck in Illinois, where towns build on the International Residential Code: 4 inches on level guards, 4-3/8 inches between balusters on the open side of a stair, and 6 inches in the triangle formed by a stair’s riser, tread and bottom rail. Wisconsin runs a separate statewide code and allows 4-3/8 inches on level guards. Small on paper, expensive in the field.
Why the Code Uses a Sphere Instead of a Spacing
A spacing number would have to be rewritten for every shape a railing can take. Square balusters, round ones, twisted iron, a laser cut panel, a cable. A ball does not care about shape.
The IRC language, at R312.1.3, is that a required guard shall not have openings that allow passage of a 4 inch sphere. Two phrases in that sentence carry the weight, and both get dropped in conversation.
- From the walking surface to the required guard height. The test zone is the whole band from the deck boards to the top of the guard, not just the baluster field. The gap under the bottom rail counts. So does the gap where the infill meets a post.
- Allow passage of. It is a pass or fail test, not a dimension. Balusters at 4 inches on center fail, because on center measures middle to middle, and the clear gap has to be under 4 inches, not equal to it.
The top of that band is not arbitrary either. It is the deck railing height a guard has to reach, a separate requirement with its own measuring rules, and the sphere test stops where the guard stops.
Inspectors do not eyeball this. They carry a ball or a gauge and try it, in the places people forget. An inspector kneeling at the bottom rail is not being difficult. That gap is inside the test zone, and it is the opening most often missed on a finished guard.

Post Spacing Answers to Load, Not to Openings
A guard post, or newel post, is the vertical member that carries the railing and transfers what happens to it into the deck frame. Spacing runs center to center.
Here is the surprise. The residential code publishes no maximum post spacing either. IRC Table R301.5 gives two loads instead: 200 pounds concentrated at any point along the top of the guard, and 50 pounds applied horizontally to one square foot of the infill. Since the 2021 IRC that 200 pound load acts outward and downward rather than in any direction, because a guard exists to stop an outward fall. The 50 pound infill load governs the baluster and its fixing, never the post.

A real number comes from the document covering the railing in front of you.
- A listed system carries its own limit. Master Halco’s RailMaster aluminum holds an ICC evaluation report, ESR-5480, allowing 3 inch posts up to 96 inches on center, and 2.5 inch posts up to 74.5 inches in general or 96 inches at a house.
- Composite systems are sold by section length. TimberTech’s Classic Composite and Reserve rails come in 6, 8 and 10 foot lengths and are designed not to exceed those dimensions post center to post center, with an aluminum support rail at 10 feet plus mid span foot blocks.
- Sometimes the manufacturer says no. Trex’s Select install guide carries a compliance table listing the 6 foot railing as IRC compliant and the 8 foot railing as compliant with neither the residential nor the commercial code. That is Trex’s own literature, and 8 foot sections get installed anyway.
- A site built guard has no published number. Nothing was tested as an assembly, so nothing can be listed. Six feet is a trade habit, not a rule. Compliance gets shown through the code’s opening and load path rules plus the American Wood Council’s post details in DCA 6, or by an engineer.
A listing is conditional. Run a listed railing past the spacing in its report and the installation is no longer covered, even though every part is identical. The 2021 IRC requires guard posts on decking to be installed per approved manufacturer’s instructions, which makes a printed spacing a code question rather than a warranty question.
What actually fails is the attachment, not the span
Push 200 pounds outward at the top of a 36 inch post and it tries to rotate about its base. The short lever arm multiplies the force enormously, and InterNACHI puts it at roughly 1,700 pounds at the upper bolt. Testing at Virginia Tech, reported by Mike Guertin in Professional Deck Builder, found the weak link is not that bolt but where the rim joist, the board closing the ends of the floor joists, attaches to those joists.
Hence Section R507.10 in the 2021 IRC. Guard loads need a continuous load path into the deck joists, a joist carrying a guard post must be tied to its neighbors so it cannot rotate, and notching a 4×4 post at the connection is prohibited. DCA 6 adds a 2×8 minimum at the member a post attaches to. A 2×6 cannot meet the standard at any post spacing.
None of that is a spacing decision. It is a framing one, which is why framing a deck so the posts land right is worth settling before anyone orders railing, rather than after the deck boards are down.
Working a Baluster Layout Backward from the Sphere
Once the posts are placed, the infill is arithmetic and it runs one direction. On center spacing equals the clear opening plus the width of one baluster. Since the opening has to be under the sphere, most builders in Illinois target about 3-7/8 inches rather than a flat 4, so there is somewhere to be wrong.
| Baluster | Roughly what that gives on center | The thing that trips people |
|---|---|---|
| 3/4 in square aluminum | About 4-5/8 in | A rounding error repeats across every opening in the run |
| 1 in round metal | About 4-7/8 in | Measure the real diameter, not the catalog nominal |
| 1-1/4 in turned wood | About 5-1/8 in | Narrowest at the middle, and that is where the ball goes |
| 1-1/2 in wood, a 2×2 | About 5-3/8 in | Actual width is 1-1/2 in, so a layout drawn off 2 in fails |
Figures are arithmetic from a 3-7/8 inch target opening under the Illinois 4 inch sphere, not code values. Measure your own stock, and confirm the governing sphere with the department that inspects the deck.
The layout itself is three steps.
- Measure the clear run. Inside face of one post to inside face of the next, at the deck, not off the plan.
- Divide by your target on center spacing and round up. Rounding up adds an opening and shrinks every gap. Rounding down grows them all, which is the direction that fails.
- Divide the clear run by that number of openings. That is your real gap. Add one baluster width and you have the layout.
The gap that catches people is at each end, where the infill meets the post. The arithmetic almost never comes out even and the leftover lands there. TimberTech prints a 4 inch maximum between end balusters and posts in its own guide, which tells you how often that gap gets treated as scrap. It is inside the test zone like every other opening.
One more separation, because the word spacing does a lot of work here. Gaps between deck boards are a different family of numbers, driven by drainage and movement. If you are chasing board gaps and fastener specs, that lives on the decking spec sheet and says nothing about the railing.
Stairs Change the Sphere Twice on the Same Flight
A stair guard is the one place a single railing legitimately holds three opening limits at once. A homeowner who measures the deck and the stairs and finds different numbers has not found a mistake.
| Where on the stair | IRC sphere | Why it is that size |
|---|---|---|
| Between balusters on the open side | 4-3/8 in | Exception 2 to R312.1.3 allows a larger opening here |
| The triangle at riser, tread and bottom rail | 6 in | Exception 1. A sloped bottom rail forms a triangle at every tread |
| Anywhere the guard returns to a level surface | 4 in | A landing is a level walking surface, so the level rule returns |
The nosing line is the imaginary slope connecting the front edges of the treads. Stair guard heights differ from deck guard heights too, a separate requirement from the opening rules.
The 6 inch triangle is geometry rather than leniency. A stair bottom rail follows the slope, so between every tread and the riser above it sits a wedge the rail cannot close without dropping absurdly low or being cut into a sawtooth. The code accepts a larger opening there, and nowhere else.
So stop treating the stair as a separate layout. Cut the stair balusters to the level run spacing and one number goes up the stairs instead of two, because a layout satisfying the 4 inch rule automatically satisfies the 4-3/8 inch one. Keep the separate graspable handrail in mind too: it is what a hand wraps around going up and down, and a wide flat top rail is not one.
Illinois Says 4 Inches. Wisconsin Says 4-3/8. That Gap Fails Inspections.
This service area straddles a code line and the line is real. Illinois municipalities build on the International Residential Code, and since January 2025 state law requires local structural codes to be at least as stringent as the IRC. Above that floor each town picks its edition and writes its amendments, and the building department is the final word.
Wisconsin does not work that way. Its Uniform Dwelling Code, at Wisconsin Administrative Code SPS 320 through 325, is statewide and mandatory for one and two family dwellings. It is not a baseline. It is the code.

Four numbers differ across that line. Wisconsin triggers a required guard at more than 24 inches above grade rather than more than 30. It permits a 4-3/8 inch sphere on a level guard rather than 4 inches, applied with 4 pounds of force. It requires a graspable handrail at more than 3 risers rather than 4 or more, and allows that handrail from 30 to 38 inches above the nosing line rather than 34 to 38.
For a crew working both sides, the opening number bites in one direction only. A baluster layout drawn to Wisconsin’s 4-3/8 inch sphere is legal in Kenosha and fails inspection in Barrington. The reverse is safe, so cut one layout to the tighter number and stop carrying two. An extra baluster per section costs nothing next to a rework.
Inside Illinois, do not assume the next town matches. Unincorporated Lake County publishes a deck guideline based on the 2024 IRC, and it governs no incorporated village inside the county. Naperville’s guide references the 2018 IRC. Several towns here publish nothing useful online, so call the village. One call settles the sphere, the edition and any amendment.
Cable Railing: Where Spacing Becomes a Deflection Problem
Cable gets its own section because it is the common system where a correct drawing still produces a failing railing. Cable is not rigid. Push a hand into a cable field and the cables spread. The test asks whether a sphere passes through the guard as built, under hand pressure, not what the drawing shows. So cables start closer together than the sphere, to leave room for the spreading.
Two manufacturers publish spacings for their own systems, and they do not agree.
- Atlantis Rail Systems calls for a maximum of 3 inches between cables, to avoid deflection exceeding 4 inches, with posts or cable stabilizers no more than 4 feet apart. It also states its system typically sees up to 25 percent deflection under reasonable pressure, which turns 3 inch spacing into roughly 3.75 inch gaps.
- Viewrail calls for cables every 3-1/8 inches vertically, with posts kept within four feet of each other.
Three inches and 3-1/8 inches. Both are manufacturer figures for their own hardware and neither is a code number, so there is no point splitting the difference. The code number in Illinois is 4 inches. How a system gets there is the manufacturer’s problem and yours to follow.
The half installers actually violate is the post spacing. Cables at 3 inches with posts at 6 feet still fails, because deflection scales with the unsupported run. Intermediate posts and cable stabilizers exist for that reason. They carry no tension, which the end posts and the frame take. They shorten the span and limit how far the cable moves.
The horizontal infill question, answered properly
Somebody always says horizontal rails and cables are banned because children climb them. That prohibition was real, in the 2000 International Residential Code, which banned guards built with horizontal rails or an ornamental pattern producing a ladder effect. It was deleted in the 2001 cycle and was never in the commercial code at all. The International Code Council’s own record shows every later attempt to reinstate it was rejected as too vague to enforce.
The caveat is that a jurisdiction on an old code, or an individual inspector, can raise it anyway. Ask before you build.
Frequently Asked Questions
What is the maximum spacing between deck railing balusters?
There is no published maximum spacing, only a maximum opening. On a level guard in Illinois a 4 inch sphere must not pass through, so the clear gap has to be under 4 inches. Wisconsin allows 4-3/8 inches instead.
How far apart should deck railing posts be?
Whatever the system’s own documentation allows. The code gives loads rather than a spacing, so the number comes from the evaluation report or install guide, and it ranges from 4 feet on cable to 96 inches on some listed aluminum. Six feet is a habit, not a rule.
Can I trust a deck railing spacing calculator?
For the arithmetic, yes. For compliance, no. A calculator divides a run into even openings. It does not know which state you are in, whether your town amended the code, or whether your balusters are the width the catalog says.
Why is stair railing spacing different from the deck?
Because a sloped bottom rail unavoidably forms a triangle with every tread and riser. The IRC allows 6 inches there and 4-3/8 inches between stair balusters, while the level run stays at 4 inches. Cutting the stair to the level layout keeps you safe under all three.
Does the gap under the bottom rail count?
Yes, and it is the one most often missed. The test zone runs from the walking surface to the required guard height, so an opening under the bottom rail is tested exactly like one between balusters.
Do these spacing numbers apply in Wisconsin?
Not all of them. Wisconsin’s statewide code allows a 4-3/8 inch sphere applied with 4 pounds of force, and triggers a guard at more than 24 inches above grade rather than 30. A layout drawn to the Illinois 4 inch sphere works in both states.
The Bottom Line
Deck railing spacing stops being confusing once you accept that it is two questions. The posts answer to load, and their real limit is printed in the documentation for the system you bought, or does not exist if the guard is site built. The infill answers to a sphere, tested everywhere from the deck boards to the top of the guard, not just in the pretty part between the uprights.
Before anyone cuts a baluster, settle three things: which state’s rule governs the address, which code edition the town adopted, and whether the product has a published post spacing you are about to exceed. That is one phone call and one look at an install guide.
If you remember one thing, remember the ball. It is a test, not a spacing, and the inspector will try it in the spot you were not thinking about.