Good Neighbor Fence Law in California: Costs, Notice, City Rules

California's good neighbor fence law, Civil Code 841, starts from a simple presumption: neighbors who share a dividing fence share its benefit, so they're presumed equally responsible for the reasonable cost of building, maintaining or replacing it. Before you spend money on that fence, the law also requires 30 days' written notice to each affected neighbor.

This guide covers what the statute says, what the notice must include, when a neighbor may pay less, and the height and permit rules we confirmed for Cupertino, Palo Alto, San Mateo and Sunnyvale as of November 2026. Fence rules vary by city and zone, so confirm with your own city before you build.

What Civil Code 841 says

As of November 2026, section 841 reads as AB 1404, the "Good Neighbor Fence Act of 2013," enacted it, effective January 1, 2014. That bill repealed and replaced an older rule requiring neighboring, or "coterminous," owners to maintain the fences between them. Under the statute:

  • Boundaries. Adjoining landowners share equally in the responsibility for maintaining the boundaries and monuments between them.

  • Fences. Adjoining landowners are presumed to share an equal benefit from any fence dividing their properties. Unless they've agreed otherwise in a written agreement, they're presumed equally responsible for the reasonable costs of construction, maintenance or necessary replacement.

  • Who counts. A "landowner" is a private person or entity that lawfully holds a possessory interest in the property. Cities, counties, districts and other public agencies are excluded. "Adjoining" means contiguous to or in contact with.

The presumption covers reasonable costs, not whatever fence one neighbor wants, and a written agreement can change the split, so put any other arrangement in writing.

A separate statute, Civil Code 841.4, covers spite fences: 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."

The 30-day notice

A landowner who intends to incur costs for a dividing fence must give 30 days' prior written notice to each affected adjoining landowner. Under the statute, the notice must include:

  • Notification of the presumption that the neighbors are equally responsible for the reasonable costs.

  • A description of the nature of the problem facing the shared fence.

  • The proposed solution.

  • The estimated construction or maintenance costs.

  • The proposed cost-sharing approach.

  • The proposed timeline for getting the problem addressed.

When a neighbor may pay less, or nothing

The presumption of equal responsibility can be overcome by a preponderance of the evidence showing that equal sharing would be unjust. In deciding that, a court must consider:

  • Whether the financial burden on one landowner is substantially disproportionate to the benefit that landowner gets from the fence.

  • Whether the cost of the fence would exceed the difference in the property's value before and after it's installed.

  • In the statute's words, "whether the financial burden to one landowner would impose an undue financial hardship given that party's financial circumstances as demonstrated by reasonable proof."

  • The reasonableness of the project, including whether the costs appear unnecessary or excessive, or appear to result from one landowner's personal aesthetic, architectural or other preferences.

  • Any other equitable factors.

If the presumption is rebutted, the court may order a contribution of less than an equal share, or no contribution at all.

The aesthetics factor is worth noting on a mid-century street. If you want a custom horizontal-board or grooved-panel fence that costs more than a standard replacement, the extra may be yours to pay.

If a fence cost dispute does go to court, the California Courts self-help site says people can generally sue for up to $12,500 in small claims court, or up to $6,250 for a business, and the filing fee is $30 to $100.

Height and permit rules in four cities

Civil Code 841 covers who pays. Height, location and permits come from your city, and front, side and rear yards usually have different limits. Here's what each city's code or official handout says for the four cities we checked.

Cupertino

From the city's Fences page; its neighbor approval form cites Cupertino Municipal Code section 16.28.040.

  • In R1, R2 and R3 zones, a fence up to 8 feet tall may be built at the property line, except on the front property line.

  • In the front yard setback, a 3-foot fence is allowed.

  • Up to 7 feet, neither neighbor approval nor a building permit is required. Up to 8 feet, both are required, and the neighbor approval form is submitted with the building permit application.

  • A fence that doesn't meet the regulations needs a fence exception, granted after a public hearing if the findings can be made. Rules differ in the RHS and OS zones.

Palo Alto

Palo Alto Municipal Code chapter 16.24 measures height from natural grade:

  • Between a street setback line and the lot line: up to 4 feet, with set limits for taller posts, entry gates and trellises.

  • Beyond the street setback line in a front yard or street side yard: up to 6 feet.

  • Beyond the street setback line in an interior side yard or rear yard: up to 7 feet.

  • Corner lots, through lots, intersections and lots next to frontage roads, railroads or commercial areas have their own rules. We didn't confirm Palo Alto's permit rules, so ask the city.

San Mateo

From the city's handout, revised March 24, 2025, which points to San Mateo Municipal Code chapter 27.84.

  • The general limit is 6 feet for fences, walls and hedges.

  • Front and street side yards are limited to 3 feet, with 3½ feet for posts no wider than 1 foot and 8 feet for an entry structure over a pedestrian gate no more than 5 feet wide.

  • Interior side and rear yards can go to 8 feet if the part above 6 feet is at least 50% open, such as lattice, and a building permit is issued with the neighboring owners' consent.

  • A building permit is required for a fence over 7 feet. A fence over the height limits needs a Site Plan and Architectural Review fence exception, with notice to neighbors within 500 feet.

  • On a slope, height is measured from the upper lot's ground level.

