Handrail Picket Spacing Calculator
Calculate baluster count, clear opening, center spacing, end gaps, post offsets, panel totals, and stair rake spacing for guardrails and stair rails.
▦ Rail Application Presets
⚙ Rail And Picket Inputs
Calculation Breakdown
▣ Material And Spec Comparison
ℹ Reference Tables
| Opening rule | Common limit | Where it is checked | Calculator use |
|---|---|---|---|
| Residential guard openings | 4 in sphere | Between balusters and below rails | Set maximum clear opening to 4 in |
| Stair guard openings | 4 in sphere | Along rake between adjacent pickets | Use stair condition and rake angle |
| Stair tread triangle | 6 in sphere | Riser, tread, and bottom rail triangle | Check separately in field |
| Child-focused spacing | 3.5 in target | Lofts, nurseries, and play areas | Use tighter allowance or 3.5 in limit |
| Spacing method | Picket count formula | Clear gap formula | Best use |
|---|---|---|---|
| Equal end and interior gaps | ceil((L - G) / (W + G)) | (L - N × W) / (N + 1) | New rails where end gaps may float |
| Half gap at each post | ceil(L / (W + G)) | (L - N × W) / N | Balanced look with tight post gaps |
| Fixed post gaps | ceil((L - 2E + G) / (W + G)) | (L - 2E - N × W) / (N - 1) | Existing post trim or bracket clearance |
| Stair rake conversion | Use rail-line spacing | run = center × cos(angle) | Sloped rails and plumb balusters |
| Picket profile | Typical face width | Common rail use | Layout note |
|---|---|---|---|
| Square wood baluster | 1.25 to 1.5 in | Decks, porches, interior guards | Measure painted or dressed width |
| Round metal picket | 0.625 to 0.75 in | Stair panels and welded guards | Narrow rods usually need more pieces |
| Square steel tube | 1 in | Commercial guard panels | Works well with fixed end gaps |
| Vinyl or composite picket | 1.25 to 1.5 in | Balconies and low-maintenance decks | Use manufacturer thermal clearances |
| Rail application | Typical measured run | Common picket width | Starting gap target |
|---|---|---|---|
| Residential deck panel | 60 to 72 in | 1.5 in wood | 3.75 to 3.9 in |
| Stair rake panel | 72 to 96 in along slope | 0.5 to 0.75 in metal | 3.5 to 3.75 in |
| Porch between newels | 48 to 72 in | 1.25 in wood | 3.6 to 3.9 in |
| Pool barrier section | 72 to 96 in | 0.625 in aluminum | 3.25 to 3.75 in |
✓ Layout Tips
Measuring handrails looks easy…until you actualy do it. There’s a rail, a few posts and some vertical picket. It seems like simple math, right? But then there is the offset from post face. There is also width of your material and the code clear opening requirements. These things makes the math anything but simple. That’s what causes folks to either end up with way more than they need or with these odd looking gaps that never pass inspection.
The issue is that you are measuring from center of your balusters, but building code is based off the space between the pickets. So if you want the max four inch clear space the code wants, how do you measure? You have to measure from face of each baluster (the outside edge) to the other. Most DIY people will take their measurement from center to center and forget they are measuring the thickness of the actuall product. A square one and a half inch wooden post has quite a bit of width. You can’t count your pickets until you account for actual width of the material. That’s why we built the calculator, it accounts for the width of the material so you don’t have to order more than you need as a buffer.
Why Measuring Handrails Is Hard
The other thing that changes the equation completely is what the materials are made from: a thin metal rod compared to a thick piece of wood. With traditional wood posts you may be able to get away with twelve pickets in a seventy two inch span. But if you use skinny iron spindles, maybe it’s eighteen. It’s an aesthetic difference but it’s also a financial and structural one. Slender pickets takes more time to line up, require more holes to be drilled, and use more hardware. And they look nicer. One of the benefits of the tool is being able to swap between profiles so that you can compare the cost of different materials versus the time it takes to install them. Before cutting a single piece you can see how many you’ll need at a glance for either option.
The other wrinkle is that stairs has a sloped rail. Generally speaking, the pickets are straight up and down (called being plumb). So as you walk up the stairs, the spacing between each picket horizontally (on the ground) is less than the distance between them vertically (along the rail). Unless you account for that rake angle, your stairs will end up having more spacing at the top of the stairs then they do at the bottom. That’s what the rake angle input does, it converts the rake into something we can use in the layout plan. It makes sure the pickets appears consistently spaced from top to bottom. Without taking the angle into account, most folks just space their pickets equally along the length of wood. But then you get big gaps at the top and crowding at the bottom. The offset is more than you would expect.
When installing pickets, you don’t typically butt them up to the face of the post. To look better or to keep them from splitting, there is typically a little gap (maybe an inch or two). This means less space where those middle picket sit. And if you neglect to include the offset on both sides, your total won’t add up correctly. What happens? You will have a gap that’s too big or a picket that doesn’t fit. Setting these offsets in the calculator ensures that you have a clean start and end to your layout. A small detail, but it keeps the final picket from looking ugly because it was squashed.
Be mindful of local codes. Generally speaking a residential code will limit the maximum clear opening to what’s called the “four inch sphere test.” That means nothing should of be able to fit through an opening if a four inch ball was dropped into it. But certain jurisdictions may require closer intervals such as those surrounding child care facilities or pools. Simply change the maximum clear opening to suit the jurisdiction where you live. Better to be over the code than under. The table on this page makes it easy to see that commercial staircases, porches, and decks each has different requirements.
There’s an element of craft to building a guardrail as much as there is an element of engineering: Your eye can tell you when something looks right; your math tells you where to drill. Wood warps, measurements shift, and posts moves around. Always double-check what you’re doing in the field before final cuts are made. Get close using the calculator, then go verify with a tape measure on the actual site.
Consistency in those gaps makes all the difference between a good railing and a great one. The spacing is that delicate balance between function (safety), form (style) and finance (cost). It must be tight enough to meet code, strong enough to support loads, and spaced far enough apart to appear open. Get this part right early on, and you’ll have fewer headaches down the road. No more wasted lumber. No embarrassing call to the building department.
Because when it comes to deck railings, it’s not about perfection. It’s about doing the math so you’re ready. Once you know how much the material width shrinks your area and you know the clear opening formula, the rest is simply executing. Get the number, get the code, get the job done.
