Building a fence gate that won't sag comes down to five things done in order: set strong posts, build a square gate frame, add a diagonal brace running from the bottom hinge-side corner up to the top latch-side corner, hang the gate on heavy-duty hinges, and install a latch. A gate is the moving part of a fence, which is why it needs more thought than a fixed panel that just sits still. Sag is the number one reason gates fail, and almost every case traces back to a weak post, a frame that racked out of square, or a brace that was left out or installed backward.
This guide is for DIYers building a wooden fence gate. You'll get the full sequence: measuring the gate opening, setting posts, framing, bracing, hanging, and preventing sagging, plus a clear line on when a job crosses into professional territory. Two ideas do most of the heavy lifting here. First, the load path, meaning how the gate's weight travels down to the hinge post. Second, brace direction, which depends on whether your brace works in compression or tension. Get both right and the fence gate stays true for years.
The size and swing of your gate follow from its job. A gate for foot traffic is a different animal from one that has to pass a riding mower or a car. Decide the purpose before you touch a tape measure: pedestrian access, lawn equipment, trash bins, pets, pool access, or vehicles.
Width guidance from homeowner sources like Angi lines up with common practice:
3 to 4 feet for a single gate serving walk traffic, with 4 feet often preferred because it fits people and small equipment.
5 to 6 feet for riding mowers and larger yard gear.
10 to 12 feet for vehicle access, usually as a double gate.
Anything wider than 48 inches is more prone to sag because of the extra leverage on the hinge side. Once you get past that point, split the opening into two leaves for a double gate, or plan on a gate wheel to carry the swinging end. Choose the swing direction next, and check clearance for slope, planters, or anything the gate might catch on as it opens. Measure the gate opening carefully at this stage, because a leaf sized to a guess rather than a real number is the first step toward a build that binds.
If the gate serves a public, commercial, or multifamily accessible route, the numbers change. The ADA 2010 Standards call for a 32-inch minimum clear opening at a gate and a 36-inch minimum clear width for the accessible walking surface, with limited exceptions. That's a factor for a rental property or business, not usually a back yard.
Fence and gate rules vary sharply from one city to the next, so a quick call to your local building or zoning office saves headaches later. In Raleigh, fence installation requires a zoning permit. Toledo requires zoning compliance for all fences and sets different height limits depending on where the fence sits in the yard. Mableton requires a building permit for fences 7 feet or taller and wants site-plan details with the application. None of those are national rules, which is exactly the point: yours may differ, and an HOA can add its own restrictions on top of city code.
If the fence and gate run along a boundary, confirm your property line with a survey before you build a fence there. Getting it wrong is expensive to fix.
Then call 811 before you dig a single post hole. The University of Illinois Extension lists putting up a fence among the projects that require advance utility location, and every digging job qualifies regardless of size. One thing to know: public locates generally mark public utilities only, not private lines like irrigation, a gas line running to a grill, or service to a shed or outbuilding. Those you have to account for yourself. Pool gates and commercial gates carry extra requirements, covered further down.
Match each part of the gate to how much abuse it takes. Posts sit in the ground and carry the most stress, so they need ground-contact lumber. The AWPA Use Category system, summarized in the AWPA standards excerpt, lists UC4A for wood in contact with soil, and it names fence posts specifically. The frame and pickets live above ground, where UC3B rated lumber is appropriate for exposed above-ground use. Pressure treated lumber, cedar, or redwood all hold up outdoors. Cedar in particular resists rot and insects on its own, which is why so many homeowners reach for it on visible boards and pickets. A vinyl fence takes a different approach, with the gate hardware bolted through the frame rather than screwed into wood, so match your method to the material. Untreated wood rots faster once it's exposed to rain and ground moisture, so skip it for anything structural.
Fasteners matter more than people expect. Treated lumber is corrosive to ordinary steel, so Lowe's recommends fasteners labeled for treated lumber, either stainless steel or hot-dipped galvanized. The American Wood Council advises corrosion-resistant hardware at least equivalent to hot-dip galvanized, and stainless steel for coastal or otherwise demanding exposure. Use screws rather than nails throughout the frame. Screws hold tighter and don't work loose as the wood expands and shrinks with the seasons. When you attach the frame corners, driving screws from two directions locks each joint far better than a single fastener ever could.
Hinges are where a lot of gates go wrong. Buy heavy-duty hinges rated for the gate's weight, and size up for wide or heavy leaves. Heavy strap hinges spread the load across a wider span of the stile and hold a wood gate flatter over time. Undersized hinges tear out of the wood or bend, and the gate drops. The screws that hold those hinges matter just as much as the hinges themselves, so use long lag screws that reach deep into solid framing. Round out the latch hardware with a gate stop so the gate can't overswing, and an anti-sag kit if you want extra insurance on a wider build.
A basic tool kit for the job:
Post hole digger or auger
Circular saw
Drill/driver
4-foot level
Tape measure and speed square
Clamps to hold the frame while you fasten it
Gate posts do more work than line posts. A line post just holds up a panel that sits still, but a gate post carries the full weight of a swinging leaf plus the leverage that weight creates every time the gate moves. That makes the fence posts the foundation of the whole project, and cutting corners here is the fastest way to a sagging gate.
For hole depth, the common rule of thumb from Lowe's is one-third to one-half of the post's above-ground height, and Home Depot lands in the same range at about one-third the post height. When you dig holes for gate posts, set them at least 30 inches deep, and go below the frost line in cold climates so heaving winters don't push them up out of plumb. Diameter should run about three times the width of the post. A post hole digger or auger makes cutting the post holes manageable, and taking the time to get each one to the right depth pays off for the life of the gate.
Put a few inches of gravel in the bottom of each of the post holes before the post goes in. That gives water somewhere to drain instead of pooling around the base and rotting the wood. Skipping the gravel is a quiet mistake that weakens posts over time. Set the posts in concrete for stability, and brace them plumb in both directions until the concrete cures. Getting the posts in the right position before the concrete sets is the whole game, because you cannot nudge them once it hardens. Don't hang a new gate on an old post that's already loose or soft.
The three mistakes that sink most DIY gates: posts set too shallow, no gravel at the base, and hanging a heavy gate on a weak post. For heavy or wide gates, step up to 6x6 posts. They resist twisting far better than a 4x4 and give the hinge lag screws more meat to bite into.
In regions with steep lots, wet soil, or frequent freeze-thaw movement, a local fence contractor such as DH Fence Pros can help verify whether the gate post, footing, and hardware plan are appropriate before the opening is framed. Site conditions like Seattle-style rain and sloped drainage change what a post needs to hold, and they also affect how a cedar gate weathers once it is installed.
A square frame is what keeps the gate operating smoothly, so this step earns your patience. Start by measuring the opening in at least three places: top, middle, and bottom. Posts are rarely perfectly parallel after they set, and you want the real number, not the one you hoped for. Take your time to build the gate frame with care, because everything downstream depends on it being true.
Build the frame slightly smaller than the opening so it clears the posts. That tight fit is what keeps a gate from rattling, so aim for a small, even gap rather than a sloppy one. Subtract clearance for the hinges on one side and the latch on the other, and plan a gap of roughly 2 inches at the bottom so the gate doesn't drag on the ground as the seasons shift. Leave a little space on each side as well, usually around a quarter inch, so the gate swings free instead of scraping the posts. A frame built tight to the opening will bind the first humid week of summer, so proper clearance matters as much as square corners.
Cut the parts with a circular saw and build the gate on a flat surface where nothing can throw it out of true.
Cut two vertical stiles and top and bottom rails to size, adding a middle rail for a tall gate.
Dry-fit the pieces and clamp them.
Fasten the corners with exterior screws.
Check for square by measuring diagonally from corner to corner both ways. When the two diagonals match, the frame is square.
Adjust and refasten until those numbers line up.
Following the Lowe's gate sequence, keep the hinges and latch hardware off the end grain of the rails, which won't hold screws well. This Old House makes the same point about building a substantial back frame that resists racking from the start. A gate frame in cedar or pressure treated stock, joined with corrosion-resistant screws, gives you a base that stays honest through years of wet and dry cycles.
A plain rectangle has no resistance to going out of square. Push on one corner and it collapses into a parallelogram, which is exactly what a sagging gate is. The diagonal board brace turns that flexible rectangle into two rigid triangles and gives the gate's weight a path to travel, which is the single best way to prevent sagging.
For a wood brace, which works in compression, run it from the bottom hinge-side corner up to the top latch-side corner. Set that way, the brace pushes the load down into the hinge post, where the strength is. That's the direction This Old House recommends, and it's the arrangement that carries the sagging force back toward the hinges instead of away from them. Cut the brace to fit snugly between the rails and secure it at both ends so it can transfer that load. Anchoring it near the lower hinge on the hinge side is what gives the triangle its footing.
A cable-and-turnbuckle anti-sag system runs the opposite way, because it works in tension rather than compression. That kind of brace goes from the top hinge side down to the bottom latch side, then you tighten the turnbuckle to pull the gate back into square. Get the direction backward on either system and the brace does nothing, so it's worth pausing to confirm which type you're installing before you cut or bolt anything.
Pickets don't count as structure. They're too thin and too loosely fastened to keep a gate square. For wider or heavier gates, a metal anti-sag kit adds real strength and can be adjusted later if the gate starts to drop.
Hanging is where precision pays off, because misaligned hardware means a gate that rubs, binds, or won't latch. Set the gate in the opening at the correct height first, leaving that 2-inch gap at the bottom, and block or shim it level before a single screw goes in. It helps to temporarily screw a scrap ledger across the posts to hold the leaf while you work, and it's worth an extra pair of hands or a stack of scrap wood to keep everything still while you position the leaf in the gate opening.
Attach the hinges to solid post and stile material using lag screws long enough to bite deep. Don't drive hinge screws into the end grain of a rail, since that grain won't hold under load. Use hinges rated for the gate's weight, and position them on the hinge side so the load is spread out rather than concentrated on one point. On a tall gate, a third hinge in the middle helps distribute the stress and keeps any single hinge from tearing out. Drive each of the screws straight and snug, then check that the hinges sit flush before you move on. Watch for loose screws as you go, since one that won't seat usually means you missed solid framing.
Swing the gate open and closed before you commit to everything. Check that it clears the ground, doesn't catch on the post, and returns to a clean closed position. Fix any binding now while adjustments are easy.
Install the latch on the correct post or a solid board, again keeping it off a rail end, and add a gate stop so the gate can't swing past its closed point and strain the hinges. A latch that seats cleanly is what makes the gate secure once it is closed. Hanging the gate correctly the first time saves you from chasing alignment later. Wood moves with the weather, so leave yourself a little room to adjust hardware seasonally, following the same installation logic This Old House lays out. Save the pickets for last so the finished gate lines up with the rest of the fence.
With the frame hung and swinging cleanly, attach the gate pickets so the gate blends into the adjacent fence run. Fasten the boards to the frame with galvanized or stainless screws. Mark a consistent reveal and keep the top edge aligned with the existing fence line so the gate reads as part of the same run rather than a patch. Doing this last can save time, since you only fit the pickets once the leaf hangs true.
Hold even spacing across the whole gate, using a scrap block as a spacer so every gap matches the rest of the fence. Keep all the pickets clear of the ground so they don't wick up moisture and rot from the bottom, and drive two screws at each rail so no board can cup or twist loose. Remember that the fence pickets are cosmetic. The frame and the diagonal brace carry the structural work, and the boards just make the gate match its neighbors. If the rest of your fence is cedar, matching the picket stock keeps the whole run weathering to the same tone. The same logic applies whether you are matching a wooden fence or replacing a single leaf, since the best gates are the ones you can't pick out from the run.
Some gates carry rules that a standard walk gate never sees, and pool gates top the list. The 2024 International Swimming Pool and Spa Code requires pedestrian access gates in a pool or spa barrier to open outward away from the water and to be self-closing and self-latching. Latch height and hardware placement are code-sensitive, and local jurisdictions often amend or add to the base code. Before you build a barrier gate, check with your local code enforcement office so the finished gate actually passes inspection.
Wide and double gates are their own engineering problem. Once a gate passes 48 inches, sag becomes likely, so plan for it: two leaves instead of one, 6x6 posts, heavier hinges, and a way to hold the leaves closed, whether that's a drop rod, a cane bolt, or a gate wheel to carry the swinging end. A double gate also needs a center stop or a drop rod set into a sleeve so the two leaves meet cleanly and stay secure in the closed position. A steel frame is worth considering on the widest gates. Vehicle gates and driveway gates aren't just bigger walk gates; the loads and hardware are in a different category, and a chain link vehicle gate carries its own bracing needs. Commercial gates can trigger accessibility, egress, and permitting requirements that don't apply to a backyard build.
For a wide driveway gate, a pool-barrier gate, or a gate in hard summer-dry soil, homeowners in the Sacramento/Roseville area might compare their plan with a local fencing contractor such as Fantastic Fence before setting posts. Hot-climate wood movement and code-sensitive pool hardware are exactly the situations where a second opinion saves a rebuild, especially once the posts are installed and hard to move. If you are replacing an old gate on an aging run, the same contractor can tell you whether the surrounding fence will hold a new leaf at all.
A straightforward walk gate is a half-day to one-day project for most people with basic tools. On cost, 2026 data from Angi via This Old House puts DIY gate materials at roughly $200 to $400, while professional gate installation averages around $2,340, depending on size, material, and features. A simple gate is a reasonable weekend build. The jump in the pro number reflects everything that gets harder as gates get bigger and sites get trickier, from the post holes down to the final hardware.
Call a professional if any of these describe your project:
A wide double gate or a vehicle gate
Rotted, cracked, or moving posts
An unknown or disputed property line
A retaining wall close to the post locations
A gate that has to tie into an old, out-of-square fence run
A pool-barrier or commercial gate with code requirements
None of these mean you can't build a gate. They mean the margin for error is smaller, and a mistake costs more to undo than it would have cost to get the plan checked first.
Set the posts deep and in concrete, build the frame perfectly square, and add a diagonal brace from the bottom hinge corner to the top latch corner. Hang it on hinges rated for the weight. Those four steps stop nearly all sagging before it starts, and they are the heart of how to build a fence gate that lasts.
A wood compression brace runs from the bottom hinge-side corner up to the top latch-side corner, so it pushes the load into the hinge post. A cable-and-turnbuckle system runs the opposite way because it works in tension. Secure whichever brace you choose firmly at both ends so it actually carries the load.
Aim for one-third to one-half of the above-ground post height, at least 30 inches deep, and below the frost line in cold climates. Dig holes about three times the post's width and add gravel at the base for drainage before the post is installed.
A 4-foot gate handles a push mower and most equipment, while a riding mower usually needs 5 to 6 feet. Gates wider than 48 inches sag more easily, so plan for a gate wheel or a double gate at those widths.
Most yard gates swing whichever direction has clearance and suits the traffic. Pool-barrier gates are the exception: code requires them to swing outward, away from the pool, and to be self-closing and self-latching. And if a post ever starts to move, fix the post before you touch the latch, because chasing alignment on a shifting post never holds.
Inspired by what you read?
Get more stories like this—plus exclusive guides and resident recommendations—delivered to your inbox. Subscribe to our exclusive newsletter
The products and experiences featured on RESIDENT™ are independently selected by our editorial team. We may receive compensation from retailers and partners when readers engage with or make purchases through certain links.