Deck Building Codes: A Complete Guide

There’s no secret code when it comes to building a deck

Outdoor terrace with sofa and chairs
Photo: itchySan / E+ / Getty Images
Outdoor terrace with sofa and chairs
Photo: itchySan / E+ / Getty Images
Highlights
  • Deck building codes dictate the size of the lumber, the spacing of the railings, and the height of the handrail, among other things.

  • Familiarizing yourself with these codes helps prevent future code violation issues.

  • A professional deck builder is familiar with local codes and can ensure that your deck is compliant and built correctly.

Get quotes from up to 3 pros!
Enter a zip below and get matched to top-rated pros near you.
Geo Icon

A well-designed deck provides an outdoor living space that you can enjoy throughout the warmer months. However, when building a deck, it's essential to know the local deck building codes to ensure your deck complies with them. The International Residential Code (IRC) has rules in place for deck building to ensure decks are safe and sturdy. Here’s what you need to know.

Deck Frame Building Codes

13 parts of a deck illustrated, including beams, posts, and decking

Your deck’s framing is the overall design and plan for your deck, outlining how all the wood or composite components are connected. It also includes the footing, which is the foundation of your deck.

Here are some considerations for deck joists and frames:

  • Joists and beam cantilevers have a maximum length, typically not exceeding one-quarter of the joist or beam span length.

  • Joist length is determined by the deck’s size and overall design, although lumber and material guidelines, as well as local codes, will ultimately dictate the final decision. 

  • Deck joists are spaced at 12 inches, 16 inches, or 24 inches, depending on the type of wood or composite used.

  • Blocking rows must be installed with equal spacing between 4 feet and 6 feet.

  • Rim joist and ledger widths should be equal to or greater than the joist, and they must be securely fastened to the end of each joist.

  • Deck beam bearings are determined by the deck materials. For wood and metal, beam bearings must be at least 1.5 inches. For concrete and masonry, the beam bearings must be at least 3 inches.

  • Deck footings shouldn’t add lateral pressure to the foundation of any adjacent structure, so follow local code guidelines that determine how far the deck must be built from the home.

  • Joist bearings must be securely fastened to the beams and joist hangers. 

  • Joint hanger capacities increase with the size of the joist.

Deck Railing Building Codes

Deck railings aren’t just there for aesthetic purposes. They play an essential role in keeping anyone who uses your deck safe and preventing accidental falls that could cause serious injuries.

Deck railings are required for any deck that’s higher than 30 inches from the ground. The railings must be at least 36 inches or 3 feet tall. Some states, including California and Washington, require railings to be at least 42 inches tall.

Additionally, building codes specify that the gap between balusters or spindles, as well as the gap between the deck and the bottom of the railing, cannot be larger than 4 inches to prevent small children or pets from slipping between the railings and falling off the deck.

Strength-wise, building codes stipulate that a one-square-foot area of the balusters and the top rail must be capable of withstanding a force of up to 125 pounds during a uniform load test. And finally, the top rail must pass a concentrated load test where 500 pounds of force is applied.

Deck Stair Building Codes

Not all decks need stairs. But if yours does, there are several building codes to be aware of to ensure the stairs are safe to use.

Building codes also specify that deck stair handrails must be between 34 and 38 inches from the front of the stair tread. The railings and handrail must be able to support a 200-pound load in any direction, allowing people to lean against the rail safely. The handrails must be easily graspable with a diameter between 1 ¼ inches and 2 inches.

Like with deck railings, the gap between the railing balusters cannot exceed 4 inches. Additionally, the triangular gap that’s formed between stair treads, risers, and railings cannot be larger than 6 inches for safety reasons.

DIY vs. Hiring a Pro to Build a Deck

If you have the time and the right tools, building a deck is a very DIY-friendly project, even for a novice. However, ensuring the deck meets all your local building codes can be overwhelming, even for homeowners with extensive DIY experience. A professional deck builder near you will be familiar with IRC codes, as well as any local codes, and can ensure your deck meets all specified safety requirements. They can also inspect your deck for potential violations and address any issues they find.

Cost to Build a Deck

On average, building a deck costs $8,220; however, your actual cost will likely fall within a range of $4,350 to $12,560. The exact price depends on the deck size, the type of construction material used, the deck's location, and the labor cost. Deck pros typically charge between $15 and $35 per square foot. You’ll save money by building the deck yourself, but if you don’t build it to code, you’ll face expensive issues down the road.

Frequently Asked Questions

You typically don’t need a railing and handrails on a deck that’s less than 30 inches from the ground. However, consider adding them regardless. Railings provide additional safety for you and your guests who use your deck—plus, railings give the deck a more finished look than it would have without them.

Building a deck without a permit could lead to fines for both the homeowner and the contractor. The exact penalties will depend on your state and municipal building laws. You might also be required to remove the deck and apply for a permit before you can build another. While it might be tempting to skip the permit to save a few bucks, it’ll cost you much more if you’re caught.

Need professional help with your project?
Get quotes from top-rated pros.
The homeowners guide to patio services
From average costs to expert advice, get all the answers you need to get your job done.
A guest house with a patio and a small pool
Jan 8, 2025
Jan 8, 2025
From patios and gazebos to full-on structures, your outdoor space is a blank slate. Learn how much it costs to build and furnish an outdoor room.
green  house with porch
May 20, 2025
May 20, 2025
A porch can expand your living space and add curb appeal. Find out what to budget for the cost of a porch on your home with this guide.
Backyard patio
May 20, 2025
May 20, 2025
Looking to build an outdoor entertainment space? Use this patio cost guide to get an idea of how much your exterior project will come out to.
Large deck overlooking a backyard with a wooden pergola
Jan 26, 2024
Jan 26, 2024
Talk about having it made in the shade, check out one of these 14 pergola ideas to stay cool all summer long.
Backyard brick patio with pool, deck, and table
Jun 3, 2025
Jun 3, 2025
Ready to create your perfect outdoor space? Our guide walks you through building a brick patio, from planning to laying the last brick.
A wooden deck
Feb 8, 2024
Feb 8, 2024
Do you want to add a deck that reflects the latest style? For backyard appeal, add some of these 2025 deck trends to your outdoor space.