Nails & Numbers

HomeDecking › Deck Size Calculator

Deck Size Calculator

Area and perimeter, plus the IRC R312.1.1 guard trigger

Deck size calculators give you an area. The useful question is what your dimensions and your height actually oblige you to build, and the answer is that the IRC sets no size limit for a deck at all. What it does set is a height at which a guard becomes mandatory, and the wording of that rule is more subtle than the number suggests.

Deck size and what it obliges

ft
ft
in
in
in
in

Guard trigger and dimensions quoted from IRC R312.1.1 through R312.1.3.

Specification summary

Generated from on . Reopen that address to reproduce these figures exactly.

Entered

Result

36 in horizontally
Where a guard becomes mandatory, and how it is measured

Worked example

A 16 ft by 12 ft deck hung on a ledger along one long side, sitting 36 in above the grade.

  1. Area. 192 sq ft. This is the number everybody wants and the one the code has no opinion about.
  2. Open perimeter. 56 ft total less the 16 ft against the house = 40 ft of open edge.
  3. Guard. 36 in is more than 30, so R312.1.1 requires a guard along all 40 ft, 36 in high, passing no 4 in sphere.
  4. Drop the height to 30 in and the guard requirement disappears, which is why so many low decks are built at exactly 30.
  5. The catch. The rule measures to the grade at any point within 36 in of the edge. On a falling lot, 30 in at the house can be 34 in three feet out.

Set the height to 28 in and the verdict passes with a warning: you are inside 6 in of the trigger, and on sloping ground that margin is not yours to keep.

The formula

Area is trivial. The parts worth printing are the perimeter that a guard runs along and the trigger height:

A = LW    open = 2(L + W) − attached    guard required when h > 30 in
A
deck area, sq ft
L, W
length and width, ft
attached
the edge against the house, which needs no guard
h
height from the walking surface to the grade below, measured at any point within 36 in horizontally of the edge

The last term is the whole subtlety. h is not the height at the house, it is the largest height within 36 in of the edge, which on a sloping lot is a different number.

There is no maximum deck size in the IRC

People search for a deck size calculator expecting a limit, and there is not one. The IRC constrains how far a joist may span, how far a beam may span, how deep a footing must go and when a guard is required. It does not cap area.

What area does drive is quantity: joists, boards, footings and fasteners all scale with it, and those are the numbers this page prints alongside the code question.

The code question is height, and R312.1.1 states it in a way that is easy to half-read. Thirty inches is only the first half. The second half is that the measurement is taken to the grade below at any point within 36 in horizontally of the edge, which is what turns a 28 in deck on a falling lot into a 34 in deck.

A great many low decks are built at exactly 30 in for exactly this reason. That is a legitimate design decision, but it leaves no margin, and margin is what a sloping site takes away.

The 30 inch rule, and the half of it everybody drops

Deck area triggers nothing in the code. Deck height triggers a guard, and R312.1.1 states the test in full:

Guards shall be provided for those portions of open-sided walking surfaces, including floors, stairs, ramps and landings that are located more than 30 inches (762 mm) measured vertically to the floor or grade below at any point within 36 inches (914 mm) horizontally to the edge of the open side. Insect screening shall not be considered as a guard.

Routt County, Colorado, reproduction of the 2021 IRC Code and Commentary, 2021 IRC, read from the IRC Code and Commentary

Read the second half. It is not “30 inches off the ground”. It is 30 inches to the grade below at any point within 36 inches horizontally of the edge. On a flat lot those are the same sentence. On a sloping lot they are not, and a deck that measures 26 in at the house can be over 30 in where the ground falls away three feet out. That deck needs a guard, and it is the case inspectors actually fail.

The note about insect screening is there for the same reason: a screened porch over 30 in still needs a real guard behind the screen.

Where a guard is required, two more numbers follow:

Required guards at open-sided walking surfaces, including stairs, porches, balconies or landings, shall be not less than 36 inches (914 mm) in height as measured vertically above the adjacent walking surface or the line connecting the nosings.

R312.1.2, height

Required guards shall not have openings from the walking surface to the required guard height that allow passage of a sphere 4 inches (102 mm) in diameter.

R312.1.3, opening limitations

The stair exception lowers that to 34 in measured from the nosing line, and where the top of the guard doubles as the stair handrail it must be between 34 and 38 in. The 4 in sphere is what sets baluster spacing, and the deck railing calculator solves the layout for it.

Frequently asked questions

Is there a maximum deck size in the building code?
No. The IRC limits joist and beam spans, footing depth and ledger connections, but it does not cap deck area. What your deck size changes is quantity, and what your deck height changes is whether a guard is required.
At what height does a deck need a railing?
More than 30 inches above the floor or grade below, per IRC R312.1.1, measured at any point within 36 inches horizontally of the open edge. A deck at exactly 30 inches does not require one; a deck at 31 does.
How is deck height measured for the guard rule?
Vertically from the walking surface to the floor or grade below, and critically, at any point within 36 inches horizontally of the edge. On a sloping lot the governing measurement is at the low point within that 36 inch band, not at the house.
How tall does a deck guard have to be?
Not less than 36 inches above the walking surface, per R312.1.2. On the open sides of stairs it may be 34 inches measured from a line connecting the nosings, and where the top of the guard doubles as the stair handrail it must be between 34 and 38 inches.
What is the maximum gap in a deck railing?
No opening may allow a 4 inch sphere to pass, per R312.1.3, from the walking surface up to the required guard height. That is what fixes baluster spacing.
Does a screened porch need a guard?
Yes, if the walking surface is more than 30 inches above grade. R312.1.1 says explicitly that insect screening is not a guard.
How many joists does a 16x12 deck need?
Thirteen at 16 inches on centre, including the closing joist at the far end. Whether a joist can span 12 ft at that spacing depends on species and size and is set by IRC Table R507.6.

Check these numbers yourself

How every figure here is verified: Sources & Method. Who builds this: About. Found something wrong? Tell us and it gets fixed or removed.

Figures on this page last checked against the source documents on 2026-09-07. Codes are amended locally; confirm against the edition your jurisdiction enforces.

Related calculators

Height is the code question, not area. Guard figures are from the 2021 IRC as reproduced above; confirm the edition your jurisdiction has adopted. This page does not size joists, beams, posts or footings.