California Fence Laws in 2026: Your Neighbor Rules Matter
Most people have no idea how strict California’s fence laws actually are. Seriously. You could spend thousands building a fence, only to find out it violates local codes. Then you’re forced to tear it down. We’ve seen it happen. Let’s make sure that doesn’t happen to you.
California takes fences seriously. There are state laws, local city rules, HOA regulations, and neighbor agreements all playing a role. It sounds complicated. Honestly? Once you understand the basics, you’ll be fine.
What Is a Boundary Fence, Anyway?

A boundary fence is basically any fence that sits on or near the line between your property and your neighbor’s property. Think of it like a shared wall—both of you own it, technically. You’re probably wondering: why does that matter?
It matters because California law treats boundary fences differently than fences entirely on your property. The state assumes both neighbors benefit from a boundary fence. So both neighbors have equal responsibility. That includes paying for it, maintaining it, and fixing it when it breaks. Right? Maybe not what you expected.
The Good Neighbor Fence Law Explained
This is the big one. California Civil Code Section 841 is called the “Good Neighbor Fence Law” for a reason. It spells out exactly what you and your neighbor owe each other.
Here’s the core principle: adjoining landowners share equally the responsibility for maintaining the boundaries between them. That means if a boundary fence needs repairs, both property owners should split the cost. Both should maintain it. Both should care about its condition.
Wait, what if your neighbor refuses to help? This happens more than you’d think. California law lets you handle this. But there’s a process. You can’t just fix the fence and demand payment—well, you can, but good luck getting paid. The smart move is to follow the law’s steps.
The 30-Day Notice Requirement

Before you build or repair a boundary fence, you must give your neighbor 30 days’ notice. Yep, 30 days. This isn’t optional. This is required.
Your notice letter needs to include specific information. You must outline project details and expenses. The letter should describe what’s wrong with the fence, what you plan to do about it, estimated costs, timeline, and how you plan to split the expenses. Pretty straightforward stuff.
Why the 30-day notice? It gives your neighbor time to review the plan and offer input. Maybe they have a different contractor. Maybe they want a different style. The law requires good communication upfront. It prevents the kind of surprise that ruins neighbor relationships.
How Tall Can Your Fence Be?
Here’s where local rules kick in. California doesn’t set one universal height limit for fences. Instead, cities and counties set their own rules. This is where most people get confused.
Generally speaking, front yard fences are limited to 3.5 feet and backyard fences to 6 feet in many California cities. But that’s not everywhere. Some cities allow different heights. Corner lots have different rules. Sloping properties change things too.
Want the real answer for your specific area? Call your city’s planning department. Seriously, just call them. They’ll tell you exactly what height is legal on your property. It takes five minutes and saves you thousands. Don’t guess on this one.
Setback Requirements: How Close to the Property Line?

