Construction · rail layout
Baluster spacing.
Enter the rail length between posts, the baluster width and the largest gap you can allow. Get the count, the exact equal gap and a markout list from the post. Handles unequal bays and stair rake. Runs in your browser; nothing is sent.
Rail and balusters
Count and station marks
Worked example
A level rail 72 in between posts, 1 1/2 in balusters, 4 in maximum gap. The minimum count is the next whole number at or above (72 - 4) / (1.5 + 4) = 12.36, so 13 balusters. The 14 gaps are each (72 - 13 x 1.5) / 14 = 3.75 in, or 3 3/4". Baluster 1 spans 3 3/4" to 5 1/4" from the post, its centerline is at 4 1/2", and every later mark steps by 5 1/4" (baluster plus gap).
Formula and limits
Method: plain geometry, no lookup tables. For clear span L, baluster width w, n balusters: gap = (L - n x w) / (n + 1). The count is the smallest n where gap is at or below your maximum, so n = ceil((L - g) / (w + g)). Marks are the left edge, centerline and right edge of each baluster measured from the left post face, rounded to the nearest 1/16 inch. Measure from the post each time rather than adding rounded steps.
Stair rake: balusters hang plumb, so the opening is measured horizontally. The calculator converts the sloped length to a horizontal span with L x cos(angle), solves it as above, then reports each mark horizontally and divided by cos(angle) along the rail.
Code reference: International Residential Code section R312.1.3, Opening limitations (International Code Council, codes.iccsafe.org; open your jurisdiction's adopted edition there). The 4 inch default is an editable input, not a copy of the code text. Stair sides, the triangle at the bottom rail, guard height and local amendments (and non-IRC codes such as the National Building Code of Canada) can differ. As of 2026-09-30 this page does not reproduce code text; verify with your building department before you build.
Boundary: this is a layout aid, not an engineering or code-compliance check. It does not check guard height, post spacing, rail strength or load. Measure your own rail, dry-fit a few balusters, and have the finished guard inspected where required.
Frequently asked questions
How many balusters do I need?
Take the clear span between posts L, the baluster width w and the largest gap g your code allows. The smallest count that works is n = the next whole number at or above (L - g) / (w + g). The result then spreads the n balusters so all n + 1 gaps are equal.
What does the 4 inch rule mean?
Residential guard rules in the International Residential Code, section R312.1.3 (Opening limitations), limit how large an opening in a guard can be, tested with a sphere of a stated diameter. The calculator defaults to a 4 inch sphere. Stair sides and the triangle at the bottom rail have their own limits in the code, so read the section and your local amendments before building.
How do stair rake layouts work?
Balusters hang plumb, so the gap that matters is the horizontal one. Enter the length along the rail and the pitch; the calculator converts to a horizontal span, finds the count, and lists each mark both horizontally and along the sloped rail.
Can I mix bay lengths?
Yes. Put one bay per line. Each gets its own count and exact gap, so a short bay beside a gate or post can have a different gap than the main run.