Sunnyvale

Sunnyvale Municipal Code chapter 19.48 sorts fences by yard and height in Table 19.48.025:

  • Front yard, which includes the area between the face of the building and the street: up to 4 feet is allowed, over 4 to 6 feet needs a miscellaneous plan permit, and over 6 feet needs a use permit.

  • Side or rear yard: up to 8 feet is allowed, and over 8 feet needs a use permit.

  • Front yard height is measured from the top of the curb, or the street where there's no curb. Side and rear yard height is measured from the highest adjoining grade.

  • Lots with a "reducible front yard" have separate rules; ask the city whether yours has one.

The curb measurement matters on a raised lot. In a July 2026 case before the city's Zoning Administrator, a fence 6 feet tall from the ground measured 8 feet 9¾ inches from the curb, so it needed a use permit. The code also says it's the affected owners' responsibility to decide the height of a fence built along a property line.

Fences on Eichler and mid-century lots

Our guide to carports, entry courts and street walls covers Palo Alto's guidance on front-yard fences and screen walls. Sunnyvale's Eichler Design Guidelines, as quoted in the city's staff report on that July 2026 case, say:

  • Fences 6 feet or more in height must be set back at least 15 feet from the front property line.

  • Fence design should be simple and modern in appearance, and a strong vertical or horizontal emphasis fits well with the Eichler style.

Where a side-yard fence meets the house wall, the joint matters in wildfire country; our wildfire hardening guide covers the 5-foot ember-resistant zone and wood fences that connect to the house.

Before you build: the property line

Before a fence goes up, know where the line is. San Mateo's fence regulation handout makes three points worth asking your own city about:

  • Fences can't be located outside your property lines.

  • Front and street side property lines may not sit directly behind the sidewalk, and city property can extend several feet behind it.

  • Fences built before June 7, 1993 that don't meet today's rules are legal non-conforming. Minor repairs, like replacing one or two boards or repainting, are allowed, but a major repair or replacement must meet current rules.

So in San Mateo, replacing a tall old fence can mean building a shorter one or applying for an exception. Ask your city how it treats older fences.

This is general information as of November 2026, not legal advice. For a specific dispute, talk with an attorney, and confirm height and permit rules with your city's planning department.

Frequently asked questions

Does my neighbor have to pay half of a new fence?

California presumes adjoining owners share the reasonable cost of a dividing fence equally, unless a written agreement says otherwise. A court can order less, or nothing, if equal sharing would be unjust under the factors in section 841.

Do I have to tell my neighbor before replacing the fence?

If you intend to incur costs for a fence dividing your properties, section 841 requires 30 days' prior written notice to each affected adjoining landowner, covering the presumption, the problem, the solution, the estimated cost, the proposed split and the timeline.

Do I need a permit for a 6-foot backyard fence?

Not in Cupertino or San Mateo, as long as it meets the height rules for its location; both require a building permit only above 7 feet. Sunnyvale's zoning table allows side and rear yard fences up to 8 feet without a miscellaneous plan permit or use permit. Other cities differ, so check yours.

Can I build a fence taller than the limit?

Sometimes, through a discretionary approval. Cupertino requires a fence exception after a public hearing, San Mateo a Site Plan and Architectural Review fence exception, and Sunnyvale a use permit for front yard fences over 6 feet or side and rear yard fences over 8 feet.

Related reading

More guides on this topic: Owning & Renovating a Mid-Century Modern Home

Planning a new fence or yard project at a mid-century home you own or are buying? Call or text the Boyenga Team at Compass at (408) 373-1660 or (650) 383-8606, or contact the Boyenga Team to talk it through.

Eric Boyenga

Eric Boyenga | Silicon Valley Real Estate Visionary

Eric Boyenga is a founding partner of Compass and a nationally recognized real estate expert known for redefining how homes are marketed and sold in Silicon Valley. As co-leader of the Boyenga Team, Eric blends data-driven strategy with elevated design sensibility—earning a reputation as both a “Property Nerd” and a luxury market innovator.

With a deep specialization in mid-century modern architecture—especially Eichler homes—Eric has built one of the most respected niches in the region. His team has represented some of the most architecturally significant properties in California, including the sale of Joseph Eichler’s Personal Residence, further cementing his authority in the space.

Eric’s approach is rooted in precision, storytelling, and results. By leveraging Compass’s proprietary tools and the Boyenga Team’s 3-Phased Marketing Strategy, he consistently delivers exceptional outcomes for buyers and sellers—from strategic off-market positioning to high-impact global exposure.

Beyond transactions, Eric is a forward-thinking industry leader. He has served on advisory boards for companies like HomeLight and Chime, helping shape the future of real estate technology and client experience.

Clients—from top tech executives to design-savvy homeowners—trust Eric for his insight, discretion, and ability to navigate complex deals with confidence. Whether representing a one-of-a-kind architectural estate or a highly competitive Silicon Valley property, Eric delivers a level of expertise that is both strategic and deeply personal.

https://www.Boyenga.com
Previous
Previous

California Homeowners' Exemption: How to Claim It After You Buy

Next
Next

EV Charger Permit in California: A Guide for Mid-Century Homes