This is where homeowners run into trouble. A setback is the distance your fence must be from your property line, the sidewalk, or the street. It sounds simple. It’s not.
Different cities have different setback rules. Los Angeles requires 2-inch setbacks in most residential areas, while San Francisco allows fences directly on property lines in rear yards but requires 3-foot setbacks in front yards. That’s a huge difference, right?
Some cities require setbacks from the sidewalk, not the property line. Others focus on visibility at driveways. Your job is to know your city’s specific rules before you build. One common mistake? People don’t get accurate property surveys before building. They think they know where the line is. They’re wrong. Then they build six inches too close. The city tells them to tear it down.
Pro tip: Hire a professional surveyor before you build. Seriously. It costs a few hundred dollars. But it saves you thousands if you get the setback wrong.
What Materials Can You Actually Use?
California allows most common fence materials. Wood, vinyl, aluminum, wrought iron—generally fine. But certain materials are restricted.
Barbed wire fences are not allowed in residential areas. Electric fences are heavily regulated. An owner of real property shall not install or operate an electrified security fence where a local ordinance prohibits the installation or operation of an electrified security fence. Even when they’re allowed, they need warning signs, proper electrical specifications, and they can only be used on commercial or industrial property.
Chain-link fencing is legal, but honestly? Many neighborhoods discourage it. HOAs often ban it. If you want to avoid neighbor drama, choose something more attractive. The last thing you need is a fence that lowers your property value and annoys everyone looking at it.
The “Spite Fence” Rule
Okay, this is an interesting one. California has a law against spite fences. A spite fence is basically a fence you build specifically to annoy your neighbor. It’s not for privacy or security. It’s just to be mean.
Any fence or other structure in the nature of a fence unnecessarily exceeding 10 feet in height maliciously erected or maintained for the purpose of annoying the owner or occupant of adjoining property is a private nuisance. If your neighbor can prove you built a fence just to irritate them, they can take you to court. You could be forced to remove it or pay damages.
The key word is “maliciously.” If you have a legitimate reason for your tall fence—privacy, property protection, security—you’re probably fine. But if your only reason is “my neighbor annoyed me,” don’t do it. It won’t end well.
When Do You Need a Permit?
This varies by city. Some cities require permits for all fences. Others only require permits for fences above a certain height. Common threshold? Six or seven feet.
Here’s the thing though: even if you don’t need a building permit, you probably need planning approval. Most cities still require you to get approval from the Planning Department to ensure your fence complies with all local zoning rules, like setbacks from property lines.
The permit process isn’t just about your fence itself. It’s about where you’re building it. The planning department checks your property lines, easements, visibility from driveways, and neighborhood compatibility. It’s annoying, sure. But it prevents costly mistakes.
Call your city planning department before you build anything. Ask what permits you need. Get a clear list of requirements. Then follow it exactly.
Fences on Sloping Land: The Exception
Got a hilly property? The height rules change. When your land slopes, fence height is measured differently. What’s 6 feet at the bottom might only be 4 feet at the top.
This isn’t a loophole to make your fence taller. It’s a recognition that sloping properties require different standards. Some areas measure height from the average ground level. Others measure at specific points along the fence line. Ask your city—they have specific rules for this.
Water-Related Fencing
If your property is near water—creek, river, pond, ocean—special rules apply. Fences near water can affect runoff, flooding, and environmental habitats. Your city or county likely has specific requirements.
Don’t assume your standard fence is fine near water. Check with your local building department. Some areas require specific types of fences near water. Others limit height or require specific materials. It’s worth knowing before you invest in a fence.
HOA Rules: When They’re Stricter Than City Law
If you live in an HOA community, you’re not just following city rules. You’re following HOA rules too. And guess what? HOA rules are often stricter.
Your HOA has something called CC&Rs—Covenants, Conditions, and Restrictions. These documents spell out exactly what fences you’re allowed to build. They might specify colors, materials, heights, setbacks, and styles. Much more detailed than city rules.
Here’s the problem: many people ignore HOA requirements because they follow city rules. Wrong move. You need approval from both. First, check your HOA documents. Get their approval in writing. Then get your city permit. Do both. Don’t skip the HOA step.
What happens if you build without HOA approval? They can fine you. They can place liens on your property. In extreme cases, they can force you to remove the fence at your expense. It’s not worth the risk.
Shared Fences and Cost-Sharing Disputes
This is where things get complicated. You and your neighbor both want a fence. You agree it’s a good idea. But then you disagree on cost.
California law says you both pay equally. But what if your neighbor refuses? You have options. First, send that 30-day notice letter we discussed. Make your case clearly. Sometimes people just need time to think about it.
If they still refuse, you can have the fence built and then sue them in small claims court to recover their share. This actually works. Courts regularly order neighbors to pay. But you have to pay first and document everything.
Better option? Try mediation. Many cities offer free mediation services for neighbor disputes. A neutral third party can help you reach an agreement without court. It’s faster, cheaper, and less damaging to your neighbor relationship.
Property Line Disputes
Not sure where your property line actually is? This causes more fence disputes than anything else. People think they know where the line is. They’re often wrong.
Get a professional survey. This costs a few hundred dollars. It gives you an official, legal document showing exactly where your property ends and your neighbor’s begins. Once you have that, the fence location is crystal clear. No arguments. No “I thought the fence was supposed to be here.”
If you and your neighbor have conflicting surveys, you might need to go to court. But honestly, if you start with one good survey that both parties accept, most disputes disappear.
What Happens If Your Fence Violates Local Rules?
The city discovers your fence doesn’t meet code. Now what? Depending on the violation, you might get a warning. You might get a fine. In serious cases, you might be ordered to remove or modify the fence.
Fines vary by city. Some cities fine a few hundred dollars per day of non-compliance. If you ignore it for months, those fines add up fast. Removal orders are even worse. You’re paying a contractor to tear down a fence you already paid for.
Best approach? Get it right the first time. Invest in planning. Get permits. Follow the rules. It costs less than fixing mistakes.
Easements and Utility Lines
Before you build any fence, you need to know if easements run through your property. An easement gives someone else the right to use part of your land—usually for utilities like water, gas, electricity, or sewage.
You can build a fence on an easement, but the utility company can remove it if they need access. They don’t have to ask permission. They don’t have to warn you. They just remove it. That’s the deal with easements.
Call 811 before you dig or build. This free service marks underground utilities on your property. It protects you from hitting gas lines or electrical cables. It also shows you where easements exist. Do this. Seriously. Hitting a gas line is dangerous and expensive.
Pool Fences: Stricter Rules Apply
Got a swimming pool? The rules change. California Pool Safety Act (Senate Bill 442) requires specific safety features around pools. These rules are much stricter than regular fence rules.
All new or remodeled in-ground pools in California must have a physical barrier and at least two of the 7 drowning prevention safety features. A compliant fence is one part of this. But it’s not the only requirement.
Pool fences need specific heights. Gates must have specific locking mechanisms. Materials must prevent climbing. Spacing between vertical posts can’t allow a child to pass through. These aren’t guidelines. These are legal requirements.
If you have a pool, hire a contractor experienced with pool fence codes. This isn’t an area where you can wing it. The liability risk is too high.
Agricultural Properties and Livestock Fencing
If your property is rural and involves livestock, different rules apply. California has specific standards for fences designed to contain animals.
A lawful fence is any fence which is good, strong, substantial, and sufficient to prevent the ingress and egress of livestock. For barbed wire fences specifically, no wire fence is a good and substantial fence 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, one of which wires shall be at least four feet above the surface of the ground.
These rules exist to prevent livestock from escaping and damaging neighbors’ property. If you’re building agricultural fencing, talk to your county extension office. They can guide you on livestock-specific requirements.
Fence Maintenance and Ongoing Responsibility
Building a fence is one thing. Maintaining it is another. Under California law, both neighbors are responsible for maintaining boundary fences.
If your fence is falling apart, your neighbor can’t force you to fix it immediately. But they can eventually take legal action. They can fix it themselves and ask for their share of costs. Or they can sue you.
The reality? Don’t let your fence fall into disrepair. Fix issues as they arise. Paint or stain it as needed. Replace damaged sections. Show your neighbor you’re taking the maintenance seriously.
Good maintenance prevents disputes. It also keeps your fence looking nice and maintaining your property value. It’s worth the effort.
When Insurance Covers Fence Damage
Your homeowner’s insurance might cover fence damage. It depends on your policy. Some policies classify fences as “other structures” and cover them at a certain percentage.
Here’s the catch: for boundary fences, the insurance situation gets messy. Usually insurance only covers your share. If the fence damages and both neighbors share ownership, you need written agreement about which portion each person owns and maintains.
Review your insurance policy. Ask specifically about fence coverage. Get clarification in writing. For shared fences, put your cost-sharing agreement in writing with your neighbor. This prevents insurance disputes later.
Resolving Disputes Without Court
Not every neighbor dispute needs a court. First option? Talk directly with your neighbor. Be honest, be reasonable, and explain your position clearly.
If direct conversation doesn’t work, try mediation. Many California cities offer free mediation services through local housing authorities. A neutral third party helps you both find common ground. Most disputes settle in mediation.
Small claims court is the next step. You can sue for your portion of costs (up to the small claims limit, which varies by county but is usually $5,000-$10,000). Small claims courts are simpler than regular courts. Less formal. Lower costs. Faster resolution.
Only hire an attorney for disputes exceeding small claims limits or involving complex property line questions.
Recent Changes to California Fence Laws
California’s fence laws are pretty stable. But there have been recent updates worth knowing about. In 2024, Senate Bill 235 addressed electrified security fences, which became operative January 1, 2028, requiring specific electrical standards and warning signage.
Most of the changes in recent years focus on pool safety and electrified fences. These don’t affect typical residential fencing. But if you’re considering electrified fencing, understand the new rules. They’re strict.
Check with your city annually if you’re planning a fence project. Building codes and local ordinances change. What was legal two years ago might now require permits. Staying informed protects you.
How to Get Your Fence Project Started Safely
Step one: check your HOA documents if you’re in an HOA. Get their requirements. Get written approval if needed.
Step two: contact your city planning department. Ask what permits and approvals you need. Ask about height limits, setback requirements, and materials restrictions. Get everything in writing.
Step three: hire a professional surveyor if you’re building on or near a property line. It costs money but prevents expensive mistakes.
Step four: call 811 to mark underground utilities.
Step five: send your neighbor the 30-day notice letter if it’s a boundary fence. Include all required information. Keep a copy for your records.
Step six: get your permits before you build. Not after. Never without.
Step seven: work with a licensed, insured fence contractor who understands California codes. Don’t just hire the cheapest option. Choose someone who knows the rules.
Following these steps takes time. But it prevents headaches, fines, legal disputes, and costly mistakes. Trust us—it’s worth it.
Frequently Asked Questions
Can I build a fence directly on my property line? In California, you generally need to build the fence entirely on your property, not directly on the property line. Setback requirements vary by city. Some cities allow very small setbacks (2 inches), while others require larger distances. Always check your city’s specific rules before building. When the fence is on the boundary, you and your neighbor share responsibility for it.
Who pays for the fence when neighbors disagree? If it’s a boundary fence, California law assumes equal cost sharing. If your neighbor refuses to pay, you can have the work done and then sue them in small claims court to recover their share. Document everything. Keep receipts and copies of your 30-day notice letter. Small claims courts regularly award these disputes.
Do I need a permit for a small fence? It depends on your city. Some require permits for all fences. Others only require permits for fences above 6 or 7 feet. Even if you don’t need a building permit, you probably need planning approval. Always check with your city before building. It takes 15 minutes and saves thousands.
Can my HOA prevent me from building a fence? Yes. HOAs can impose stricter rules than cities. If your HOA has fence restrictions and you build without approval, they can fine you and force removal. Always get HOA approval before submitting city permits. Do both.
What if my neighbor’s fence is on my property? If your neighbor’s fence encroaches on your property, you have the right to remove it or ask them to move it. Document the encroachment with photos and a property survey. Send a written letter requesting they correct it within a reasonable timeframe. If they refuse, you may need to involve an attorney or small claims court.
Can I paint my fence any color? Paint color depends on your city and HOA rules. Some HOAs require specific colors. Some cities have restrictions for historic districts. Generally, you can paint your fence most colors, but always check first. Don’t assume something is fine just because you like it.
What happens if I build a fence without a permit? Fines depend on your city but can range from hundreds to thousands of dollars. You may be forced to tear down the fence and pay for removal. Your neighbor can report the unpermitted work. Issues with unpermitted fences can surface when you try to sell your home. Always get permits.
Is my homeowner’s insurance going to cover my fence? Some policies cover fences as “other structures.” Coverage is usually 10% of your home’s insured value. For shared fences, only your portion is covered. Review your specific policy. Fences damaged by weather are usually covered. Damage from lack of maintenance typically isn’t.
Can I require my neighbor to split a fence cost if they don’t want the fence? It depends. If the fence provides mutual benefit (like privacy on both sides), both neighbors typically share costs. If only one person benefits, that person might bear full costs. The 30-day notice letter explains this. If they still refuse, small claims court makes the final decision.
How tall can a boundary fence be in California? Most residential areas allow 4-6 feet in backyard and 3-4 feet in front yard. But rules vary significantly by city. San Francisco, Los Angeles, Sacramento, and San José all have different requirements. Check your specific city for exact measurements.
Final Thoughts
California fence laws aren’t actually that complicated once you understand the key rules. Front yard fences are limited to 3.5 feet and backyard fences to 6 feet in many areas, but your city might have different rules. The Good Neighbor Fence Law requires shared responsibility for boundary fences. You need 30 days’ notice before building. You probably need permits and planning approval.
Most importantly? Talk to your city planning department before you start. Get everything in writing. Communicate with your neighbor early. Hire professionals who know California codes. These simple steps prevent 90% of fence problems.
Good fences really do make good neighbors. But only when you follow the rules. Now you know them. Go build something great.
References
California Civil Code Section 841 – Good Neighbor Fence Law
California Building Code and Local Setback Requirements
California Civil Code Section 835 – Electrified Security Fences
California Civil Code Section 841.4 – Spite Fences
California Pool Safety Act (Senate Bill 442) Requirements
