🏆 US-Registered Digital Marketing Agency
Advertisement
Advertisement
CONSTRUCTION

Baluster Spacing Calculator — even gaps under the 4-inch rule

Find the baluster count and the exact even gap for a railing run so no opening passes a 4-inch sphere.

The 4-inch sphere limit is about 101.6 mm; metric codes elsewhere often use 99 mm or 100 mm.
Measure post face to post face, not centre to centre. A nominal 2x2 baluster is really 1.5 in (38 mm) across.
Default is 3-7/8 in — deliberately under the 4 in sphere limit, because the code says the sphere must not pass, not that it may just fit.
Zero for a level guard. Enter the stair pitch for a raked rail with plumb balusters — the sphere test is measured horizontally, so the along-rail spacing differs.
Balusters per section
0
 
0
Even clear gap
0
On-centre spacing
0
Balusters to buy
0
Margin under the limit
Tip: the number of gaps is always one more than the number of balusters, because there is a gap at each post. Dividing the run by the baluster count is the classic off-by-one that puts an over-width opening at each end.
Advertisement

The baluster spacing calculator above does something a plain division cannot. It solves for the smallest number of balusters that keeps every clear opening in a railing run below the limit, then distributes them so the gaps are all identical. That is the actual problem: not "how many spindles fit", but "what is the fewest spindles that satisfies the opening rule with perfectly even spacing", which is a different question with a different answer.

Arb Digital publishes this as part of a free construction estimating set. This is a preliminary layout and teaching tool, not a code compliance certificate. Guards are a life-safety element — they exist to stop a child falling through a railing — and the requirement that governs your job is whatever your local building department has adopted and amended. Read the calculated gap as a starting layout, and confirm it against the code your inspector works from.

What This Baluster Spacing Calculator Does

You give it the clear opening between two posts, the real face width of your balusters, and the maximum clear gap you are allowed. It returns the minimum baluster count that satisfies the limit, the exact even gap that results, the on-centre spacing to mark out, and how much margin you have under the limit. It multiplies up across identical sections, adds spares, and prices the order.

The rake angle field handles sloped guards. On a stair, balusters stand plumb while the rail runs at the stair pitch, and the opening the sphere has to pass through is measured horizontally, not along the rail. The tool solves the layout in the horizontal projection and then converts back to an along-rail on-centre distance, which is what you actually mark on the rail with a tape. Getting this wrong is why raked runs often end up with a wider opening than the level run they connect to. If you are also setting out the stair itself, our stair calculator handles risers and treads and the rafter length calculator covers the same slope trigonometry for roof members.

How to Use It

  1. Measure the clear opening, not the post centres. Put the tape on the inside face of one post and read to the inside face of the next. Every section is likely to be slightly different on a real deck, so measure each one.
  2. Enter the real baluster width. A nominal 2x2 is 1.5 in. A nominal 2x4 laid flat is 3.5 in. A round metal baluster is its diameter. Using the nominal name instead of the actual size shifts every gap.
  3. Set the maximum allowable clear gap. The default is deliberately below 4 inches. See the section below on why that matters.
  4. Enter a rake angle if the rail is sloped. Leave it at zero for level guards on a deck or landing.
  5. Repeat per section. Sections of different lengths need different counts, and forcing one count across all of them is what produces uneven-looking railings.

The Formula and How It Is Calculated

Start with the constraint. If a run of clear width R holds n balusters each w wide, there are n + 1 gaps, because there is one gap against each post as well as the gaps between balusters. The width of each even gap is therefore:

gap = (R − n × w) ÷ (n + 1)

You want the smallest n for which that gap is at or below your maximum g. Rearranging the inequality gap ≤ g gives:

n ≥ (R − g) ÷ (w + g), so n = ceil((R − g) ÷ (w + g))

Then feed that n back into the first equation to get the actual even gap, and add the baluster width to get the on-centre spacing you mark out.

A worked example. A 60 inch clear opening, 1.5 inch balusters, 3.875 inch maximum gap. (60 − 3.875) ÷ (1.5 + 3.875) = 56.125 ÷ 5.375 = 10.44, so n = 11 balusters. The gap is (60 − 11 × 1.5) ÷ 12 = 43.5 ÷ 12 = 3.625 inches, and the on-centre spacing is 5.125 inches. Check the alternative: ten balusters would give (60 − 15) ÷ 11 = 4.09 inches, over the limit. Eleven is genuinely the minimum, and it lands with a quarter inch of margin to spare.

