Rodent fencing is a physical barrier, typically made from wire mesh or hardware cloth, designed to stop mice, rats, and burrowing rodents from entering gardens, sheds, crawlspaces, or entire yards. The key to making it work is matching the mesh size, material, and installation method to the species you’re dealing with. Mice can squeeze through openings as small as 1/4 inch, while rats need only a 1/2-inch gap, so standard chicken wire or garden fencing won’t cut it.
Mesh Size and Wire Gauge
The single most important specification for rodent fencing is the mesh opening size. For mice, you need 1/4-inch hardware cloth. For rats alone, 1/2-inch mesh is sufficient, but since mice and rats often share the same territory, 1/4-inch is the safer default for any exclusion project.
Wire gauge matters almost as much as opening size. Lower gauge numbers mean thicker, stronger wire. University of Nebraska extension guidelines recommend 19-gauge wire at minimum for rat exclusion and 24-gauge for mouse exclusion in protected areas. In practice, going with a heavier gauge (16 or 19) for any outdoor fence is worth the extra cost. Thin-gauge mesh can be chewed through by a determined rat in weeks, especially if the wire isn’t welded at the intersections. Woven or welded hardware cloth holds its shape when cut and resists gnawing far better than simple twisted wire.
Galvanized vs. Stainless Steel
Most hardware cloth sold at home improvement stores is galvanized steel, meaning it has a zinc coating to resist rust. For aboveground fencing in dry climates, galvanized mesh works fine and costs significantly less. But once moisture enters the picture, whether from soil contact, sprinkler systems, or humid crawlspaces, galvanized coatings corrode over time. Rust weakens the wire and creates holes that rodents quickly exploit.
Stainless steel mesh eliminates the corrosion problem entirely. It holds up in damp soil, coastal air, and underground burial without degrading. The tradeoff is price: stainless steel hardware cloth typically costs two to three times more per square foot than galvanized. For buried sections of fence or permanent barriers around foundations, stainless steel pays for itself in longevity. For aboveground garden fencing you might replace in a few years anyway, galvanized is a reasonable choice. Wire mesh buried in soil generally lasts 5 to 10 years before needing replacement, so plan accordingly.
Preventing Burrowing With an L-Footer
A fence that only goes straight down into the ground is surprisingly easy for rodents to defeat. Rats, mice, voles, and groundhogs instinctively dig at the base of a barrier, and a vertical-only installation just means they tunnel a little deeper. The solution is an L-shaped footer: the mesh bends outward underground, creating a horizontal apron that animals hit when they dig down and try to go under.
To install one, dig a trench 10 to 12 inches deep along the fence line. Set the hardware cloth vertically in the trench, then bend the bottom portion outward at a 90-degree angle so it extends 12 to 24 inches away from the fence. A wider apron (closer to 24 inches) provides better protection against larger burrowers like groundhogs. Backfill the trench with the excavated soil, packing it firmly. The outward apron defeats digging behavior more effectively than depth alone, because the animal encounters a floor of wire mesh no matter how far it digs along the barrier.
If digging a trench isn’t practical, you can lay the apron flat on the ground surface and secure it with landscape staples, then cover it with mulch or gravel. Rodents generally won’t dig backward away from the fence to get past a surface apron, though a buried version is more reliable and less likely to be disturbed.
Aboveground Height and Climbing
Rats are strong climbers. Roof rats in particular can scale rough vertical surfaces and walk along wires with ease. For garden fencing, a minimum height of 24 inches above ground keeps most ground-dwelling rodents out, but if roof rats are a concern, you’ll need either a taller fence (36 to 48 inches) or an outward-angled overhang at the top. A 6-inch strip of smooth sheet metal along the upper edge prevents climbing, since rodents can’t grip the slick surface.
For raised garden beds, the simpler approach is to line the bottom and sides with 1/4-inch hardware cloth before filling with soil. This creates a complete cage that stops burrowing from below and entry from the sides without needing a tall fence at all.
Attaching Fence to Structures
Where rodent fencing meets a building, shed, or concrete foundation, the connection point is the most vulnerable spot. Any gap larger than 1/4 inch at a joint is an open door for mice. There are several reliable attachment methods depending on the surface.
- Wood framing: Staple hardware cloth directly to the wood using heavy-duty fence staples or screws with fender washers. Overlap edges by at least 2 inches. For added security, install a band of galvanized sheet metal (22 gauge or heavier) over the top edge of the mesh so rodents can’t peel it back.
- Concrete and masonry: Use concrete anchors or masonry screws with washers to pin the mesh flat against the surface. Seal remaining gaps with concrete mortar or a fast-setting patching compound. For holes 3 inches or larger, embed 1/4-inch hardware cloth in the top layer of the patch material before it sets.
- Metal siding: Butt the fencing tightly against the siding and cover the joint with metal flashing. Openings at joints should be no greater than 1/8 inch.
Copper mesh stuffing (sold under brands like Stuf-it) works well for packing irregular gaps before sealing them with patching compound. Avoid using expanding foam alone, as rodents chew through it easily. Foam can work as a backer behind hardware cloth and a hard-setting compound, but not as a standalone barrier.
Gates and Access Points
Every rodent fence needs at least one gate or access point, and this is where most exclusion systems fail. A standard garden gate leaves a gap at the bottom, sides, and sometimes the top that mice exploit immediately.
Line the bottom of any gate with a rodent-proof door sweep. Products like Xcluder sweeps incorporate chew-resistant fill fabric that blocks gaps while accommodating uneven ground. Choose a sweep based on the size of the gap under your gate: low-profile versions handle gaps under 1/2 inch, while adjustable models accommodate uneven surfaces with larger clearances. The goal is a final gap of less than 1/4 inch along the entire bottom edge.
For the sides, install the gate so it overlaps the fence posts by at least 2 inches on each side, with hardware cloth or metal flashing bridging any remaining gap. Spring-loaded hinges that pull the gate closed automatically prevent the kind of “left it open for five minutes” incidents that undo months of exclusion work.
Cost Expectations
A DIY rodent fence for a small garden bed might cost $50 to $150 in materials, depending on whether you use galvanized or stainless steel mesh. For a full-perimeter fence around a larger yard, materials alone can run $200 to $600, with the mesh itself being the biggest expense.
Professional rodent exclusion services, which typically focus on sealing a home or structure rather than fencing a yard, range from $300 to $1,500 for most homes in 2026. A small project sealing one or two entry points runs $200 to $400. Standard whole-home exclusion averages $400 to $800. Larger homes or projects involving attic and crawlspace work can reach $1,200 to $2,500 or more. These costs cover labor, materials, and usually an inspection to identify entry points you might miss on your own.
Maintenance and Inspection
Rodent fencing isn’t a set-and-forget solution. Walk your fence line at least twice a year, once in early spring and once in fall when rodents are most actively seeking shelter. Look for rust spots, pulled staples, mesh that’s been bent or pushed away from attachment points, and soil erosion that’s exposed the buried apron. Vegetation growing through or against the mesh gives rodents cover and leverage to work at weak points, so keep a clear strip along both sides of the fence.
Pay special attention to the gate sweep and any structural connections. These high-use areas wear fastest. Replacing a $15 door sweep once a year is far cheaper than dealing with a rodent infestation that slipped through a worn seal.