
Yardtally is reader-supported. Some links on this page are affiliate links. As an Amazon Associate, Yardtally earns from qualifying purchases. See our Affiliate Disclosure.
Building a garden fence to keep animals out is one of the most effective things you can do to protect your vegetables — but only if it’s built for the right pest. Rabbits walk right under one that isn’t buried. Groundhogs dig under both. The reason most garden fences fail is that they’re built for a generic “pest” rather than for the specific animal doing the damage. This guide breaks it down by animal so you build the right fence the first time — the right height, the right mesh, and the right burial depth for whatever is raiding your garden.
What’s in This Guide
- Step 1 — Identify What’s Getting In
- Fence Specs by Animal
- Best Fencing Materials
- How to Build the Fence
- Don’t Forget the Gate
- Frequently Asked Questions
Step 1 — Identify What’s Getting In
Before you buy a single post or roll of wire, figure out what animal you’re dealing with. The damage pattern tells you almost everything you need to know.
Deer tear plants rather than clip them — they have no upper front teeth, so damage looks ragged and shredded. Tracks are large, pointed, and hooved. They tend to hit at night and can reach damage more than two feet off the ground.
Rabbits clip plants cleanly, often at a 45-degree angle close to the ground. Damage is neat, low, and shows small round droppings nearby. Most active at dawn and dusk.
Groundhogs (woodchucks) take large bites out of vegetables — beans, squash, and tomatoes are favorites — and often leave partially eaten produce on the ground. They’re active during the day and leave behind obvious burrow entrances near fence lines or under structures.
Raccoons go after corn, melons, and peas, usually at night. They’re climbers and use their hands to pull ears off stalks or peel back husks. Partially eaten food left scattered on the ground is a strong indicator.
Once you know your pest, use the specs below to build the right fence for it. Source: UGA Extension — Garden Fencing Guide
Fence Specs by Animal
Rabbits
Height: 2–3 feet above ground. Mesh: 1-inch hardware cloth or poultry netting. Burial: bury the bottom 6 inches deep and bend it outward in an L-shape — cottontails don’t dig deep but they will probe for a gap at the base. Pin the flared section flat with landscape staples if you prefer not to bury it, though burial holds better over time.
Groundhogs
Height: 3–4 feet above ground. Mesh: 2-inch welded wire or hardware cloth. Burial: bury at least 10–12 inches deep with the bottom bent outward — groundhogs are persistent diggers and will follow a fence line looking for a weak spot. They also climb, so leave the top 12 inches of the fence unattached to posts so it flops outward when they try to scale it. Source: Mother Earth News — Choose the Best Garden Fence
Deer
Height: 8 feet is the standard. Deer can clear a 6-foot fence easily, especially if they know food is on the other side. Black polypropylene mesh on metal T-posts is the most common DIY deer fence — it’s nearly invisible from a distance and doesn’t require concrete. If 8-foot posts aren’t practical, a double-fence system works: two 4-foot fences spaced 4 feet apart confuses deer because they can’t judge the combined depth to jump it.
Raccoons
Height: 4 feet minimum. Raccoons are excellent climbers, so height alone won’t stop them. The most effective deterrent is a floppy fence top — leave the top 12 inches of fencing unattached and bent outward so it collapses under their weight when they try to climb over. A single strand of electric wire along the top is also highly effective for persistent raccoon pressure.
Building for Multiple Pests
If you’re dealing with both rabbits and deer — which is common in midwestern suburban gardens — build for deer height (8 feet) but use 1-inch hardware cloth for the bottom 3 feet to block rabbits and bury it 6 inches deep. The upper portion can be larger-mesh welded wire or polypropylene deer netting to keep costs down. This layered approach covers both threats in one fence. Source: CritterFence — Fence Specs by Animal
Best Fencing Materials

The right material depends on which pest you’re fencing out and how long you want the fence to last.
Hardware cloth (welded galvanized wire mesh) is the most versatile and durable option for rabbits, groundhogs, and small pests. It holds its shape when buried, resists chewing, and doesn’t rust for years. The 1/2-inch mesh size blocks nearly everything smaller than a groundhog. It’s more expensive than poultry netting but holds up far longer. Pick up a roll of hardware cloth before you start — it’s the one material worth not skimping on.
If budget is the priority, a roll of poultry netting works well for rabbits and light pest pressure. The drawback is that it bends easily, doesn’t hold a buried shape as well as hardware cloth, and wears out faster. It’s a reasonable short-term solution but plan to replace it in a few years.
Welded wire fencing (2×4-inch mesh) works well for groundhog and multi-pest installations. It’s stiff enough to stand on its own between posts and strong enough to resist climbing. Pair the bottom 2 feet with smaller-mesh hardware cloth if rabbits are also a concern.
For deer-height fencing, black deer netting (Same as poultry netting) is lightweight, nearly invisible from a distance, and the most cost-effective option at 8 feet. It’s not chew-proof and won’t stop smaller animals on its own, but for deer pressure it installs easily on metal T-posts without concrete.
How to Build the Fence

