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 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:
- Leaf width: (48 − 0.5 − 0.75) ÷ 1 = 46 3/4 in. Leaf height: 72 − 2 = 70 in, so the frame gets 3 rails.
- Inner frame: 46.75 − 7 = 39 3/4 in wide and 70 − 7 = 63 in tall. Diagonal = √(39.75² + 63²) ≈ 74.5 in; adding 3½ in and rounding up gives a 78 in brace at about 58°.
- Cut list: 2 stiles at 70 in, 3 rails at 39 3/4 in, 1 brace at 78 in. Packed with saw kerf, that is 5 boards of 2×4×8 ft.
- Pickets: (46.75 + 0.5) ÷ 6 = 7.9, so 8 pickets, each 70 in long, with an actual gap of about 0.39 in.
- Hardware: the 70 in leaf needs 3 hinges with 16 in straps and one latch. Frame screws come to 25 and picket screws to 53, both including 10% extra.
- Posts: the leaf is wider than 36 in, so 6×6. Above-ground height is 72 + 2 = 74 in, half is 37, so the hole is 42 in deep and 18 in across. Post length is at least 10 ft, post centers sit 53 1/2 in apart, and two holes need about 12 ft³ of concrete, or 20 bags of 80 lb.
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
- Measure the opening at the top, middle and bottom. Use the smallest number, because posts are rarely perfectly plumb.
- Install the brace from the bottom hinge corner to the top latch corner. Reversing it puts the brace in tension and the gate will still sag.
- Do not skimp on the hinge post. A strong gate on a 4×4 set 24 in deep in loose soil will lean, no matter how well the frame is built.
- Over about 48 in wide, consider a double gate, an anti-sag cable kit or a wheel. Wide wood leaves rarely stay square.
- Leave the clearance. Wood swells in wet weather, and a gate cut to exactly the opening will bind. Allow extra if the ground slopes across the swing.
- Buy one or two extra pickets and a few extra screws. A split board costs less than a return trip.
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.