Why use our Baluster Spacing Calculator?
- Three markets, treated equally United States (IRC, IBC, inches), Pakistan and India (NBC, millimetres). Each has its own code presets, default gap, terms and currency. The language is a separate choice.
- Four ways to calculate A flat run, a stair rake (stepped or single slope), several sections in one project, or a count you already know.
- A code check on every layout PASS or FAIL against IRC R312.1.3, the IBC, the Building Code of Pakistan or NBC 2016, or your own maximum gap.
- A stair rake that handles the slope Angle, rail length, balusters per tread, the horizontal gap that codes measure, the gap along the rail and the end cut angle.
- A printable blueprint A to-scale drawing and a markout table with the centre and both edges of every baluster, one page per section.
- Waste and pack size 5%, 10%, 15% or your own waste, rounded up to full boxes.
- Fasteners and cost Screws, brackets and adhesive tubes, with a material list and total cost in dollars or rupees.
- Free API and embed A JSON API with the markout list, and an iframe widget. No key needed.
- Three languages, no ads English, Hindi and Urdu (right to left). Everything runs in your browser.
How to use the Baluster Spacing Calculator
Pick your market, then the mode. A flat run needs the clear distance between the post faces, the baluster width and the code. It starts as a US deck rail: 96 in, 1.5 in balusters and the IRC 4 in limit. Results update as you type, and you can enter 96, 3 15/16, 8 ft or 2.4 m.
The tool finds the fewest balusters that keep every gap at or under the limit, then spaces them evenly. For a stair, enter the run, rise and number of treads: a single slope spaces the balusters along the rail, while stepped puts the same number on every tread. Several sections lets you add each run with its own width and gap. If you already know the count, use I know the count.
Set waste and pack size, add fasteners and prices for a material list, then press Print layout for a blueprint or copy a share link. Below the results are the to-scale drawing, the markout list and the step by step working.
Fewest balusters n = ⌈(L − g) ÷ (w + g)⌉ Clear gap = (L − n × w) ÷ (n + 1) On-center = gap + w Centre of baluster i = i × gap + (i − 0.5) × w Stair: angle = atan(rise ÷ run), gap along the rail = horizontal gap ÷ cos(angle)
Worked examples
United States: 96 in between posts, 1.5 in balusters, IRC 4 in. n = ⌈(96 − 4) ÷ 5.5⌉ = ⌈16.73⌉ = 17. Gap = (96 − 25.5) ÷ 18 = 3.92 in (3-15/16 in), on-center 5.42 in, first centre 4.67 in from the post. 3.92 in is under 4 in, so it passes. With 5% waste, 17 × 1.05 = 17.85, so order 18.
Pakistan: 2,400 mm between posts, 40 mm balusters, 100 mm maximum. n = ⌈2,300 ÷ 140⌉ = ⌈16.43⌉ = 17. Gap = (2,400 − 680) ÷ 18 = 95.56 mm, on-center 135.56 mm. 95.56 mm is under 100 mm, so it passes. With 5% waste, order 18.
India, stair: 1,800 mm rise, 2,700 mm run, 40 mm balusters, 100 mm maximum horizontal gap, single slope. Angle = atan(1,800 ÷ 2,700) = 33.69°, rail = 3,245 mm. n = ⌈2,600 ÷ 140⌉ = ⌈18.57⌉ = 19. Horizontal gap = (2,700 − 760) ÷ 20 = 97 mm, which is 116.6 mm along the rail. It passes, and 19 plus 5% waste means ordering 20.
Good to know
- Estimates for planning, not engineering or legal advice. Codes differ by place and edition, so confirm the gap limit, guard height and any stair rules with your building authority.
- The 4-3/8 in open stair side, the Pakistan figures and the NBC 2016 guard heights are commonly quoted values. Check them against the edition your inspector or engineer uses.
- The stair layout assumes plumb (vertical) balusters, so the gap that codes check is the horizontal one. The triangle opening under the bottom rail of a stair is not checked.
- Balusters are spaced evenly between two posts. Gates, turns and glass panel rules are not modeled. Fasteners default to 2 screws per baluster and 1 adhesive tube per 25 balusters, so change them to match your product.
Questions people ask
How do you calculate baluster spacing?
With n balusters there are n + 1 equal gaps, so gap = (run − n × width) ÷ (n + 1). The fewest balusters that stay within the code are n = ⌈(run − max gap) ÷ (width + max gap)⌉.
What is the maximum gap between balusters?
Under the IRC (R312.1.3) and the IBC a 4 inch sphere must not pass through, so the clear gap is under 4 in. The Building Code of Pakistan and NBC 2016 are quoted at 100 mm. Pick your code in the tool or enter your own.
What is the 4-inch sphere rule?
Guards must have openings small enough that a 4 inch ball cannot pass, so young children cannot slip through. The check applies to every gap, including the ones next to the posts.
How many balusters do I need for a 6 foot railing?
A 72 in clear run with 1.5 in balusters and a 4 in limit needs 13 balusters, with a 3.75 in gap and 5.25 in on-center. Fewer than 13 leaves a gap over 4 in. Use the calculator for your own run.
How do you space balusters on stairs?
Balusters stand plumb, so the gap that codes check is the horizontal one. Enter the run, rise and treads. Single slope spaces them evenly across the run, and stepped puts the same number on each tread. The gap along the sloping rail is the horizontal gap ÷ cos(angle).
How many balusters per stair tread?
Usually two or three. The tool finds the fewest per tread that keeps the horizontal gap in the limit: tread length ÷ (width + max gap), rounded up. A 270 mm tread with 40 mm balusters and a 100 mm limit needs 2.
Does it work for Pakistan and India?
Yes. Choose Pakistan or India for millimetres, local code presets, terms and rupee costs. The Hindi and Urdu pages open on India and Pakistan, and you can switch market on any language.
IRC 4-Inch Sphere Rule Explained
The International Residential Code asks that guards on decks, balconies and porches have no opening a 4 inch sphere can pass through. The idea is simple: a small child should not be able to slip between balusters or between the end baluster and the post. Commercial buildings under the IBC use the same 4 inch limit with a 42 inch minimum guard height.
The rule applies to every gap, so the gaps next to the posts count too. That is why this tool spaces balusters evenly with n + 1 gaps. Some editions allow 4-3/8 inch on the open side of a stair and a 6 inch sphere for the triangle under the bottom rail, so check the edition your inspector uses.
How to Space Balusters on Stairs
On a stair the rail rises with the steps, but balusters stand straight up. The code gap is the horizontal gap between them, so treat the stair as a flat run in plan view. Divide the run, not the rail length, to find the number of balusters.
The rail angle is atan(rise ÷ run). A gap measured along the rail is the horizontal gap divided by the cosine of that angle, so 97 mm horizontally is 116.6 mm along a 33.69 degree rail. Cut both ends of each baluster at that angle from square. Stepped layouts put two or three balusters on each tread so every tread looks the same.
Baluster Spacing Formula
With n balusters of width w between posts a clear distance L apart there are n + 1 equal gaps, so gap = (L − n × w) ÷ (n + 1). Setting the gap equal to the limit g and solving gives n = (L − g) ÷ (w + g). Round up, because rounding down leaves a gap over the limit.
On-center spacing is gap + w. If you know the count, work the other way: put n into the gap formula and compare the answer with the limit. For several identical sections multiply by the number of sections, then add waste and round up to full boxes.
How to Mark Baluster Positions Without Drift
Measure every position from one fixed point, the face of the left post, instead of stepping from baluster to baluster. A small error at each step adds up across a long rail. The markout list gives the centre of each baluster and its two edges.
Mark the centres on the bottom rail first, then plumb up to the top. Dry fit three or four balusters before you fasten. On a stair, measure along the horizontal run and plumb up to the raking rail, which keeps the horizontal gap that the code checks.
Part of the guide: Roof, stair, deck and structure calculators