Advertisement

The 4-Inch Sphere Rule, Stated Properly

The rule everyone quotes as "4 inch spacing" is not a spacing at all. In the International Residential Code, the required guard provision states that openings in a required guard shall not allow the passage of a sphere 4 inches in diameter. That wording is doing real work. It is a pass-fail test performed with an object, not a dimension you measure with a tape, and it means the opening must be genuinely smaller than 4 inches — an opening of exactly 4.000 inches would let a 4-inch sphere through.

That is why this page defaults to 3-7/8 inches rather than 4. Timber moves, posts are rarely perfectly plumb, and a layout that calculates to 3.99 inches will fail somewhere along the run once it is built. Leaving an eighth of an inch of margin costs nothing and removes the argument with the inspector.

Two related provisions in the same family of codes are worth knowing, because they are different numbers for different geometry. The triangular opening formed by a stair tread, riser and the bottom rail of a guard is assessed against a 6-inch sphere. Guards along the open side of a stair are commonly assessed at 4-3/8 inches rather than 4. Do not carry any of these figures across from memory: pull them from the edition your jurisdiction has adopted, available through the ICC codes library. For prescriptive residential deck construction specifically, including guard assemblies, the American Wood Council's DCA 6 deck construction guide is the document most inspectors in the United States will recognise.

Outside the United States the number changes. Many jurisdictions work to a 99 mm or 100 mm sphere rather than 101.6 mm, and some also prohibit horizontal members that could be climbed. The maximum-gap field is editable precisely so you can enter the figure that applies where you are building rather than the one this page defaults to.

Why the Off-By-One Error Is So Common

The intuitive move is to divide the run by the spacing and call that the baluster count. It produces a wrong answer every time, because it counts the gaps and the balusters as if there were the same number of each. In a run bounded by posts at both ends there is always one more gap than there are balusters: gap, baluster, gap, baluster, gap.

The visible symptom is an over-wide opening at each end of the run. A carpenter who lays out from one post at a fixed on-centre spacing ends up with a normal-looking field of balusters and one conspicuous wide gap where the layout meets the far post — and that end gap is exactly where an inspector puts the sphere. Solving for the even gap, as this tool does, removes the problem by construction: every opening in the run is identical, so if the calculated gap passes, all of them pass.

Raked Runs, Plumb Balusters and the Horizontal Test

On a stair guard the rail slopes and the balusters stay plumb. If you mark the rail at the same on-centre spacing you used on the level run, the horizontal clear opening between balusters gets larger, because the along-rail distance is the hypotenuse of a triangle whose horizontal leg is what the sphere has to pass through. At a 37 degree stair pitch, an along-rail spacing of 5 inches gives a horizontal spacing of only about 4 inches — meaning you can space closer along the rail than you might expect, and conversely that carrying a level layout onto the rake tightens rather than loosens it.

The direction of the error depends on which way you carry the layout. If you set out the rake by marking the horizontal projection on the floor and dropping plumb lines, you are already in the right frame. If you set out by running a tape along the sloped rail, you must convert. This tool does the conversion for you: enter the rake angle and it solves in the horizontal projection, then reports the along-rail on-centre distance to mark. Our miter angle calculator handles the cut angles where a raked rail meets a post, and the feet and inches calculator converts the decimal results here into tape-readable fractions.

Baluster Width Is Not Baluster Name

Every gap in the run shifts if the width is wrong, and the width is wrong more often than the run measurement is. Dimensional softwood is sold by a nominal name that predates drying and surfacing: a 2x2 measures 1.5 by 1.5 inches, a 2x4 measures 1.5 by 3.5. Metal balusters are usually sized by their actual dimension, so a 3/4 inch square baluster really is 0.75 inches. Turned timber spindles vary along their length — use the widest point, because that is what closes the gap.

Composite and vinyl systems are the trap. Many are supplied as a kit with fixed connectors at a fixed spacing, in which case the layout is not yours to choose and the run has to be built to suit the kit rather than the other way round. Check the manufacturer's installation instructions before calculating anything, because a proprietary system's listing usually specifies the spacing and deviating from it voids both the warranty and the listing the inspector is relying on.

Load, Not Just Openings

