Deck gate calculator
A gate is a rectangle that wants to become a parallelogram. The diagonal brace is what stops it, which is why the brace length is the number worth calculating before you cut anything.
Gate opening
How this is calculated
- Leaf width = opening − clearance. For a double gate, halve it and subtract a center gap.
- Inner opening = leaf width − 2 × frame width.
- Brace = √(inner width² + inner height²), measured between the inside corners. Mount it in compression: low on the hinge side, high on the latch side.
- Boards = ⌈inner width ÷ (board width + gap)⌉, then add the gap back into the layout rather than leaving it at one end.
- Hinges = 3 for a gate under 48″ tall, 4 above that, at roughly 1/4, 1/2, 3/4 of the height.
Worked example
A 36″ opening, 3/8″ clearance, 36″ high gate, 2×4 frame:
- Leaf = 36 − 0.375 = 35.6″
- Inner = 35.6 − 7 = 28.6″ wide, 36 − 7 = 29″ high
- Brace = √(28.6² + 29²) = √(818 + 841) = 40.7″
- Boards at 5.5″ + 1/8″ = ⌈28.6 ÷ 5.625⌉ = 6 boards
Six boards at 5.5″ is 33″ of material in a 28.6″ opening, so five boards plus five gaps of 0.72″ is the alternative. The choice is aesthetic — but the brace length does not change either way.
Why gates sag, and what actually prevents it
Wood gates sag for three reasons, and only one of them is solved by a brace:
- Racking. The rectangle turns into a parallelogram under its own weight. A diagonal brace in compression solves this.
- Hinge movement. Screws working in soft wood. Through-bolts or hinge plates solve this, not a brace.
- Post deflection. The gate post itself leans. A brace on the gate makes this worse, because it transfers the load into a post that is already moving.
The practical width limit is about 48″ for a single wood leaf. Beyond that the gate needs a metal frame, a wheel, or two leaves. A 60″ wood gate with a perfect brace will still drag within a year. The post a gate hangs from carries the whole leaf as a lever, so a bracket with a stated load rating and structural lag screws at the hinge line do more for sag than the brace on its own. 4×4 post base bracket with anchor kit, 10 pack #14 × 4-1/2″ structural lag screws, 54 pack Affiliate link — the site may earn a commission if you buy.
Where gates stop behaving like fences
- It does not design the hinge or latch hardware. Those come with their own spacing and load ratings.
- It does not check the gate post. A gate needs a deeper, better-anchored post than a railing post, and that is a separate decision.
- It assumes a rectangular leaf. Arched or raked tops change the brace geometry.
- It does not account for the code requirement that a gate guarding a stair or a drop close and latch automatically — that is a hardware question, not arithmetic.
Single leaf or a pair: a decision table
The calculator gives brace length for one leaf. Deciding whether one leaf is the right answer comes first, and the width is what decides it.
| Opening width | Configuration | Reason |
|---|---|---|
| Up to 36 in | Single leaf, 3 hinges | Well inside the practical limit; a diagonal brace holds it square |
| 36–48 in | Single leaf, 3 hinges, heavy post | Works, but the hinge post needs a rated bracket and structural lag screws |
| Over 48 in | Two leaves, or a metal frame | A single wood leaf twists under its own weight even with a perfect brace |
| Guard around a stair or drop | Self-closing, self-latching | A hardware requirement; arithmetic does not satisfy it |
Hinge count follows leaf height: three up to about 48 in, four above that, spaced near a quarter, half and three-quarters of the height rather than at the ends.
Worked example: a 48 in opening as a pair of gates
One 48-inch opening, split into two leaves. Every number below comes from the same inputs the calculator uses.
- Deduct clearances. 3/8 in total side clearance and a 1/4 in centre gap: 48 − 0.375 − 0.25 = 47.375 in for two leaves.
- Each leaf. 47.375 ÷ 2 = 23.7 in wide.
- Inside the frame. 2×4 frame is 3.5 in per side: 23.7 − 7 = 16.7 in wide. At a 36 in overall height, inner height = 36 − 7 = 29 in.
- Diagonal brace. √(16.7² + 29²) = √(279 + 841) = 33.5 in, mounted low on the hinge side and high on the latch side.
- Boards. At 5.5 in board + 1/8 in gap: ⌈16.7 ÷ 5.625⌉ = 3 boards per leaf.
Next step: size the posts that hang the leaves with the deck post spacing calculator, then check how those posts are anchored in the deck railing installation guide — a gate post carries a swinging load that a railing post never sees.
Questions people actually ask
How wide can a wood deck gate be?
About 48 inches for a single leaf. Beyond that the gate twists under its own weight even with a diagonal brace, and a metal frame or a double gate becomes the practical answer.
Where does the diagonal brace go on a gate?
Low on the hinge side, high on the latch side, so the brace is in compression when the gate hangs. Reversing it puts the brace in tension and the fasteners take the load instead.
How many hinges does a deck gate need?
Three for a gate up to about 48 inches tall, four above that. Space them at roughly a quarter, half and three-quarters of the height rather than evenly at the ends.
Why does my deck gate drag after a year?
Almost always the post, not the gate. A gate post takes lateral and cyclic load that a railing post does not, and a post that was fine for railing will lean once a gate swings on it.