Railing calculator
Plan a deck railing with vertical pickets. Enter your run length and post count, and the calculator gives you a full material breakdown.
Note: These results are a planning aid to help you get started. Railing height and maximum gap requirements vary by local building code, so please double-check requirements in your area before you buy materials or start construction.
How to calculate railing materials
- Enter the total length of the railing run and the railing height.
- Choose your post size and the number of posts. Match your post positions to your deck framing so the posts sit on the underlying frame.
- Set your handrail dimensions to match what you plan to install along the top.
- Set your picket dimensions and the desired gap between pickets. The gap will be balanced in the results so the pickets fit evenly across each bay.
Advanced options
Waste factor covers short off-cuts from cutting pickets to length, the occasional knot or warp set aside, and the extra post length buried below the deck. 10% is enough for a simple straight run; bump to 15% for a long run with many short cuts.
Post depth sets how far the post extends below the deck surface for attachment. The calculator uses this to estimate total post lumber length, so set it to match your mounting method.
Bottom clearance is the gap from the deck surface to the bottom edge of the lower rail. Keep it at or below 100 mm (4 inches) so the opening between the deck and the bottom rail meets the same limit as the gap between pickets.
How picket spacing is calculated
You set a target gap between pickets. The calculator finds the closest balanced gap that fits a whole number of pickets into each bay, so the spacing is even between every picket and from each picket to the posts on either side. The balanced gap and the resulting picket count are both shown in the results.
Keep the balanced gap at or below 4 inches (100 mm). That is the maximum opening permitted by most residential codes.
Posts, handrail, rails, and pickets
The calculator estimates four material types.
Posts are sized for the full installation length: the height above the deck plus the depth below it for attachment. Most deck railings use 4×4 posts. For longer spans or taller railings, 6×6 posts give noticeably more stiffness. Use the post size preset to match what you have available.
Handrail runs along the top and is what your hand actually rests on.
Rails sit near the top and bottom, span between posts, and anchor the pickets at each end.
Pickets are the vertical bars between the rails. The calculator counts them based on the balanced gap and your bay layout.
Each material is converted to a board count based on the lumber length you select, with your waste factor applied. When a handrail or rail board is shorter than your post spacing, the joint must land on a post. Longer boards reduce the number of joints, and a continuous handrail with no joints feels noticeably smoother under your hand as you move along it.
Single rail vs double rail construction
The standard build uses a single rail at the top and a single rail at the bottom.
A stronger alternative is to sandwich each picket between two rails, one on each face, and screw through the assembly. This is sometimes called a sandwich rail or double rail. The result is more rigid, hides the fasteners from the front face, and is less likely to rack over time.
The trade-off is material. You need four rail boards instead of two, which adds cost and weight. You also need to check that the combined thickness of both rails fits within the width of your post; otherwise the rail assembly will overhang the post face and look uneven.
Frequently asked questions
What is the standard height for a deck railing?
For most residential decks, the minimum required height is 36 inches (900 mm). If your deck surface is more than 30 inches above grade, many jurisdictions require 42 inches (1067 mm). Check your local building code before you frame, since post height determines your entire material list.
How far apart should railing posts be?
For wood railings, posts should be no more than 6 feet (1.8 m) apart center to center. Some engineered post systems are rated to 8 feet, but 6 feet is the standard default for site-built wood railings. Closer spacing, around 4 to 5 feet (1.2 to 1.5 m), produces a noticeably stiffer rail.
What is the maximum gap between pickets?
Most residential codes require that a 4-inch (100 mm) sphere cannot pass through any opening in the railing. The calculator flags a warning if your balanced gap exceeds 100 mm.
How deep should railing posts be set?
For posts mounted against the side of a deck rim joist, the attachment depth should match the full height of the framing so the bolts pass through the rim joist itself. Going deeper than the framing leaves the post hanging in air below the deck, which adds no strength. Posts that drop through the deck into a footing go deeper. The calculator uses the attachment depth you set to estimate total post lumber length, so adjust it to match your mounting method.