Baluster spacing calculator

Enter the clear length between two posts and the baluster width. Example: 6 ft posts on center with 3 1/2 in posts leave 68.5 in between them. With 1 1/2 in balusters, (68.5 − 4) ÷ (1.5 + 4) = 11.73, so 12 balusters are needed: the 13 equal gaps are (68.5 − 12 × 1.5) ÷ 13 = 3.885 in (about 3 7/8 in), under the IRC's 4 in sphere limit, and the balusters sit 5.385 in (about 5 3/8 in) on center. Eleven would leave 4.333 in gaps, too wide. Four such sections take 48 balusters.

How to use this calculator · what to enter and what the result means

On stairs, enter the length between posts measured level (horizontally), not along the sloped rail: vertical balusters are spaced level. Choosing a location sets the maximum opening to the code figure; you can type a smaller one.

Balusters per section
–
Gap between
–
On center
–
Total balusters
–
First baluster center
–
Gaps per section
–

–

    How the calculator works

    –

    A section with N balusters between two posts has N + 1 gaps: one between each pair of balusters and one at each post. With every gap equal, the gap is g = (L − N × b) ÷ (N + 1), where L is the clear length between the posts and b the baluster width. The calculator finds the fewest balusters for which g is less than the maximum opening m. Solving g < m for N gives N > (L − m) ÷ (b + m), so N is that value rounded down, plus one. In “a gap I choose” mode it finds the fewest balusters whose gap is no wider than your target, N ≥ (L − t) ÷ (b + t), rounded up, and shows the exact gap that results. The on-center spacing is g + b, and the first baluster's center is g + b ÷ 2 from the face of the post.

    Why “less than” and not “up to” 4 in: the code says guards “shall not have openings … that allow passage of a sphere 4 inches (102 mm) in diameter.” A gap of exactly 4 in is as wide as the sphere, so it does not stop it; the gap has to be smaller. The calculator therefore treats a gap equal to the maximum as a fail. Wood balusters can twist, bow and shrink after they are fastened, so many builders aim for 3 1/2 to 3 3/4 in; set the maximum opening or a target gap lower if you want that margin.

    Metric uses 1 in = 2.54 cm exactly; the millimetres in the code text are the code's own rounded figures, and the checks use the inch values.

    IRC guard rules used

    From the 2021 International Residential Code, Section R312.1 Guards (ICC Digital Codes). The 2024 IRC has the same wording, renumbered as Section R321.1.

    RuleCode text (2021 IRC)Section
    Where guards are required“Guards shall be provided for those portions of open-sided walking surfaces, including floors, stairs, ramps and landings that are located more than 30 inches (762 mm) measured vertically to the floor or grade below at any point within 36 inches (914 mm) horizontally to the edge of the open side. Insect screening shall not be considered as a guard.”R312.1.1
    Guard height“Required guards at open-sided walking surfaces, including stairs, porches, balconies or landings, shall be not less than 36 inches (914 mm) in height as measured vertically above the adjacent walking surface or the line connecting the nosings.”R312.1.2
    Guard height on stairsException 1: “Guards on the open sides of stairs shall have a height of not less than 34 inches (864 mm) measured vertically from a line connecting the nosings.” Exception 2: “Where the top of the guard serves as a handrail on the open sides of stairs, the top of the guard shall be not less than 34 inches (864 mm) and not more than 38 inches (965 mm) as measured vertically from a line connecting the nosings.”R312.1.2
    Openings (the 4 in sphere)“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.”R312.1.3
    Stair triangleException 1: “The triangular openings at the open side of stair, formed by the riser, tread and bottom rail of a guard, shall not allow passage of a sphere 6 inches (153 mm) in diameter.”R312.1.3
    Openings on stairsException 2: “Guards on the open side of stairs shall not have openings that allow passage of a sphere 4 3/8 inches (111 mm) in diameter.”R312.1.3

    The opening rule applies to the whole guard from the walking surface up to the required height, so the gap under the bottom rail counts as an opening too. Infill other than balusters (panels, cables, glass) must meet the same sphere rule. The code also has load requirements for guards, which this calculator does not check.

    Your city or county may have adopted a different edition of the IRC, or its own amendments. Check with your local building department before you build; its code and inspector have the final word.

    Balusters per section for common lengths

    Clear length between posts1 1/2 in balusters, under 4 in2 1/2 in balusters, under 4 inStairs: 1 1/2 in, under 4 3/8 in
    36 in6 · gap 3.857 in (≈ 3 7/8)5 · gap 3.917 in (≈ 3 15/16)6 · gap 3.857 in (≈ 3 7/8)
    44.5 in8 · gap 3.611 in (≈ 3 5/8)7 · gap 3.375 in (≈ 3 3/8)7 · gap 4.250 in (≈ 4 1/4)
    48 in9 · gap 3.450 in (≈ 3 7/16)7 · gap 3.813 in (≈ 3 13/16)8 · gap 4.000 in (≈ 4)
    60 in11 · gap 3.625 in (≈ 3 5/8)9 · gap 3.750 in (≈ 3 3/4)10 · gap 4.091 in (≈ 4 1/16)
    68.5 in12 · gap 3.885 in (≈ 3 7/8)10 · gap 3.955 in (≈ 3 15/16)11 · gap 4.333 in (≈ 4 5/16)
    72 in13 · gap 3.750 in (≈ 3 3/4)11 · gap 3.708 in (≈ 3 11/16)12 · gap 4.154 in (≈ 4 1/8)
    80.5 in14 · gap 3.967 in (≈ 3 15/16)12 · gap 3.885 in (≈ 3 7/8)13 · gap 4.357 in (just under 4 3/8)
    92.5 in17 · gap 3.722 in (≈ 3 3/4)14 · gap 3.833 in (≈ 3 13/16)16 · gap 4.029 in (≈ 4)
    96 in17 · gap 3.917 in (≈ 3 15/16)15 · gap 3.656 in (≈ 3 11/16)16 · gap 4.235 in (≈ 4 1/4)

    Fewest balusters with every gap equal and strictly under the limit, worked out with the same formula as the calculator. 44.5, 68.5 and 92.5 in are the clear lengths for posts 4, 6 and 8 ft on center with 3 1/2 in wide posts; 80.5 in is 7 ft on center. Fractions are rounded to the nearest 1/16 in for marking; the decimal gap is the one checked against the limit. For stairs, the length is measured level.

    Laying out the balusters

    • Measure each section. Posts are rarely exactly on their marks, so measure the clear length of every section between the post faces at rail height and run the calculator for each one that differs. Sections that measure the same can share one result: set the number of identical sections.
    • Mark centers from one post. Hook the tape on the post face and mark the first center at the “first baluster center” distance, then every “on center” distance after it. The last gap should match the first; if it does not, the section is not the length you entered.
    • Or use a spacer block. Cut a block to the gap width and set each baluster against it. Check every few balusters that the spacing is not drifting.
    • Check the bottom gap and the top. The space between the deck surface and the bottom rail must also stop a 4 in sphere, and the guard must be at least 36 in high above the deck surface (34 in on the open side of stairs, from the nosing line).
    • Stairs. On the open side of a stair, gaps between balusters may be up to the 4 3/8 in rule, and the triangle under the bottom rail formed by the riser and tread up to the 6 in rule. Measure the run between the posts level; when you mark centers along a sloped rail, the marks are farther apart than the level spacing (level spacing ÷ cosine of the stair angle). The stair stringer calculator gives the stair angle.
    • Count spares. The total is exact; add a few for knots, splits and miscuts.

    Related