Fence Gate Calculator

</> Embed this calculator on your site

This fence gate calculator turns your measured opening into a buildable plan: exact gate leaf width, frame cut list, diagonal brace length, hinge count, post size and concrete bags for a single or double wood gate.

0 in6 in
Enter 0 if unsure. The calculator never digs shallower than 36 in.

Estimates only. By using this calculator you agree to our Terms.

</> Embed this calculator on your site

Free for any website, blog, classroom or intranet. No sign-up, no ads inside the embed. Copy the code and paste it into your page.

Preview the embed

How to Use This Fence Gate Calculator

Measure the clear opening between the two gate posts (not post center to center) and enter it with your height. Pick single or double swing, then adjust the clearances if your hardware needs different gaps. The calculator returns the width of each leaf, a cut list for a 2×4 frame, the diagonal brace length, hinge and latch counts, post size, hole size and concrete bags. The diagram above redraws with your numbers every time you calculate.

Why This Matters

The gate is the one moving part of a fence, and it is where most fences fail first. A 4 ft wide, 6 ft tall wood gate easily weighs 60 to 80 lb, and all of that hangs from one post by a lever arm of nearly four feet. Without a properly oriented diagonal brace and a post that is large and deep enough, the latch corner drops about half an inch within a season and the gate starts dragging.

Small measuring mistakes cost real money too. Forget the 1¼ in of hinge and latch clearance on a 48 in opening and you build a 48 in gate that binds the first humid week. Order lumber from a rough guess and you make a second trip for two more boards. Homeowners building a garden or side-yard gate, contractors quoting a job, and landscapers replacing a sagging gate all need the same thing: reliable dimensions before the first cut. If the gate is part of a pool barrier, stricter rules apply, so check with your building department first.

How It's Calculated

All sizes follow common builder rules of thumb for residential wood gates. They are not a code table and not engineering. Each safety-relevant number is rounded toward the stronger or longer side.

Leaf width = (Opening − hinge gap − latch gap − center gap) ÷ leaves, rounded down to 1/16 in
Leaf height = Gate height − ground clearance
Rail length = Leaf width − 7 in (two 3½ in stiles)
Brace stock length = √(rail length² + inner height²) + 3½ in, rounded up

The frame uses 2×4s laid flat (3½ in wide). Leaves 48 in tall or less get two rails; taller leaves get three. The brace runs from the bottom hinge corner up to the top latch corner so it works in compression, and it is cut long so you can trim it to fit.

Picket count is (leaf width + gap) ÷ (picket width + gap), rounded up, then reduced only if the real gap would fall under ¼ in. Hinge count is 2 up to 48 in tall, 3 up to 84 in and 4 above, never fewer than 3 if the leaf is wider than 48 in. Hinge strap length is about one third of the leaf width.

Gate posts are 4×4 only when the leaf is 36 in wide or less and 48 in tall or less; anything bigger gets 6×6. Hole depth is the largest of 36 in, half the above-ground post height (so at least one third of the post is buried), or your frost depth (the idea behind IRC R403.1.4.1), rounded up to the next 6 in. Hole diameter is three times the post width, rounded up to an even inch. Concrete volume per hole is (π × r² − post area) × depth, plus 10% extra, divided by 0.60 ft³ per 80 lb bag (0.45 ft³ per 60 lb bag), rounded up. Local codes vary.

Worked Example

A 4 ft opening, 6 ft tall single gate, 2 in ground clearance, ½ in hinge gap, ¾ in latch gap, 5½ in pickets with a ½ in target gap, and no frost depth entered:

Switching the same opening to a double gate gives two leaves of 22 7/8 in each, which is far easier on the hinges.

Tips & Common Mistakes

Frequently Asked Questions

How wide should a fence gate be?

A walk-through gate is usually 36 to 48 in wide, which is comfortable for people and wheelbarrows. Mower and garden-cart access needs about 48 to 60 in. Beyond 60 in, a double gate is the better choice.

How much smaller than the opening should the gate be?

Plan on about ½ in on the hinge side and ¾ in on the latch side, so roughly 1¼ in total for a single gate. Add about 1 in between leaves on a double gate. Always check the hinge and latch manufacturer's required gaps.

What size posts do I need for a gate?

As a rule of thumb, use 4×4 posts only for gates up to 36 in wide and 48 in tall. Larger or heavier gates need 6×6 posts or steel posts. The hinge post carries most of the load, so give it the biggest, deepest footing.

How deep should gate posts be set?

At least a third of the post's total length should be underground, with a minimum of about 36 in and below your local frost line. This calculator rounds that up to the next 6 in. Your building department can tell you the required frost depth.

How do I stop a wooden gate from sagging?

Use a diagonal brace that runs from the bottom hinge corner to the top latch corner, plus strong hinges on a solid post. For wide gates, add an anti-sag cable with a turnbuckle or a support wheel. Re-tighten the hinge screws every year.

Does this calculator work for pool gates or driveway gates?

No. Pool barrier gates must be self-closing and self-latching under rules such as IRC Appendix V, and driveway gates are much heavier. Use this tool for ordinary garden and yard wood gates, and confirm requirements with your local building department.

Related Tools