
Fencing a Yard for Dogs
Reviewed by Justin Johnson, ISA Certified Arborist (RM-8889A)
A dog fence has one job, and dogs are good at finding the weak spot in it. Whole Dog Journal puts it plainly: if a dog can get over, under or through a barrier, assume she eventually will. So the right fence starts with your dog, and how that dog actually tries to leave, and then has to fit the height limits where you live. In the City of Missoula, for example, a front yard fence tops out at 4 feet, which is not much of a barrier for an athletic dog. This guide covers height, digging, climbing, gaps, materials and gates, along with local rules worth checking.
How tall should a fence be for a dog?
Whole Dog Journal says 6 feet is generally considered a safe bet for most dogs, but that there is no foolproof guide. Taller dogs usually call for taller fences, yet small dogs can jump and climb surprisingly well. An energetic, athletic dog may need a taller, stronger fence than one that prefers to lie in the sun. A puppy or a dog new to the household may start testing the fence as she gains confidence, so a fence that seems fine in the first month is not proven yet.
Jump height is not the only issue. Anything the dog can get a paw on gives a lift, whether that is a horizontal rail on the yard side, a woodpile, or a doghouse. Best Friends Animal Society advises looking for and moving objects the dog might use, including a doghouse or climbable tree near the fence.
How do local height limits affect a dog fence?
They often decide the layout. In the City of Missoula, the fence code limits front yard fences to 4 feet and rear yard fences to 6 feet, and it defines front and back by the front door. Barbed wire and electric fencing are not allowed in residential areas, with a narrow bear-related exception for electric. In Hamilton, solid fences on the front property line are limited to 4 feet, open fences to 6 feet, and rear fences to 6 feet. Rules are different in county zoning and rural areas; our guide to fence height and permit rules covers each.
For a jumper, the practical answer in town is often to make the rear yard the dog's yard, with a 6 foot fence and a gate across the side yard, rather than fencing the front. Missoula's code treats the yard forward of the front door as front yard, so check where that line falls on your lot before you plan the run. Any added extension still counts toward height, so ask before adding one to a fence already at the limit.
How do you stop a dog digging under the fence?
Best Friends says you will most likely need either to bury fencing 18 to 24 inches deep or to attach fencing to the bottom of the fence and lay it on the ground at least 12 inches into the yard, along the entire perimeter, or the dog will find the unprotected spot. For some dogs, railroad ties or paving stones laid against the fence are enough. Whole Dog Journal adds that a concrete strip or L-shaped footer below ground can contain a digger, and that a small dog or a digger may need a fence that sits flush with or below ground level.
Half measures can backfire. Whole Dog Journal warns that a footer only slightly deeper than the dog last dug may just teach her to dig deeper, and that patching only the escape spot pushes her to other spots. Before burying anything, call 811 so utility lines get marked. Tell your installer about irrigation lines and other private lines too; we can plan around irrigation systems if we know where they run.
How do you stop a dog climbing or jumping over?
Whole Dog Journal suggests an inward slanting panel at the top of the fence, and says half measures fail here too: adding just a foot to a fence your dog has already cleared may only encourage her to try harder. Best Friends suggests extra height using light-gauge wire, since a dog that feels it is unstable may give up, adding fencing across corners if the dog climbs only there, or using rollers mounted on top so the dog cannot grip it.
Check the code first, since any addition can affect the fence's measured height. Then look at the fence itself. Whole Dog Journal notes chain link is climbable and wooden panels can give determined climbers purchase, while vinyl is slippery enough to make climbing hard. If climbing is the issue, that is a real reason to change material, and it is why we ask about your dog before recommending anything.
Which fence material is best for dogs?
Whole Dog Journal says the best option depends on the dog, location and budget, and sums up the common materials. Chain link and other metal mesh are durable and low maintenance but climbable, flexible, and often gappy at gates or corners. Wooden panels offer more privacy and less external stimulation but need more upkeep, especially in harsh climates, and can be chewed. Vinyl is lower maintenance and longer lasting than wood, with similar benefits and harder climbing, but can be more expensive and harder to repair.
The privacy question matters more than people expect. Seeing squirrels, other dogs or people on the far side is one of the motivations the journal lists for getting out, so a dog that runs the line and barks at everything may do better behind a solid fence, height limits permitting. For the fuller comparison, see wood, vinyl, metal or composite fencing. The older guide on choosing a fence for Montana weather covers climate.
What are the gaps and weak points to check?
Whole Dog Journal says to pay attention to corners, gates and where the fence meets the ground, and offers a rule of thumb: if the dog can get her head through, the rest of her could follow. On a western Montana fence, that bottom gap changes through the year. Frost can lift posts and panels, and snow can lift or bend the bottom of the fabric; see how snow and frost heave damage fences. Walk the line every spring, after the ground thaws.
Snow is the other winter gap. A deep drift against a fence shortens it, and a dog can walk up a packed bank that was not there in October. Clear the base of the fence where a drift or shoveled pile builds up. Our guide to where to pile snow can help you plan for that.
How do you make a gate dog proof?
Gates are a common failure point, and many of the problems are human. Best Friends notes that some dogs learn to open latches, and that most gate latches can be secured by putting a clip, lock or carabiner through the latch hole. It suggests a sign saying to clip the gate, as a reminder for family and visitors. A self-closing gate helps too, as long as it latches every time.
A sagging gate leaves a gap at the bottom or a latch that does not catch, so fix that first; our guide to why gates sag explains how. Keep the gate bottom close to the ground and check the hinge side gap. If you often have contractors or meter readers coming through, think about where the gate sits relative to where the dog spends the day.
Is the fence the whole answer?
Not always. Whole Dog Journal lists boredom, loneliness, separation anxiety, fear, external stimulation and simple fun as reasons dogs leave, and Best Friends adds sexual motivation and lack of stimulation. Both still say to build a good fence, but exercise, company and training reduce the pressure on it. If anxiety is behind it, a dog can go through barriers in ways no fence handles well, so talk to your vet or a trainer.
Whole Dog Journal is also honest that no barrier is perfect. Best Friends recommends a registered microchip and up-to-date ID tags, whichever method you use.
What rules apply if a dog gets out?
Inside the city, Missoula's parks department says ordinance requires dogs to be leashed on all city streets, trails and parks, with off-leash use limited to listed dog parks and areas. Dogs in the city's dog parks must be licensed and vaccinated. Rules outside the city differ, so check with Missoula Animal Services, which handles city and county animal control, licensing and nuisance reports at (406) 541-7387. In Ravalli County, ask the county.
There is also wildlife to consider. FWP's fence guide lists kennels among the small areas where a tight exclusion fence makes sense, says to keep gates secured so animals do not find their way in, and suggests a roof on small chain link kennels so wild animals do not become trapped inside. It also warns against spiked or pointed tops that can impale deer, which suits a dog fence just as well. See wildlife-friendly fencing.
How HJ builds dog fences
We install cedar, privacy, chain link and vinyl fences across Missoula and Ravalli counties, plus gates and repairs. Tell us what your dog does and we will talk through height, bottom detail, gate and latch for your yard and your local rules. See our custom fencing and fence repair pages, and the rest of our Montana Landscaping, Lawn & Irrigation Guide.
Call HJ Property Care & Tree Service at (406) 215-7319 or request a free fence estimate and we will walk the line with you.
Need help?
HJ Property Care & Tree Service is locally owned and ISA-certified. Call for a free estimate.
This article is part of the Montana Landscaping, Lawn & Irrigation Guide, our complete guide for western Montana property owners.
Explore our custom fencing.
Sources
We cite primary sources: Montana State University Extension, the City of Missoula, and the ISA, so you can verify anything here yourself.
- How to Keep a Dog from Jumping the Fence (Kate O'Connor) (Whole Dog Journal). Last checked November 2, 2026.
- How to Stop Dogs From Escaping (Best Friends Animal Society). Last checked November 2, 2026.
- Missoula Unified Development Code, Title 22 Article 6.4 Fences (City of Missoula). Last checked November 2, 2026.
- Fence FAQs (City of Missoula). Last checked November 2, 2026.
- Fence Permit Application, with Hamilton Municipal Code 17.20.040 Fences (City of Hamilton, MT Planning Department). Last checked November 2, 2026.
- Where Can My Dog be Off-Leash? (City of Missoula Parks & Recreation). Last checked November 2, 2026.
- Animals (Missoula Animal Services) (Missoula Public Health / Missoula County). Last checked November 2, 2026.
- A Landowner's Guide to Wildlife Friendly Fences, Second Edition (C. Paige, 2012) (Montana Fish, Wildlife & Parks, Private Land Technical Assistance Program). Last checked November 2, 2026.
Ready to transform your outdoor space?
Get a free, no-obligation estimate within 48 hours. Locally owned and ISA-certified.
