Deck Railing Calculator

If you're asking yourself, "how many balusters do I need for deck railing?", this free calculator gives you the answer in seconds. Enter your railing run length, baluster spacing, post count, and post width, and it figures out exactly how many balusters to buy — plus top and bottom rail lengths, suggested post spacing, and a waste allowance so you don't come up short.

Enter your numbers

Your results

Balusters needed
With 10% waste
Usable length between posts
Total railing length
Top rail needed
Bottom rail needed
Distance between posts
Actual baluster spacing
With 5% waste

Baluster and post counts are exact counts from the formulas below. Waste allowances are estimates — order more if you expect many cuts or angled runs.

How to use this calculator

Measure the total length of the railing run in feet — that's the straight-line distance from the outside of the first post to the outside of the last post. Enter it along with your baluster spacing (on-center, in inches), how many posts the run has, and your post width. The calculator updates instantly as you type.

The headline result is the number of balusters to buy, and right next to it is the recommended count with a 10% waste allowance, rounded up — cuts, corners, and mistakes eat into your stock, so never order the exact count. Below that you'll find rail lengths, the even spacing between your posts, and the actual baluster spacing your layout produces.

How it works

The math is straightforward. First, posts eat into the usable run: usable length (inches) = length (ft) × 12 − posts × post width (in). Then balusters = floor(usable length ÷ on-center spacing). We round down because you can't install a fraction of a baluster — rounding up would overestimate and leave uneven end gaps.

The other figures follow from the same inputs: total railing length is just your run length in feet, and both the top rail and bottom rail need that same length of material. Suggested distance between posts is length (ft) ÷ (posts − 1), which assumes posts are evenly spaced along a straight run. Waste allowances are simple percentage markups on the baluster count, rounded up: order quantity = ceil(balusters × 1.05) for 5% and ceil(balusters × 1.10) for 10%.

One important assumption: this calculation is for straight, level runs. Stairs, angles, and curves change the geometry, so treat stair results as a starting estimate. Also note that on-center spacing (center of one baluster to center of the next) is not the same as the clear gap between balusters — the gap is what building code cares about, which brings us to the code note below.

Code note (estimate, not code advice): the US International Residential Code requires that a 4-inch sphere cannot pass through any railing opening — the "4-inch sphere rule." So the clear gap between balusters must be 4 inches or less. The calculator warns you (without blocking) if your spacing exceeds 4 inches. For example, with 2-inch-wide balusters at 4-inch on-center spacing, the clear gap is about 2 inches — comfortably under the limit. Always confirm with your local building department before building.

Frequently asked questions

What is the 4-inch sphere rule for deck railings?

The International Residential Code (IRC) requires that a 4-inch diameter sphere cannot pass through any opening in a deck railing. In practice this means the clear gap between balusters must be 4 inches or less. This calculator warns you when your entered spacing exceeds 4 inches so your railing plan stays code-friendly.

Are balusters and spindles the same thing?

Yes — balusters and spindles are two names for the same vertical pickets that fill the space between the top and bottom rails of a deck railing. Baluster is the term used in building codes, while spindle is the older, more traditional word. The count is identical either way.

Should I measure baluster spacing on-center or gap?

On-center spacing is measured from the center of one baluster to the center of the next, while gap spacing is the empty space between two balusters. For code compliance, the clear gap must be 4 inches or less. If your balusters are 2 inches wide, a 4-inch on-center spacing gives a 2-inch clear gap, which passes the 4-inch sphere rule.

How many posts do I need for deck railing?

As a rule of thumb, space deck railing posts no more than 6 to 8 feet apart, with a post at every corner, stair landing, and wherever the railing changes direction. For a 20-foot run, 4 posts (roughly every 6.7 feet) is a typical, sturdy layout. Enter your post count in this calculator to see the exact spacing between posts.

Does this calculator work for stair railings?

It works as an estimate for straight stair runs, but measure along the stair slope rather than the horizontal run, since angled balusters sit on a longer diagonal. Keep in mind that stair railings also need a graspable handrail, and the 4-inch sphere rule applies to stair guard openings too — always check your local code before you build.

Related calculators