What is the baluster spacing code for decks and stairs?
Published · Updated · By Sai Nath
Under the IRC (2021 R312.1.3, 2024 R321.1.3), no opening in a required guard may pass a 4 in (102 mm) sphere, so the clear gap between balusters stays under 4 in. Stair sides allow 4 3/8 in; the triangle under the bottom rail, 6 in. Guards are needed above 30 in and stand 36 in high, 34 in on stairs.
The IRC guard rules
A guard is the railing that stops a fall from a deck, porch, balcony, landing, stair or floor edge. The rules are in R312.1 of the 2021 IRC and R321.1 of the 2024 IRC, with the same figures in both.
| Question | Rule | 2021 IRC | 2024 IRC |
|---|---|---|---|
| When is a guard needed? | Where an open-sided floor, deck, porch, stair, ramp or landing is more than 30 in (762 mm) above the floor or grade below, measured anywhere within 36 in (914 mm) of the open edge. Insect screening doesn't count. | R312.1.1 | R321.1.1 |
| How high? | At least 36 in (914 mm) above the walking surface | R312.1.2 | R321.1.2 |
| How high on a stair? | At least 34 in (864 mm) above the line of the nosings; 34 to 38 in (864 to 965 mm) where its top is also the handrail | R312.1.2 | R321.1.2 |
| Largest opening | A 4 in (102 mm) sphere must not pass, from the walking surface up to the required height | R312.1.3 | R321.1.3 |
| Open side of a stair | A 4 3/8 in (111 mm) sphere must not pass | R312.1.3, exception 2 | R321.1.3, exception 2 |
| Triangle at the bottom rail of a stair | The opening between riser, tread and bottom rail must not pass a 6 in (152 mm) sphere | R312.1.3, exception 1 | R321.1.3, exception 1 |
| Strength | 200 lb at any point on the top; balusters and infill panels 50 lb pushed sideways on 1 sq ft | Table R301.5 | Table R301.5 |
| Deck guard posts | Loads carried to the joists; 4x4 posts that take the load at the top must not be notched where they fix to the deck | R507.10 | R507.10 |
Is 4 inches the gap or the spacing?
It is the clear gap. The code tests openings with a ball, so what counts is the empty space between two balusters, face to face. On centres it is the gap plus one baluster: with 1 1/2 in (38 mm) balusters, a 4 in gap is 5 1/2 in on centres, and balusters set 4 in on centres leave only 2 1/2 in between them. Treat 4 in as a line to stay under, not a target: wood bows and shrinks, so work to a smaller gap such as 3 7/8 in (98 mm). With turned or tapered balusters the gap is widest where they are thinnest; check it there.
How do I work out baluster spacing?
Measure the clear distance between the post faces, L. Choose the largest gap you will allow, g, under 4 in. With balusters w wide:
- Balusters: n = (L − g) ÷ (w + g), rounded up to a whole number.
- Gap: (L − n × w) ÷ (n + 1). There is one more gap than balusters, because the end gaps run to the posts.
- On centres: gap + w.
Rounding n up keeps every gap at or under g; rounding down opens them up.
Worked example: 96 in between posts with 1 1/2 in balusters
8 ft (96 in, 2438 mm) clear between two posts, 2x2 balusters (1 1/2 in, 38 mm, actual size) and a largest gap of 3 7/8 in (98 mm).
- Balusters: (96 − 3.875) ÷ (1.5 + 3.875) = 92.125 ÷ 5.375 = 17.14, rounded up to 18.
- Width of the balusters: 18 × 1.5 = 27 in.
- Gap: (96 − 27) ÷ 19 = 3.63 in, about 3 5/8 in (92 mm). Under 4 in. ✓
- On centres: 3.63 + 1.5 = 5.13 in, about 5 1/8 in (130 mm).
- Marking: the side of baluster k away from the first post sits k × 5.13 in from that post: 5 1/8, 10 1/4, 15 3/8 and 20 1/2 in, on to 92 3/8 in for the 18th, which leaves 3 5/8 in to the far post. Work each mark from the decimal sum; adding 5 1/8 in eighteen times drifts about 1/8 in.
- At the edge of the rule: aiming just under 4 in, (96 − 4) ÷ 5.5 = 16.7 rounds up to 17 balusters with gaps of (96 − 25.5) ÷ 18 = 3.92 in. That passes with about 1/12 in (2 mm) to spare, so one bowed baluster can fail the ball test.
Baluster counts for common sections
Worked with the formula above, gaps no more than 3 7/8 in, clear distance between post faces.
| Between posts | 1 1/2 in balusters (2x2) | 3/4 in balusters (metal) |
|---|---|---|
| 36 in (914 mm) | 6, gaps 3.86 in (98 mm) | 7, gaps 3.84 in (98 mm) |
| 48 in (1219 mm) | 9, gaps 3.45 in (88 mm) | 10, gaps 3.68 in (94 mm) |
| 60 in (1524 mm) | 11, gaps 3.63 in (92 mm) | 13, gaps 3.59 in (91 mm) |
| 72 in (1829 mm) | 13, gaps 3.75 in (95 mm) | 15, gaps 3.80 in (96 mm) |
| 96 in (2438 mm) | 18, gaps 3.63 in (92 mm) | 20, gaps 3.86 in (98 mm) |
| 120 in (3048 mm) | 22, gaps 3.78 in (96 mm) | 26, gaps 3.72 in (95 mm) |
The IRC sets no spacing for guard posts. For a manufactured railing it comes from the maker's instructions; other guards follow those instructions or engineering (R507.10.4).
On stairs: 4 3/8 in and the 6 in triangle
Along the open side of a stair the limit loosens to 4 3/8 in (111 mm), and the guard is measured 34 in up from the nosing line. Balusters stand plumb, so the gap that matters is the level one between them. With 10 in treads, two 1 1/2 in balusters per tread are 5 in apart on centres and leave 3 1/2 in gaps ✓; one per tread would leave 8 1/2 in ✗. With 11 in treads, two per tread leave 4 in: fine on the stair, under 4 3/8 in, but too wide on a level landing, where the 4 in sphere and the 36 in height apply again.
At the bottom rail, the triangle between the riser, the tread and the rail must not pass a 6 in (152 mm) sphere. Keep the bottom rail close to the line of the nosings and test it with a 6 in ball or template.
Bottom rails, cable, glass and windows
- The 4 in rule runs from the walking surface up to the required height, so the gap under a deck guard's bottom rail must be under 4 in too.
- Above the required height it stops: on a 42 in guard, openings above 36 in aren't limited by R312.1.3 or R321.1.3.
- Cable, horizontal boards and panels get the same 4 in sphere test. The guard section has no rule about horizontal infill that children could climb; ask your building department before you choose it.
- Glass in guards and railings counts as a hazardous location for glazing, and structural glass baluster panels need an attached top rail or handrail (R308.4.4; R324.4.4).
- An opening window whose sill is less than 24 in above the floor and more than 72 in above the ground outside must not pass a 4 in sphere unless it has an opening control or fall prevention device (R312.2; R321.2).
A guard that isn't required, on a deck 30 in or less above grade, isn't bound by these figures in the model code, though they are a sensible guide.
Baluster Spacing in MeisterCalc
Open Home ▸ Baluster Spacing in feet and inches and enter Run 96" and Baluster Width 1 1/2"; Max Spacing starts at 3 7/8", just under the 4 in sphere. It shows Number of Balusters 24, Between Balusters 2 3/8" and On Centres 3 7/8", draws the section, and lists each baluster's leading edge and centre in a running table that Speak reads aloud. Its count is ⌈Run ÷ Max Spacing⌉ − 1 = ⌈24.8⌉ − 1 = 24. Rounding up keeps every gap under Max Spacing, but dividing the whole run by the gap leaves the baluster width out, so it uses more balusters than the fewest that pass. Both layouts pass; for the 18-baluster layout, use the formula above. Baluster Spacing comes with Pro: see Baluster Spacing in MeisterCalc.
Before you build
These are the model IRC figures. Your state or city may adopt a different edition or amend the guard rules, so check with your local building department, and follow the railing maker's instructions for posts and fixings. Neither this page nor the app makes a guard pass inspection. Other countries test with other balls: 125 mm in Australia, 100 mm in New Zealand and England.
Sources
Checked on 2 November 2026. These pages explain the rules; the code itself, your plans and your council, building consent authority, building control body or certifier decide what a job needs.
- 2021 IRC, Chapter 3 Building Planning (ICC): R312.1.1 to R312.1.3 guards, R312.2 window fall protection, Table R301.5 guard loads, R308.4.4 glazing in guards (checked 1 November 2026)
- 2024 IRC, Chapter 3 Building Planning (ICC): R321.1.1 to R321.1.3 guards (the same figures, renumbered), R321.2, Table R301.5, R324.4.4 (checked 1 November 2026)
- 2021 IRC, Chapter 5 Floors (ICC): R507.10 exterior guards on decks, R507.10.2 unnotched 4x4 posts, R507.10.4 other guards (checked 1 November 2026)
- 2024 IRC, Chapter 5 Floors (ICC): R507.10, unchanged apart from the reference to R321 (checked 1 November 2026)
Do the maths in MeisterCalc
MeisterCalc does the arithmetic behind these rules on an Android phone, with no signal needed: Stairs, Concrete and Check Square are free, and the other calculators come with Pro. It runs on Android 7.0 or later.