Deck Picket Calculator

Last Updated: July 1, 2026

Calculate how many deck pickets you need and the exact even gap spacing to keep your railing within the 4-inch safety code.

Required. Clear opening between the two posts.
Required. Face width of one picket. A 2×2 = 1.5 in.
US code limit is 4 in so a 4 in sphere cannot pass.
Required. How many pickets you plan to use.
Advanced options

Deck Picket Formula

The calculator works in two modes. When you solve for the number of pickets that meet a maximum gap, it uses:

N = (L - G) / (W + G)

The result is rounded up to the next whole picket so the real gap never exceeds your limit. When you solve for the gap from a fixed number of pickets, it uses:

S = (L - N * W) / (N + 1)
  • N = number of pickets
  • L = railing length between the posts, in inches
  • W = face width of one picket, in inches
  • G = maximum gap you allow between pickets, in inches
  • S = the even gap that results between pickets, in inches

The two formulas above assume a gap at each end, between the end picket and the post, so the number of gaps is N + 1. The on-center spacing the calculator reports is simply the picket width plus one gap (W + S), which is the mark-to-mark distance you measure when laying out the rail. The advanced option lets you switch to a layout with a picket tight against each post, which changes the number of gaps to N – 1.

Picket Widths and Spacing Reference

Most deck pickets and balusters come in a few standard face widths. Use the actual measured width, not the nominal name, since a 2×2 measures 1.5 inches.

Picket typeActual face width
Square 2×2 wood baluster1.5 in
Round metal baluster0.5 to 0.75 in
Flat 1×2 picket1.5 in
Composite baluster1.4 to 1.6 in
Fence picket (3.5 in)3.5 in

The gap, not the spacing, is what building inspectors check. The table below shows how the gap changes as you add pickets to a 6 foot (72 inch) rail section using 1.5 inch pickets with a gap at each end.

PicketsGap between picketsMeets 4 in code
105.18 inNo
124.15 inNo
133.75 inYes
153.09 inYes

Example Problems

Example 1. You have a railing section that is 72 inches between posts and you are using 1.5 inch square balusters. You want the gap to stay under the 4 inch code limit. Using N = (L – G) / (W + G), you get (72 – 4) / (1.5 + 4) = 68 / 5.5 = 12.36, which rounds up to 13 pickets. With 13 pickets and 14 gaps, the real gap is (72 – 19.5) / 14 = 3.75 inches, which passes.

Example 2. The same 72 inch section, but this time you already decided to use 15 pickets and want to know the gap. Using S = (L – N * W) / (N + 1), you get (72 – 22.5) / 16 = 3.09 inches per gap, with an on-center spacing of 4.59 inches.

Frequently Asked Questions

How far apart can deck pickets be? US residential code limits the gap to less than 4 inches so a 4 inch sphere cannot pass between pickets. This keeps small children from slipping through or getting stuck. Always confirm your local code, since some areas are stricter.

Should I measure to the gap or to the picket centers? Lay out the rail using on-center spacing, which is the picket width plus one gap. The calculator gives you both, so you can mark each picket center with a tape measure and still end up with the correct gap.

Do I count a gap at the ends of the rail? By default the calculator places a gap between the end picket and each post, which is the most common look and gives N + 1 gaps. If you want a picket tight against each post instead, switch the advanced option to change the layout to N – 1 gaps.

Deck Picket Calculator