acalculator

What baluster spacing do I need?

Type the space between posts and the baluster width. The baluster spacing calculator finds the fewest balusters that keep every gap under the 4-inch sphere rule, the even gap to set them at, and the on-center spacing to mark.

Your numbers

Measure in
Balusters per section
13

Use 13 balusters per section, 3.75 in apart.

Gap between balusters
3.75
Gap to the nearest 1/16 in
3 3/4 in
On-center spacing
5.25
Balusters in all
13
Unit
in

Balusters per section: 13. Use 13 balusters per section, 3.75 in apart.

How to calculate

Works out how many balusters fit between two posts so every gap is under the 4-inch sphere rule (IRC R312.1.3), and the exact even gap and on-center spacing.

Example with the default inputs (Measure in Inches, Space between posts 72, Baluster width 1.5, Opening limit 4, Sections 1): Use 13 balusters per section, 3.75 in apart.

Method: n = ⌊(L − g) ÷ (w + g)⌋ + 1 balusters; gap = (L − n w) ÷ (n + 1); on center = gap + w.

  • Each gap must be smaller than the opening limit: a 4 in (102 mm) sphere must not pass (IRC R312.1.3).
  • Balusters are spaced evenly with a full gap at each post.
  • Lengths are exact fractions of the typed decimals, so a gap of exactly the limit is caught.
  • Check your local code: some places adopt other limits, and stair guards have their own exceptions.

Machine-readable copies: Markdown, JSON.

Worked examples

Each example is checked against the calculator on every build.

  1. Measure in Inches, Space between posts 72, Baluster width 1.5, Opening limit 4, Sections 1 gives Balusters per section 13, Gap between balusters 3.75, Gap to the nearest 1/16 in 3 3/4 in, On-center spacing 5.25, Balusters in all 13.Source: International Code Council, 2021 International Residential Code, R312.1.3 Opening limitations (required guards shall not have openings from the walking surface to the required guard height that allow passage of a sphere 4 inches (102 mm) in diameter; stair exceptions 6 in and 4 3/8 in), https://codes.iccsafe.org/content/IRC2021P2/chapter-3-building-planning#IRC2021P2_Pt03_Ch03_SecR312.1.3 (retrieved 2026-10-02)
  2. Measure in Inches, Space between posts 92, Baluster width 1.5, Opening limit 4, Sections 4 gives Balusters per section 17, Gap between balusters 3.694444, Gap to the nearest 1/16 in 3 11/16 in, Balusters in all 68.Source: International Code Council, 2021 International Residential Code, R312.1.3 Opening limitations (required guards shall not have openings from the walking surface to the required guard height that allow passage of a sphere 4 inches (102 mm) in diameter; stair exceptions 6 in and 4 3/8 in), https://codes.iccsafe.org/content/IRC2021P2/chapter-3-building-planning#IRC2021P2_Pt03_Ch03_SecR312.1.3 (retrieved 2026-10-02); Humboldt County, CA, Guards and Window Fall Protection (the 4-inch sphere rule for guard openings and the 4 3/8-inch stair exception), https://humboldtgov.org/3432/Guards-and-Window-Fall-Protection-CRC-R3 (retrieved 2026-10-02)
  3. Measure in Centimeters, Space between posts 180, Baluster width 4, Opening limit 10.16, Sections 2 gives Balusters per section 12, Gap between balusters 10.153846, On-center spacing 14.153846, Balusters in all 24.Source: International Code Council, 2021 International Residential Code, R312.1.3 Opening limitations (required guards shall not have openings from the walking surface to the required guard height that allow passage of a sphere 4 inches (102 mm) in diameter; stair exceptions 6 in and 4 3/8 in), https://codes.iccsafe.org/content/IRC2021P2/chapter-3-building-planning#IRC2021P2_Pt03_Ch03_SecR312.1.3 (retrieved 2026-10-02)
  4. Measure in Inches, Space between posts 36, Baluster width 1.5, Opening limit 4.375, Sections 1 gives Balusters per section 6, Gap between balusters 3.857143, Gap to the nearest 1/16 in 3 7/8 in.Source: International Code Council, 2021 International Residential Code, R312.1.3 Opening limitations (required guards shall not have openings from the walking surface to the required guard height that allow passage of a sphere 4 inches (102 mm) in diameter; stair exceptions 6 in and 4 3/8 in), https://codes.iccsafe.org/content/IRC2021P2/chapter-3-building-planning#IRC2021P2_Pt03_Ch03_SecR312.1.3 (retrieved 2026-10-02)

