Deck Railing and Baluster Calculator

Start at one post with a spacer block and work along the rail and the arithmetic is fine for the first ten balusters. It fails at the last one, where whatever is left over becomes a single wide gap against the far post, which is the one gap anybody will ever measure.

Overall, outside face of one end post to outside face of the other.
Runs of a different length: calculate them separately and add the totals.
Centre to centre. A design target you take from your approved detail, not a figure this page decides.
A 4x4 measures 3.5 in. A 6x6 measures 5.5 in.
Actual width facing you, not the nominal size. Square balusters and round ones both use the widest dimension.
Your own design target. Guard opening limits are set by the adopted code and your building department, so confirm the figure before you cut anything.
Bottom of the top rail to top of the bottom rail. Sets baluster cut length.
Optional — your own price
Deck Railing and Baluster Calculator — Even Gap LayoutBuildFigure

The gap is the input and the count is the answer

Almost everyone runs this calculation backwards. They pick a baluster spacing that sounds right, lay out the marks, and then discover what the last gap turned out to be. The correct order is the other way round: the maximum gap is the constraint, and the number of balusters is whatever it takes to satisfy it.

For a clear opening of C inches, balusters w inches wide and a maximum gap of g inches, a run with n balusters has n plus one gaps. The material takes n times w, and the rest is gap, so each gap measures the leftover divided by n plus one. Requiring that to be no more than g rearranges to a single line: n is at least C minus g, divided by w plus g. Round that up to a whole baluster and you have the count. Then divide the real leftover back out and you have the actual gap, which is always a little smaller than your target and always identical everywhere in the section.

A 59-3/8 inch opening with 1-1/2 inch balusters and a 4 inch limit needs 10.06 balusters by that formula, so it needs 11. Eleven balusters take 16-1/2 inches of the opening, leaving 42-7/8 inches spread across twelve gaps, or 3.57 inches each. Every gap in the run is 3.57 inches. Nothing is left over.

What the spacer block does instead

Cut a block the width of your gap, hold it against the post, set a baluster, move the block along, repeat. It is fast and it is wrong at exactly one place. Working the same 59-3/8 inch opening at 4 inches, you fit ten balusters and consume 55 inches, and the distance remaining to the far post is 4-3/8 inches. That is the widest opening in the whole railing, it is at the end where the eye goes, and it is the one an inspector will put a tape on.

The overshoot is not always small. Change the opening by an inch and the leftover changes by an inch, because the count only steps in whole balusters. The calculator shows both numbers side by side so you can see how much the block method would have cost you on your particular run before you commit to it.

The fix is not to shave the last gap. Balusters at 3.57 inches and one at 4-3/8 finishes visibly uneven, and pushing the whole run over to hide it just moves the problem to the other post. Recalculate for one more baluster and lay out from a story pole marked at the even spacing.

Marking the section without measuring twenty times

Work from a story pole rather than a tape. Take a straight offcut the length of the clear opening, mark the baluster centres on it once at the on-centre spacing the calculator gives, and transfer those marks to every section that has the same opening. Sections of a different length need their own pole, and on a deck with an odd corner or a gate there will usually be two or three.

The first centre sits at one gap plus half a baluster from the post face. Every centre after that is one on-centre spacing along. If you mark from both ends towards the middle to save time, expect the two halves to disagree by whatever the accumulated marking error is, which is precisely why the pole exists.

Round balusters and turned spindles need the widest dimension entered, not the nominal size, because the gap is measured at the narrowest point between two adjacent balusters and that occurs where they are fattest.

Posts, and the part this page will not decide

Post spacing here is a target you supply and the calculator reports what it worked out to. It divides the run into whole sections and tells you the resulting centres, which will normally be tighter than the target rather than looser. It does not tell you what the post spacing ought to be, because that depends on how the post is attached to the framing, and a railing post is a structural connection carrying a lateral load at the top of a lever arm.

The same applies to guard height and to the opening limit itself. Those come from the code your jurisdiction has adopted and from the inspector, not from a web page, and a deck guard that fails is a fall. Get the figures from the building department, put them into the fields, and use the arithmetic for what arithmetic is good at.

Once the railing layout is settled, the rest of the deck usually follows: the deck board calculator for the surface, the deck framing calculator for what is underneath it, and the deck post height calculator if the ground under the posts is not level. Railing eats an enormous amount of finish, which the deck sealing calculator accounts for by surface area including the spindles.

Questions people ask

How do I get the same gap everywhere instead of one wide one at the end?

Compute the count from the gap limit rather than laying out at the limit. Take the clear opening, subtract one gap, divide by the baluster width plus one gap, and round up. That count of balusters leaves a total space that divides evenly across one more gap than there are balusters, and every gap in the section is identical. It comes out slightly under your maximum, which is the direction you want to be wrong in. The alternative, which is what a spacer block does, spends the maximum gap on each opening in turn and dumps the remainder against the last post.

What maximum gap should I use?

Whatever your building department tells you, which is why it is a field on this page rather than a constant inside it. Guard opening limits, guard height and the load a guard has to resist are set by the code edition your jurisdiction adopted, and jurisdictions amend those. The figure in the default field is a common starting point for illustration and nothing more. Ask before you buy balusters, because the count changes sharply with the limit and a run laid out to the wrong number is a full rebuild rather than an adjustment.

Do I measure the gap between balusters or between centres?

The limit applies to the clear opening, which is the space between the facing surfaces of two adjacent balusters, so that is what this page solves for. On-centre spacing is reported as well because it is the more convenient number to mark out with. The two differ by exactly the baluster width. If you use round balusters, the clear gap is measured at the widest part of the turning, so enter that dimension rather than the stock size the balusters were cut from.

Do the sections all get the same number of balusters?

Only if the sections are the same length, which this calculator assumes for a given run because it divides the run into equal sections. A real deck usually has a run or two that does not match, plus a stair rail, plus sometimes a gate. Calculate each distinct opening length separately and add the results. A stair rail is a different problem again, because the balusters are cut at the stair angle and the clear opening is measured perpendicular to the rail, not vertically.

How much rail and baluster stock do I actually buy?

The calculator gives lineal feet for both, but buy in whole stock lengths and expect waste. Balusters cut from long stock waste the remainder of each piece unless the cut length divides evenly into it, so check the arithmetic before assuming a 12 foot piece yields four 32 inch balusters, because it yields four and a 16 inch offcut. Rails should be run in the longest single pieces that reach between posts, since a splice in a top rail is both a weak point and a water trap.

Related