Guides

Deck Railing Height and Baluster Spacing: The Code Rules

Building inspectors check deck railings closely, because a railing that fails can mean a serious fall. Here are the rules in the International Residential Code, which most US towns adopt, in plain language, with the section numbers to show your building department.

Open the Deck Railing and Baluster Calculator

Quick answer

Under the 2021 International Residential Code, a deck needs a railing (the code calls it a guard) where the surface is more than 30 inches above the ground within 36 inches of the edge. The guard must be at least 36 inches high, 34 inches on stairs, and no opening may let a 4-inch sphere through. The code sets no post spacing; the American Wood Council's DCA 6 guide uses 4x4 wood posts up to 6 ft apart, which takes 12 wood 2x2 balusters per section.

When a deck needs a railing

Section R312.1.1 of the 2021 IRC requires guards on open-sided walking surfaces, including floors, stairs, ramps and landings, that are more than 30 inches above the floor or grade below at any point within 36 inches horizontally of the open side. So a deck only 24 inches up at the house may still need a guard if the ground drops away near the edge. Insect screening does not count as a guard.

How high the railing must be

Baluster spacing: the 4-inch sphere rule

R312.1.3 says required guards may not have openings, from the walking surface up to the required height, that allow a 4-inch sphere to pass. There are two exceptions on stairs: openings in the guard along the open side of a stair may be up to 4-3/8 inches, and the triangle formed by the riser, tread and bottom rail may be up to 6 inches.

The code sets a gap limit, not a baluster count. Between 4x4 posts 6 ft apart on center there are 68.5 inches of clear space, which takes 12 wood 2x2 balusters (1-1/2 inch actual, gaps about 3.88 inches) or 14 metal 3/4 inch balusters (gaps about 3.87 inches). The deck railing calculator works it out for your post spacing.

Post spacing and attachment

The IRC gives no maximum post spacing. For wood guards, the American Wood Council's prescriptive deck guide, DCA 6, shows:

DCA 6 is written to the 2015 IRC, and some building departments use it as their deck standard. Composite and other guard systems must carry a label with their maximum span (R507.2.2.1) and be installed per the manufacturer's instructions (R507.2.2.5 and R507.10.4).

How strong it must be

Table R301.5 requires a guard to resist a single 200 lb concentrated load at the top, and balusters and other infill to resist 50 lb on 1 square foot. R507.10.1 requires a continuous load path from the guard to the deck joists, and R507.10.1.1 does not allow connections that rely only on fasteners in end grain.

The 2024 code and local rules

The 2024 IRC keeps the same heights, sphere sizes and loads, with the guard section renumbered R321. Towns adopt and amend the code on their own schedule, so your building department has the final word, and many require a permit for a deck.

Frequently asked questions

How high does a deck railing need to be?

At least 36 inches above the deck surface where a guard is required, and at least 34 inches on the open sides of stairs, under 2021 IRC R312.1.2.

What is the maximum gap between deck balusters?

Openings must not let a 4-inch sphere pass (2021 IRC R312.1.3), so every gap has to be less than 4 inches. On the open side of stairs the limit is 4-3/8 inches.

Does a deck under 30 inches need a railing?

Not under the IRC, unless the ground drops so that the surface is more than 30 inches above grade at any point within 36 inches of the edge. Local codes can be stricter.

How many balusters for a 6 foot railing section?

12 wood 2x2 balusters or 14 metal 3/4 inch balusters between 4x4 posts 6 ft apart on center, which keeps every gap under 4 inches.

Calculators for this

Published 2026-11-06. Sources: 2021 International Residential Code, sections R301.5 and R312 (Colorado adoption, via UpCodes); 2021 International Residential Code, section R507.10 (Colorado adoption, via UpCodes); 2024 International Residential Code, chapter 3 (Maryland adoption, via UpCodes); American Wood Council, DCA 6 Prescriptive Residential Wood Deck Construction Guide; NIST PS 20-25, American Softwood Lumber Standard (Table 3, actual sizes); Deckorators, aluminum balusters. See how we calculate.