Baluster spacing calculator

Work out how many balusters each railing section takes and how far apart to set them, so that every opening is the same and stays under the code’s limit: a 4 in sphere on a deck, 4⅜ in along the open side of stairs. You get the spacing to mark, where the first baluster goes, and the total to buy.

Figures checked October 4, 2026

Center to center. Kits such as Trex Transcend come in 6 ft and 8 ft sections.

in

3½ in for a 4×4, 5½ in for a 6×6, or the width of a post sleeve.

Railing sections of this size, between pairs of posts.

in

Leave blank for the code’s limit: openings under 4 in. Enter less for tighter spacing.

%

Some for splits and bad pieces. There’s no published rule.

One section from your sizes · to scale
48 balusters

12 per section × 4 sections · 3 7/8 in openings

Balusters per section
12
Openings
3 7/8 in
Spacing
5 3/8 in on center
First baluster
Center 4 5/8 in from the post
Clear between posts
68 1/2 in

Keep the bottom rail less than 4 in above the deck: the rule counts from the walking surface, so the gap under the rail is an opening too.

Guards are needed where the deck is more than 30 in above the ground, at least 36 in high (42 in in California).

How the count and spacing are worked out

The calculator starts from the clear length between the faces of the two posts. It finds the fewest balusters that keep every opening, including the two against the posts, under the limit, then spreads them evenly. That is the method YellaWood gives: add one baluster’s width to the clear length, divide by the largest opening plus one baluster, and round up to get the number of spaces.

L = clear length between the posts w = baluster width g = largest opening spaces = (L + w) ÷ (g + w), rounded up balusters = spaces − 1 on center = (L + w) ÷ spaces opening = on center − w first = opening + w ÷ 2 (post face to first center)

One change from the rounding as written: if the division comes out exactly whole, the calculator adds a space. Otherwise the openings would come out exactly at the limit, and the code’s sphere must not pass.

Worked example: 4×4 posts 6 ft apart on center, wood 2×2 balusters

  • Clear length: 72 − 3½ = 68½ in.
  • (68.5 + 1.5) ÷ (4 + 1.5) = 70 ÷ 5.5 = 12.73, rounded up to 13 spaces: 12 balusters.
  • On center: 70 ÷ 13 = 5.385 in, 5⅜ in on the tape. Openings: 5.385 − 1.5 = 3.885 in, about 3⅞ in.
  • First baluster: 3.885 + 0.75 = 4.635 in, 4⅝ in from the post to its center.
  • Four sections: 48 balusters, plus any extra for splits.

Widths matter. Treated 2×2s aren’t all 1½ in: Lowe’s sells one that measures 1.31 in. Twelve of those leave 4.06 in openings in the same section, so it takes 13. Measure the balusters you’re buying.

What the code asks of a guard

The IRC’s guard section (R321 in the 2024 edition, R312 in 2021 and earlier) covers railings on decks, porches and stairs:

  • Where: along open sides of decks and stairs more than 30 in above the ground below.
  • Height: at least 36 in on a deck (42 in in California), and at least 34 in along stairs, measured from a line through the tread nosings.
  • Openings: no opening from the walking surface up to the required height may pass a 4 in sphere. That includes the gap under the bottom rail.
  • Stairs: on the open side of stairs the sphere is 4⅜ in, and the triangle formed by a riser, a tread and the bottom rail of the guard must stop a 6 in sphere.

Posts carry the load

The baluster count doesn’t make a railing strong: the posts and their fastening to the framing do. Fairfax County’s typical deck details space wood guard posts no more than 6 ft apart. Kits such as Trex Transcend come in 6 and 8 ft sections; follow a kit’s instructions for its posts.

Balusters on stairs

On a stair railing the rails slope with the stairs but the balusters stand plumb. A sphere pushed through the railing goes in level, so the opening that counts is the level distance between neighboring balusters. The marks, though, go on the sloping rail, where the spacing is longer by the slope: on center along the rail equals the level on-center distance divided by the cosine of the slope.

Deckorators’ Estate aluminum balusters, ¾ in wide, show the difference. On a deck they go 4½ in on center, leaving 3¾ in openings. On stairs Deckorators spaces them 5½ in apart along the rail; on a 35° stair that is 4.51 in level, which leaves openings of 3.76 in. Enter your riser height and tread run and the calculator works out the slope, measures the openings level, and gives the spacing along the rail.

The triangle at the bottom of each step is checked separately: the bottom rail has to sit low enough over the nosings that a 6 in sphere can’t pass between it and the tread. The deck stair code guide covers the rest of the stair rules.