Step 1 — Mark Your Perimeter
Use stakes and string to mark the fence line. Walk it and look for natural entry points — gaps under existing structures, soft soil near the garden edge where burrowing is likely, or low spots where the grade dips. These spots need extra attention during installation. Plan your gate location before you set posts.
Step 2 — Set Your Posts
For most garden fences, posts every 8–10 feet is standard. Corner posts and gate posts take more stress and should be set in concrete. Line posts can be driven into the ground using a T-post driver for metal T-posts, or set in concrete for wood posts. Post depth should be one-third of the total post length — a 6-foot post goes 2 feet in the ground.
Step 3 — Dig the Burial Trench
For any fence meant to stop diggers, dig a trench along the fence line before you attach the wire. Depth depends on your pest — 6 inches for rabbits, 10–12 inches for groundhogs. Use a flat spade and keep the trench tight to the fence line. Dig before you unroll your wire — it’s much easier to work around posts with the trench already cut.
Step 4 — Attach and Bury the Wire
Unroll the wire along the fence line and attach it to your posts with fence staples for wood posts, or zip ties for T-posts. Work from one end to the other, keeping the wire pulled taut as you go — loose wire sags and creates gaps animals will find. Bend the bottom of the wire outward into an L-shape before setting it in the trench, then backfill and tamp firmly. The outward flare is what stops diggers — they hit the buried wire when they try to tunnel under the fence line.
Step 5 — Secure the Top
For deer fencing, make sure the top is attached securely to posts at full height — deer will push into slack fencing. For groundhog and raccoon fencing, leave the top 12 inches unattached and bent outward so it flops when climbed. For rabbit-only fencing, the top doesn’t need special treatment — rabbits don’t climb.
Don’t Forget the Gate
The gate is the most common weak point in a garden fence. Build it at least 36 inches wide for wheelbarrow access — 48 inches if you use a garden cart. The gap at the bottom of the gate is where rabbits and groundhogs get in first. Run your buried wire under the gate opening and secure it flat to the ground with landscape staples, or hang the gate low enough that it clears the ground by no more than an inch. A gate that swings freely but leaves a 4-inch gap at the bottom defeats the entire purpose of the fence. Source: BarrierBoss USA — Best Fence for a Vegetable Garden
Frequently Asked Questions About Garden Fences
How tall does a garden fence need to be to keep deer out?
8 feet is the standard for reliable deer exclusion. Deer can clear a 6-foot fence when motivated by food on the other side. If an 8-foot fence isn’t practical, a double-fence system — two 4-foot fences spaced 4 feet apart — works by confusing deer’s depth perception so they won’t attempt the jump.
How deep should I bury a garden fence?
It depends on the pest. For rabbits, 6 inches is sufficient. For groundhogs, bury 10–12 inches and bend the bottom outward in an L-shape. For gophers, go deeper — at least 18–24 inches of hardware cloth buried vertically. Always bend the buried section outward away from the garden so diggers hit the barrier before they reach the fence line.
What is the best fencing material to keep animals out of a garden?
Hardware cloth with 1/2-inch or 1-inch mesh is the most effective all-around material for small-to-medium pests. It’s galvanized, chew-resistant, holds its shape when buried, and lasts for years. For deer, black polypropylene deer netting on metal T-posts is the most practical and cost-effective option.
Can groundhogs climb garden fences?
Yes — groundhogs can climb as well as dig. A standard fence won’t stop them unless the top is left unattached and bent outward so it collapses under their weight. Burying the bottom 10–12 inches in an L-shape addresses the digging. Together, the floppy top and buried footer is the most reliable groundhog fence setup.
How do I keep rabbits from getting under my garden fence?
Bury the bottom of the fence at least 6 inches deep and bend the buried section outward in an L-shape, or pin the flared section flat to the ground with landscape staples. Use 1-inch mesh or smaller — rabbits can squeeze through larger openings. Check the fence line seasonally for gaps where the wire has pulled away from the soil.
Do I need a permit to build a garden fence?
It depends on your municipality and the fence height. Low garden fences (under 3 feet) typically don’t require a permit. Taller fences — especially anything approaching 8 feet for deer exclusion — may require a permit or need to comply with local zoning rules. Check with your county or HOA before building anything over 4 feet tall.
