By Alan Martin
Will your beautiful new deck fail inspection over a few inches of railing?
You just want to grill, relax, and watch the kids play. You do not want to read a building code book. But you also do not want a surprise from the inspector, the home buyer, or the emergency room.
At Valley Roofing & Exteriors, we have spent more than 20 years building and repairing decks across the Shenandoah Valley and Central Virginia. “Does my deck need a railing?” comes up at nearly every deck consultation, so we want to answer it plainly. Yes, a railing is required when any open side of a deck or porch sits over 30 inches above the ground.
This guide is for homeowners planning a new deck, replacing a tired one, or getting a house ready to sell. You will learn exactly when Virginia code requires a railing, the heights and gaps that matter, when stairs need a handrail, and when we recommend a railing even if the code does not.
Why are deck railings tricky in the Shenandoah Valley and Central Virginia?
A deck that looks low here often is not. Our hills, historic homes, and hard winters all play a part.
| Local factor | What it means for your railing |
|---|---|
| Sloped yards near the Blue Ridge and Massanutten | One end of a deck can sit 18 inches off the ground while the far corner sits 5 feet up |
| Historic homes in Staunton, Harrisonburg, Lexington, and Charlottesville | Porches and rails were often built long before today’s code, so they may be too short or too open |
| Freeze-thaw winters and humid summers | Water soaks into wood, freezes, and swells, which loosens posts and speeds up rot |
When is a railing legally required on a deck in Virginia?
The short answer: almost always, yes. It all comes down to how high the deck sits.
The 30-inch rule
Under the 2021 Virginia Residential Code, a guard (the code word for a railing) is required on any open side of a deck, porch, landing, or stair that is more than 30 inches above the ground below. That is about the height of a desk or kitchen table. Some counties apply the rule a little differently, so we always confirm with the local building office before we build.
The 36-inch rule that catches people on hills
The 30 inches is not only measured straight down from the edge. As the Fine Homebuilding guide explains, if the ground drops more than 30 inches anywhere within 36 inches (3 feet) of the deck edge, a guard is still required. On a sloped Valley lot, our crew measures at the edge, then measures again 3 feet out where the ground falls away. A deck that looks low from the back door can easily cross the line on the yard side.
| Your situation | Is a guard required? |
|---|---|
| Deck surface 24 inches above flat ground | No (but see our safety advice below) |
| Deck surface 31 inches above flat ground | Yes |
| Deck edge is 26 inches up, but the yard drops to 34 inches within 3 feet of the edge | Yes |
| Split-level deck: upper level 40 inches, lower level 20 inches | Upper level yes; lower level no |
| Screened porch more than 30 inches up | Yes (screens do not count as a guard) |
How tall does a deck railing need to be, and how far apart can balusters be?
For homes, the standard guard height is 36 inches. You may see 42 inches online. That is the commercial standard, and most homes do not need it. Still, on a very tall deck that feels a little scary to stand on, we often suggest the taller rail. Those extra 6 inches bring real peace of mind, especially with kids around.
| Requirement | Code minimum | Why it matters |
|---|---|---|
| Guard height on a deck | 36 inches from the deck surface to the top of the rail | Keeps adults from tipping over |
| Guard height along open stairs | 34 inches, measured from the stair nosing | Follows the angle of the stairs |
| Gaps between balusters | A 4-inch ball must not pass through any opening | Keeps small children from slipping through |
| Strength of the top rail | Must resist at least 200 pounds of force | Holds when someone leans hard or falls into it |
That 4-inch gap rule applies anywhere in the railing, not just between spindles. Wide gaps are one of the most common reasons we see railings fail inspection.
Height is only half the story. A tall rail on a weak post is still a hazard. For wood railings, we fasten posts with bolts that pass through the deck framing. For aluminum and vinyl railings, we use the manufacturer’s special brackets that lock each post to the deck. When a railing does fail, it is usually because it has rotted with age or was never installed by a licensed contractor in the first place.
Do deck stairs need a handrail even if the deck is low?
Often, yes. A guard keeps you from falling off an edge. A handrail is something you grab while you climb. Stairs with four or more risers need a handrail on at least one side, even when the deck itself sits under 30 inches.
That handrail must be graspable, meaning your hand can wrap around it. A flat 2×6 cap on top of a guard usually does not count.
In our experience, a missing or hard-to-grip stair handrail is the number one reason railings fail inspection.
| Guard | Handrail | |
|---|---|---|
| Main job | Stops falls off an edge | Gives a hand-hold on stairs |
| When required | Walking surface more than 30 inches up | Stairs with 4 or more risers |
| Height | 36 inches (34 inches along stairs) | 34 to 38 inches |
| Must be graspable? | No | Yes |
What about both sides? Stairs that run along the house wall usually need a handrail on the open side only. Stairs that are open on both sides and climb more than 30 inches need guards on both sides.
A short run of two steps usually needs nothing at all, though you can still add a rail. Hillside homes with long stairs up from the road are a special case. Those stairs may need a handrail even when spindles are not required.
Should you add a railing even if the code does not require one?
Sometimes the smartest choice goes beyond the code. Even a ground-level deck with a 12-inch step off the edge can twist an ankle or tip a chair. We recommend a railing for families with small children, aging parents, or pets, and for decks that turn slick in winter.
Here is something that surprises people: a railing can make a deck feel bigger. Without one, most people steer clear of the edge, so that outer strip of boards goes unused. With a railing, you can pull your chair right up to the edge and enjoy every square foot. The trade-off is the view. On a very low deck facing the mountains, an open edge may be worth it.
What about built-in benches or planters along the edge? We do not count on them as a railing. Kids climb onto benches, which puts them even higher above the drop.
Is your old deck railing safe, and what should replace it?
What warning signs should you check this weekend?
On older homes, we see it all: short rails, wide gaps, loose posts, and rot. Most of these problems involve wood railings that were either never built to code or have simply worn out. Push on each post. If it wobbles, if gaps are wider than 4 inches, if the rail sits below 36 inches, or if the wood feels soft, it is time for a closer look.
Which deck railing material lasts longest in Virginia weather?
| Material | How long it lasts | How it feels | Our take |
|---|---|---|---|
| Wood | About 10 to 15 years in our winters | Solid when new, weaker as it ages | Lowest upfront cost, most upkeep |
| Vinyl | Usually the life of the deck | Gives a little when you push on it | Low upkeep, slight flex |
| Aluminum | Usually the life of the deck | Firm and solid | Our pick for a rock-solid feel |
Curious what a new railing or deck might cost? Our deck pricing guide breaks it down.
Do you need a permit to replace a deck railing?
No. In the counties we serve, adding or replacing a railing on an existing deck does not require a permit. The new railing should still meet code, including the 36-inch height, the 4-inch gap rule, and the strength requirement. As a licensed Class A contractor, we handle that paperwork for you.
Is your deck railing keeping your family safe?
Now you know the rules. A deck more than 30 inches up, measured out 3 feet from the edge, needs a guard. That guard should stand at least 36 inches tall with no gap wider than 4 inches. Stairs with four or more risers need a graspable handrail. And sometimes the best railing is the one the code never asked for.
This matters right now. Fall and winter bring slick boards and holiday guests, and they are the perfect window to plan a spring build before our schedule fills up.
Frequently Asked Questions
Does a deck under 30 inches need a railing?
Not by code. If no part of the deck sits more than 30 inches above the ground, measured at any point within 3 feet of the edge, Virginia code does not require a guard. We still recommend one for families with small children or aging parents, since even a 12-inch step off the edge can cause a nasty fall. Stairs follow their own rule, so see the handrail question below.
How high does a deck railing need to be in Virginia?
At least 36 inches, measured from the deck surface to the top of the rail. Along open stairs, the guard must be at least 34 inches above the stair nosing. A 42-inch rail is the commercial standard, and most homes do not need it, but we often suggest it on very tall decks for extra peace of mind.
What is the maximum space between deck balusters?
A 4-inch ball must not pass through any opening in the railing. That covers the gaps between balusters, the space under the bottom rail, and anywhere else in the guard. Gaps that are too wide are one of the most common reasons we see railings fail inspection.
How many steps can you have before you need a handrail?
You can have up to three steps without a handrail. Once a set of stairs reaches four or more risers, Virginia code requires a graspable handrail on at least one side, set 34 to 38 inches above the stair nosing.
Does a railing need to be on both sides of deck stairs?
It depends on how the stairs are built. Stairs with four or more risers need a handrail on at least one side. If the stairs are open on both sides and climb more than 30 inches, both open sides need guards. Stairs that run along a house wall usually need protection on the open side only.
Can a bench or planter take the place of a deck railing?
No. Benches and planters do not count as a guard. Kids climb onto them, which puts them even higher above the drop. If you want built-in seating along the edge, plan for a full railing behind it.
Do cable or glass railings meet Virginia code?
Yes, when they are built and installed correctly. Cables must be pulled tight enough that a 4-inch ball cannot push through them, which takes proper tension and post spacing. Glass panels must be safety glass made for railings. Both still need to meet the 36-inch height and strength rules, so choose a system rated for residential guards. See the before (wood) and after (glass) of this Broadway home below.
Want to see what safe, good-looking work looks like? Browse our project gallery.
Ready to plan your deck or fix a railing you do not trust? Book a free consultation with one of our project consultants, and we will help you get it right the first time.