How it works

Let L be the clear space between the posts, w the baluster width and g the opening limit (4 in by default), all in the same unit (inches or centimeters). With n balusters spaced evenly and a full gap at each post, there are n + 1 gaps of

  • gap = (L − n × w) ÷ (n + 1).

Every gap must be smaller than g, so n must be more than (L − g) ÷ (w + g). The fewest balusters is

  • n = ⌊(L − g) ÷ (w + g)⌋ + 1,
  • on-center spacing = gap + w, and balusters in all = n × sections.

The lengths are exact fractions of the typed decimals, so a case where n − 1 balusters would leave gaps of exactly g is counted correctly.

Rules

  • L is from 0.01 to 100,000; w and g are from 0.01 to 1,000; sections are 1 to 10,000.
  • When L is smaller than g, no balusters are needed, and the page says so instead of giving an answer.
  • 10.16 cm is 4 in exactly (1 in = 2.54 cm).

Output format. Gaps and on-center spacing to 10 significant digits. In inches, the gap is also given to the nearest 1/16 in (halves rounded up, from the exact fraction), as a mixed number: “3 11/16 in”.

Worked examples by hand

72 in, 1.5 in balusters, 4 in limit. (72 − 4) ÷ (1.5 + 4) = 12.36, so n = 13. Gap = (72 − 13 × 1.5) ÷ 14 = 52.5 ÷ 14 = 3.75 in (3 3/4 in); on center 3.75 + 1.5 = 5.25 in. With 12 balusters the gaps would be 54 ÷ 13 = 4.15 in, too wide.

92 in, 1.5 in, 4 in, 4 sections. (92 − 4) ÷ 5.5 = 16 exactly: 16 balusters would leave gaps of (92 − 24) ÷ 17 = 4 in, which a 4 in sphere would pass, so n = 17. Gap = (92 − 25.5) ÷ 18 = 133/36 = 3.694 in (3 11/16 in); 68 balusters in all.

180 cm, 4 cm, 10.16 cm, 2 sections. (180 − 10.16) ÷ 14.16 = 11.99, so n = 12. Gap = (180 − 48) ÷ 13 = 10.1538 cm; on center 14.1538 cm; 24 in all.

Stair guard, 36 in, 1.5 in, 4 3/8 in limit. (36 − 4.375) ÷ 5.875 = 5.38, so n = 6. Gap = (36 − 9) ÷ 7 = 27/7 = 3.857 in (3 7/8 in).

Other questions people ask

What is the 4-inch rule for balusters?

IRC R312.1.3 says required guards must not have openings that let a sphere 4 inches (102 mm) in diameter pass, from the walking surface up to the required guard height. In practice, every gap between balusters must be smaller than 4 inches.

How do I calculate baluster spacing?

Find the fewest balusters n with (space − n × width) ÷ (n + 1) under 4 in: n = ⌊(space − 4) ÷ (width + 4)⌋ + 1. Then the even gap is (space − n × width) ÷ (n + 1). For 72 in and 1.5 in balusters: 13 balusters, 3.75 in apart.

How many balusters do I need for a 6-foot section?

With 1.5 in (2 × 2) balusters and the 4 in rule, a 72 in space between posts takes 13 balusters with 3 3/4 in gaps. With wider balusters you need fewer: 3.5 in balusters take 10, with gaps of about 3.36 in.

Is the gap measured from center to center?

No. The 4 in rule is about the clear opening, from the face of one baluster to the face of the next. The on-center spacing, which you mark on the rail, is the gap plus one baluster width.

Are stairs different?

Yes. On the open side of a stair, the IRC allows openings that stop a 4 3/8 in sphere, and the triangle under the bottom rail at the stair may stop a 6 in sphere. Type 4.375 as the opening limit for a stair guard.

Why aim a little under 4 inches?

Wood shrinks, balusters bow, and an inspector measures the widest opening. Spacing evenly with the fewest balusters already gives gaps under the limit; some builders add one more baluster for a margin.