Baluster sizes and railing kits

BalusterActual widthFewest in a 6 ft section
Wood 2×21½ in12, 3.88 in openings
Treated 2×2 sold at 1.31 in1.31 in13, 3.68 in openings
Trex composite1.418 in12, 3.96 in openings
Round aluminum¾ in14, 3.87 in openings

Fewest balusters for 68½ in between 4×4 posts 6 ft apart on center, from the method above. Widths are from the Southern Forest Products Association’s size table, the Lowe’s listing and Trex’s product profiles.

Kits are often spaced tighter than the minimum. Trex Transcend’s 6 ft sections, with 67⅝ in rails, hold 13 composite balusters; the method above needs only 12, so the kit’s openings are about 3½ in. Its 8 ft sections (91⅝ in rails) hold 18 composite or 20 aluminum balusters. When a kit tells you how many balusters go in a section, use its number: the rail’s brackets and pre-drilled holes are made for it.

The extra field adds a percentage to the total and rounds up to whole balusters. There’s no published rule for it; a few spares cover splits and the odd crooked piece. The deck stain calculator can include the railings when you finish them.

Questions people ask

How far apart should deck balusters be?

Close enough that no opening lets a 4 in sphere through (2024 IRC R321.1.3; R312.1.3 in 2021). The exact spacing depends on the length between the posts, because the openings should all be equal: with 4×4 posts 6 ft apart on center and 1½ in balusters, 12 balusters set 5⅜ in on center leave openings of 3⅞ in. On the open side of stairs the limit is a 4⅜ in sphere.

How many balusters do I need for a 6 ft or 8 ft section?

With 4×4 posts and 1½ in wood balusters, a 6 ft section (68½ in between the posts) takes 12 and an 8 ft section (92½ in) takes 17. Round ¾ in aluminum balusters need 14 and 19. Railing kits often hold more than the minimum: Trex Transcend puts 13 composite or 15 aluminum balusters in a 6 ft section and 18 or 20 in an 8 ft one. With a kit, follow its count.

Where does the first baluster go?

One opening plus half a baluster from the face of the post, measured to the baluster’s center. In the 6 ft example that’s 3⅞ + ¾ = 4⅝ in. From there, mark a center every 5⅜ in; the last opening against the far post comes out the same as the rest.

Does the 4 in rule apply under the bottom rail?

Yes. The rule covers the guard from the walking surface up to its required height, so the gap between the deck boards and the bottom rail can’t pass a 4 in sphere either. Fine Homebuilding’s balustrade guide sets the bottom rail with that in mind.

How tall does a deck railing have to be?

Guards are required where the deck is more than 30 in above the ground, and must be at least 36 in high (2024 IRC R321; R312 in 2021). California raises that to 42 in. Along stairs, guards are at least 34 in high, measured up from a line along the tread nosings.

Are stair balusters spaced differently?

They’re checked against a 4⅜ in sphere instead of 4 in, and the triangle between a riser, a tread and the bottom rail must stop a 6 in sphere. The balusters stand plumb between sloping rails, so the opening is measured level, across the balusters, while the marks are laid out along the rail. Choose Stairs in the calculator and enter the riser and run.

Sources for the numbers on this page

  1. California Building Standards Commission, via Codebook — 2025 California Residential Code, section R321: guards (California raises the height to 42 in) · checked October 3, 2026
  2. Jefferson County, Colorado — Guards: residential requirements under the 2024 IRC · checked October 3, 2026
  3. YellaWood — Pressure-treated balusters (baluster spacing method) · checked October 4, 2026
  4. Fine Homebuilding — Building and installing a site-built balustrade (Scott Grice, March 2020) · checked October 4, 2026
  5. Southern Forest Products Association — Southern Pine standard sizes (nominal and actual dimensions) · checked October 3, 2026
  6. Lowe’s — Severe Weather 2×2×42 in pressure-treated deck baluster (actual 1.31 × 1.31 in) · checked October 4, 2026
  7. Trex — Product profiles and measurements (baluster sizes) · checked October 4, 2026
  8. Trex — Transcend horizontal railing installation, THR-0422 (balusters per section, PDF) · checked October 4, 2026
  9. Deckorators — Estate aluminum baluster installation, sheet 8567 (11/15, PDF) · checked October 4, 2026
  10. Fairfax County, Virginia — Typical deck details, version 2021.0 (1/5/2024, PDF) · checked October 4, 2026

Corrections and updates are logged on the sources page.