Livestock Fence Laws in California: What Every Property Owner Needs to Know
June 25, 2026
If you own livestock in California, the fence surrounding your property is more than a boundary marker — it is a legal obligation. Whether you raise cattle on a rural ranch in Shasta County or keep goats on a few acres in a semi-rural community, state law holds you to specific standards for how your fence must be built, maintained, and shared with neighboring landowners.
California’s livestock fence rules draw from several sources, including the Food and Agricultural Code, the Civil Code, and the Public Utilities Code, along with county-level ordinances that can shift your responsibilities dramatically depending on where you live. Knowing which rules apply to your property before you build — or before an animal escapes — can protect you from serious liability.
Important Note: This article is for general informational purposes only and does not constitute legal advice. Fence laws vary significantly by county in California. Consult a licensed California attorney or your county agricultural commissioner for guidance specific to your situation.
What Qualifies as a Lawful Fence in California
California law defines exactly what counts as a fence capable of legally containing livestock. Under California Food and Agricultural Code § 17121, a lawful fence is any fence that is good, strong, substantial, and sufficient to prevent the ingress and egress of livestock. That functional standard — can the fence actually stop animals from getting in or out — is the baseline every livestock owner must meet.
For wire fencing specifically, the code sets concrete construction minimums. No wire fence qualifies as good and substantial unless it has three tightly stretched barbed wires securely fastened to posts of reasonable strength, firmly set in the ground not more than one rod apart, with at least one wire at least four feet above the surface of the ground. One rod equals 16.5 feet, so posts must be placed no farther than that distance apart.
You are not limited to barbed wire, however. Any kind of wire or other fence of height, strength, and capacity equal to or greater than the barbed wire standard described in the statute qualifies as a good and substantial fence. This means woven wire, high-tensile wire, wooden rail fencing, or other materials can all satisfy the law as long as they match or exceed the barbed wire benchmark in their ability to contain livestock.
The definition also extends beyond traditional fencing. The term “lawful fence” includes cattle guards of such width, depth, rail spacing, and construction as will effectively turn livestock. A properly built cattle guard at a gate or road crossing can legally substitute for a gated section of fence, provided it genuinely prevents animals from crossing.
Pro Tip: When in doubt about whether a fence material meets California’s lawful fence standard, measure your post spacing and wire height against the statutory minimums in FAC § 17121 before installation — retrofitting a non-compliant fence is far more costly than building it right the first time.
Fence-In vs. Fence-Out: Which Rule Applies in California
One of the most consequential questions for California livestock owners is whether you must fence your animals in or whether neighboring landowners must fence them out. The answer depends on where your property is located.
Across most of California, a fence-in rule applies. Under normal circumstances, the owner of livestock is required to keep them contained and is responsible for any damage done to people or property by an animal that gets loose. These requirements are known as “fencing in” laws and estray statutes. Under this system, the burden falls on you as the livestock owner to prevent your animals from straying.
But California also preserves a fence-out option in designated areas. Within a designated grazing area, the law shifts to one of “fencing out,” meaning any property owner who does not want cattle wandering onto their property must build a fence to keep them out. In those zones, a neighbor who chooses not to build a fence has no right to sue for trespass or seek reimbursement for damage caused by wandering cattle.
“Fencing out” was actually the law throughout California until 1915. Although the legislature repealed those laws due to increased urbanization and the conversion of land from ranching to other uses, individual counties still retain the right to apply fencing-out rules by enacting open range ordinances. This historical context explains why the fence-out rule still exists in some rural counties today, even though it is no longer the statewide default.
For a deeper look at how California regulates livestock ownership more broadly, see this overview of goat ownership laws in California and backyard pig laws in California, both of which intersect with fencing requirements.
Division Fence Responsibilities Between Neighboring Landowners in California
When a fence sits on or along the boundary between two properties, both landowners have skin in the game. California’s Good Neighbor Fence Law — codified at Civil Code § 841 — governs how costs and responsibilities are shared.
Adjoining landowners are presumed to share an equal benefit from any fence dividing their properties and, unless otherwise agreed to in writing, are presumed to be equally responsible for the reasonable costs of construction, maintenance, or necessary replacement of the fence. That 50/50 presumption is the starting point, but it can be adjusted by agreement or court order.
Before you spend money on a shared fence, you must give your neighbor proper notice. Where a landowner intends to incur costs for a division fence, they must give 30 days’ prior written notice to each affected adjoining landowner. The notice must include the presumption of equal responsibility, a description of the problem, the proposed solution, the estimated costs, the proposed cost-sharing approach, and the proposed timeline. Skipping this notice step can undermine your ability to recover costs later.
The equal-cost presumption is not absolute. The presumption may be overcome by a preponderance of evidence showing that equal responsibility would be unjust. In making that determination, a court considers whether the financial burden to one landowner is substantially disproportionate to the benefit that landowner receives from the fence. A court can also weigh whether the fence cost exceeds the property value increase it creates, or whether one party faces genuine financial hardship.
| Scenario | Default Rule Under Civil Code § 841 |
|---|---|
| New boundary fence needed | Both owners split costs equally after 30-day written notice |
| Existing fence needs repair | Both owners share maintenance costs equally |
| One owner benefits far more | Court may order unequal contribution |
| Written agreement in place | Agreement terms govern over the statutory default |
Fence Height, Material, and Construction Standards in California
California does not impose a single statewide height requirement for all livestock fences. Instead, the law uses the functional standard from FAC § 17121 — is the fence strong enough and tall enough to contain the specific animals being kept? That means the right height and material depend on your livestock species.
Cattle generally require the three-strand barbed wire minimum described in the statute, with the top wire at least four feet high. Horses typically need higher and more visible fencing to prevent injury from running into wire. Goats and hogs are notoriously difficult to contain and often require additional strands or woven wire panels below the top wire to prevent animals from slipping through or rooting under.
All fences that enclose livestock in areas zoned for agriculture must be constructed at an adequate height and designed to control and contain such livestock at all times. Local zoning codes, like those in Elk Grove, mirror the state’s functional containment standard and apply it at the parcel level. Always check your county’s agricultural zoning rules alongside the state code.
Post material matters too. The statute requires posts of “reasonable strength” firmly set in the ground. In practice, this means pressure-treated wood, steel T-posts, or concrete posts are all acceptable, provided they hold the wire taut and resist the pressure of animals leaning against or pushing through the fence. Rotted or loose posts that allow wire to sag can render an otherwise compliant fence unlawful.
Pro Tip: Species-specific fencing guides published by the California Department of Food and Agriculture can help you match fence height and construction to the animals you keep, reducing both escape risk and liability exposure.
Electric Fence Rules in California
Electric fences are widely used in California agriculture to manage rotational grazing, supplement perimeter fencing, and contain animals that challenge traditional wire barriers. The state permits their use but imposes specific equipment and safety requirements.
The core rule comes from the California Food and Agricultural Code. No electrified fence may be offered for sale, sold, installed, or used in California unless the electrical current is limited and regulated by an electrical controller that meets or exceeds the standards of the National Electrical Code of the National Fire Protection Association, international standards of the International Electrotechnical Commission, or the Underwriters Laboratories for intermittent-type electric fence controllers. Using a non-compliant energizer is itself a violation of state law, regardless of how the fence is built.
As of 2026, electric fences remain legal in California, but their use is governed by specific regulations. Property owners must adhere to local ordinances regarding electric fencing, including restrictions on types, placement, and purpose. Some cities and counties require a permit before installation, and local rules can add requirements beyond the state baseline.
It is also important to distinguish agricultural electric fences from electrified security fences. Under California Civil Code § 835, an “electrified security fence” is defined separately from an electrified fence as defined in the Food and Agricultural Code. Security fences used for commercial or industrial property carry their own distinct standards — including warning sign placement at intervals no greater than 30 feet — and are not interchangeable with agricultural electric fence rules. If you are fencing for livestock containment, you operate under the Food and Agricultural Code framework, not the Civil Code security fence provisions.
Warning signage is required regardless of the fence type. Electric fences must comply with safety standards ensuring they do not pose risks to animals, pedestrians, or neighboring properties, and must be clearly marked with warning signs to inform passersby of the potential hazards.
For related animal containment questions in California, the beekeeping laws in California article covers another area where state and local rules interact on agricultural property.
Road and Highway Fencing Requirements in California
Livestock near public roads and highways create serious safety risks, and California law addresses this directly. The duty to keep animals off public roadways falls squarely on the livestock owner.
A person that owns or controls the possession of any livestock shall not willfully or negligently permit any of the livestock to stray upon, or remain unaccompanied by a person in charge on a public roadway. Under California Food and Agricultural Code § 16902, allowing your animals to wander onto a highway — even negligently — exposes you to legal liability for any resulting accidents or injuries.
Railroad corridors carry their own fencing mandate. Every railroad corporation must make and maintain a good and sufficient fence on both sides of its track and property. If it fails to do so and its engine or cars kill or maim any cattle or other domestic animals on its line of road — except where the road runs through public land — it must pay the owner a fair market price for the animals, unless the killing or maiming occurred through the neglect or fault of the owner. This provision, found in California Public Utilities Code § 7626, creates a shared responsibility framework: railroads fence their corridors, and livestock owners keep animals away from those corridors.
If your property borders a state highway, check with Caltrans and your county road department about setback requirements and whether a right-of-way fence is required on your side of the boundary. Highway fencing rules can also intersect with roadkill laws in California when livestock strikes occur.
County-Level Fence Ordinances and Local Exceptions in California
California’s statewide livestock fence statutes set a floor, not a ceiling. Counties have broad authority to layer additional requirements on top of state law — and in some cases, to flip the fence-in default entirely.
Pursuant to California Food and Agricultural Code § 17124, the board of supervisors in any California county may pass an ordinance devoting the entire county or certain portions of it to livestock grazing. Such areas do not have to be limited to publicly owned lands; they can and often do encompass privately owned lands. Once a county designates an area as open range, the fence-out rule applies within that zone.
Counties in Northern California — including Siskiyou, Trinity, and portions of Shasta — have historically maintained open range or grazing designations that affect fence responsibilities. Under older statutes preserved in the Food and Agricultural Code, goats, swine, and hogs may be taken up in certain counties when they estray or trespass on the lands of others, even in areas otherwise governed by open range rules. This means the species you keep can determine which rules apply, even within the same county.
Beyond open range designations, counties and cities regulate fence materials, heights, setbacks, and permits through their local zoning codes. Urban and suburban counties tend to impose stricter limits on fence height and materials than rural counties. Before building any livestock fence, contact your county planning or agricultural commissioner’s office to confirm what local permits or approvals are required in addition to meeting the state’s lawful fence definition.
Cities and counties may regulate electrified fences, including requiring installation or use of electrified fences under permit, provided that such regulation does not permit the installation or use of electrified fences that do not conform to the state’s requirements. Local rules can add permit requirements but cannot authorize fences that fall below state safety standards.
If you keep poultry alongside your livestock, local ordinances may also govern enclosures. See the backyard chicken laws in California and rooster laws in California for how county rules interact with state animal codes on agricultural properties.
Liability When Livestock Escape Through a Defective Fence in California
When a fence fails and animals get out, the legal and financial consequences can be significant. California’s default fence-in rule means the livestock owner typically bears responsibility for damage caused by escaped animals — but the specific facts of how and where the escape occurred matter considerably.
Under normal circumstances, the owner of livestock is required to keep them contained and is responsible for any damage done to people or property by an animal that gets loose. This liability can include property damage to a neighbor’s crops or landscaping, vehicle damage from a roadway collision, and personal injury claims if someone is hurt by a straying animal.
Negligence is the central legal concept. If you knew your fence was defective — a broken post, a sagging wire, a gate left unlatched — and failed to repair it, a court is likely to find that you negligently permitted the escape. The California Food and Agricultural Code’s prohibition on willfully or negligently allowing livestock to stray onto public roads reinforces this standard. Documented fence inspections and prompt repairs are your best defense against a negligence finding.
In open range counties, the liability picture shifts. If a property owner in a designated open range area chooses not to build or maintain a fence, they have no right to sue for trespass or seek reimbursement for damage inflicted by cattle. Knowing whether your county has an active open range ordinance is therefore not just an academic question — it directly determines who pays when animals stray.
Estray procedures also apply when livestock escape and cannot be immediately recovered. The taker-up of an estray animal must use reasonable care to preserve it from injury. If the animal dies or escapes from the taker-up while being held pursuant to the estray chapter, the taker-up is not held liable. Once an animal is reported as an estray through the proper channels, the California Department of Food and Agriculture may take possession and, if the owner cannot be located, sell the animal — with the former owner losing all right to recover it afterward.
Pro Tip: Keep written records of all fence inspections, repairs, and maintenance. If a livestock escape leads to a legal dispute, documented evidence that you maintained a lawful fence and acted promptly when damage was discovered can be the difference between liability and a successful defense.
Livestock owners should also be aware of how disease reporting intersects with escape incidents. If escaped animals come into contact with other herds, you may have obligations under livestock disease reporting rules in California. For broader context on California animal law, the animal cruelty laws in California and pet laws in California pages cover overlapping areas of the state’s animal regulatory framework.
Understanding California’s livestock fence laws before a problem arises — not after — is the most practical step you can take to protect your property, your animals, and your neighbors. The rules are specific, the liability is real, and the county-level variations mean that what applies on a ranch in Siskiyou may not apply on a parcel in San Diego. Verify the rules that govern your exact location with your county agricultural commissioner and, when in doubt, consult a California attorney who practices agricultural or property law.