Spacing is only half of what makes a guard a guard. The assembly also has to resist a concentrated load applied at the top rail in any direction, and infill components have to resist a load over a small area. Those are strength requirements in the building code, and they are satisfied by the post connection, the rail attachment and the baluster fixing — not by how evenly the spindles are distributed.

The weakest link in a timber deck guard is almost always the post-to-frame connection, and prescriptive details for it exist because notched posts bolted through a single rim joist have failed in testing. That is outside what this calculator computes, and it is worth saying plainly: a railing with perfect 3.625 inch gaps and an inadequate post connection is a hazard. Structural checks belong to the beam load calculator family of tools and, for anything real, to a licensed professional. For the deck the railing sits on, our decking calculator handles boards and joists and the fence calculator covers a similar picket layout problem outdoors.

Need estimating tools like this on your own website?

Arb Digital builds free calculators and interactive tools that earn search traffic for trade and construction businesses. Browse the full library, or tell us what your customers keep asking you to work out.

Browse Free Tools Talk To Arb Digital

Common Mistakes to Avoid

  • Counting gaps and balusters as equal — a run between two posts always has one more gap than it has balusters, and forgetting that leaves an oversized opening at each end.
  • Measuring post centres instead of the clear opening — the sphere is tested in the clear space, so the layout has to be solved in the clear space.
  • Using nominal timber sizes — a 2x2 baluster is 1.5 inches wide, and using 2 inches in the arithmetic changes the gap on every opening in the run.
  • Designing to exactly 4 inches — the code says a 4-inch sphere must not pass, so an opening of exactly 4 inches fails. Leave margin for timber movement and out-of-plumb posts.
  • Carrying a level layout straight onto a raked rail — the sphere is tested horizontally, and along-rail spacing on a slope is not the same distance.

Related Free Tools From Arb Digital

Pair this with the decking calculator for the deck the guard sits on, the stair calculator for riser and tread layout, the fence calculator for picket spacing outdoors, the miter angle calculator for rail cuts and the feet and inches calculator for turning decimals into fractions. The wheelchair ramp calculator covers the accessibility side of the same handrail geometry. The full free online tools hub lists every calculator we publish.

Frequently Asked Questions

What is the maximum gap between balusters?

The International Residential Code requires that openings in a required guard do not allow the passage of a sphere 4 inches in diameter. That is a pass-fail test with an object rather than a dimension, so an opening of exactly 4 inches fails. Codes outside the United States often use 99 mm or 100 mm instead, and your local amendments govern.

How do I calculate the number of balusters for a railing?

Take the clear opening between posts, subtract the maximum gap, then divide by the baluster width plus the maximum gap, and round up. That gives the minimum baluster count. Feed it back in as gap equals run minus count times width, divided by count plus one, to get the even spacing.

Why is the number of gaps one more than the number of balusters?

Because the run is bounded by a post at each end. The pattern is gap, baluster, gap, baluster, gap, so a run with eleven balusters has twelve openings. Dividing the run by the baluster count instead is the most common layout error and leaves a wide opening at each post.

Should I design to exactly 4 inches?

No. Aim below it. Timber moves seasonally, posts are rarely perfectly plumb and site tolerances accumulate, so a layout that calculates to 3.99 inches will exceed the limit somewhere. This page defaults to 3-7/8 inches, which leaves an eighth of an inch of margin at no material cost.

How does spacing work on a stair guard?

Balusters stay plumb while the rail slopes, and the opening is tested horizontally. The along-rail distance between balusters is the hypotenuse, so it is longer than the horizontal clear opening the sphere has to pass. Enter the stair pitch in the rake angle field and the tool solves in the horizontal projection before converting back to an along-rail mark-out distance.

Does even spacing make a guard code compliant?

No. Opening size is one requirement among several. A guard also has to resist a concentrated load at the top rail and a load on the infill, and the post-to-structure connection is usually the weakest part of a timber guard. Spacing arithmetic says nothing about strength.

What baluster width should I enter?

The real measured width at the widest point, not the nominal name. A 2x2 timber baluster is 1.5 inches. A turned spindle should be measured at its fattest section. Proprietary composite and vinyl systems often fix the spacing in their installation instructions, in which case follow those rather than a calculated layout.

This tool produces preliminary layout estimates only. It is not a code compliance determination and does not replace a licensed professional. Guard opening limits, load requirements and connection details are set by the building code adopted in your jurisdiction, and local amendments differ by state, province and country. The authority having jurisdiction decides compliance.

Advertisement
Advertisement

Take it further