What does California state code say about fences?
The 2025 California Residential Code (Title 24, Part 2.5), in effect since January 1, 2026, lists fences not over 7 feet high among the work exempt from a building permit (Section R105.2). The code's own Matrix Adoption Table, a nonregulatory aid, marks the R105.2 building items as adopted by the state agencies, including the housing department's HCD 1 column for dwellings.
Cities and counties may change it: the CRC (Section 1.8.6.1) says so, and Health and Safety Code 17958.5 allows changes reasonably necessary because of local climatic, geological or topographical conditions, effective once filed with the Building Standards Commission under Section 17958.7. From October 1, 2025 to June 1, 2031, new residential changes are barred unless an exception applies, such as one substantially equivalent to a change in effect on September 30, 2025.
Among the cities on this site, San Diego, San Jose and Sacramento use 7 ft. Los Angeles exempts wood, vinyl, chain link or iron up to 10 ft but not masonry over 3.5 ft. San Francisco requires a permit over 6 ft at the side or rear and over 3 ft at the front. Long Beach's code says 7 ft for non-masonry fences while its handouts say 6 ft 6 in, and masonry over 4 ft needs a permit. In several cities a fence that serves as a pool barrier is permitted with the pool.
Who issues fence permits, and what about unincorporated areas?
Health and Safety Code 17960 makes the building department of every city or county enforce the state building code. Inside a city, that is the city; outside city limits, the county building department, applying any county amendments and its own fees.
Height is mostly a zoning question. In the cities we checked, front-yard limits are 3 to 3.5 ft, and a fence that needs no building permit can still break a zoning limit. Fees are set locally; the city table on this page shows examples.
Who pays for a fence between neighbors?
California's Good Neighbor Fence Act, Civil Code 841, presumes that adjoining landowners share an equal benefit from a dividing fence and are equally responsible for the reasonable costs of building, maintaining or replacing it, unless they agree otherwise in writing.
A landowner who intends to incur costs for such a fence must give each affected neighbor 30 days prior written notice. The notice mentions the presumption of equal responsibility and describes the problem, the proposed fix, the estimated cost, the proposed cost split and the timeline. The presumption can be overcome by showing that equal sharing would be unjust.
Separately, Civil Code 841.4 makes a fence unnecessarily exceeding 10 feet, maliciously built or kept to annoy a neighbor, a private nuisance.
Can my HOA stop my fence?
It can require approval if its governing documents say so. In that case Civil Code 4765 sets the process: the association must provide a fair, reasonable and expeditious procedure, decide in good faith and not unreasonably, arbitrarily or capriciously, and put its decision in writing, explaining any disapproval and how to ask for reconsideration. Its decision may not violate a building code or other land-use or safety law. Section 4765 itself sets no fence height.
Can I build the fence myself?
Yes. Business and Professions Code 7044 exempts an owner building on their own property from contractor licensing when the improvements are not intended or offered for sale and the owner personally does the work or uses employees paid wages only. If you hire a fence builder, the under-$1,000 exemption in Section 7048 covers only small, minor jobs that need no building permit, and not someone who advertises as a contractor or employs others.
Fence Permit rules in the 6 California cities we have researched
Each row is read off our page for that city, which quotes the city’s own code section and fee schedule. Follow the city link for the conditions on each rule, the worked fee examples and the sources.
| City | Ordinary fence | Building permit starts at | Zoning height caps: front · side and rear | City fee for a 6 ft wood fence |
|---|---|---|---|---|
| Long Beach | Exempt below a height ⚠ | Over 7 ft in the code, 6 ft 6 in on the handouts; masonry over 4 ft | 3 ft front (4 ft in the special fence height area with an open top foot) · 6 ft 6 in; 8 ft along an alley, nonresidential use or major arterial | $0; a 60 ft block wall about $975; a 40 ft 8 ft wood fence about $590 |
| Los Angeles | Exempt below a height | Over 10 ft for wood, vinyl, chain link or iron; masonry over 3.5 ft | 3.5 ft front in R zones · 8 ft side and rear on lots 40 ft or wider (6 ft narrower or hillside) | $0; a permitted masonry wall about $338 at $5,000 |
| Sacramento | Exempt below a height | Over 7 ft; retaining walls over 4 ft | Set by City Code Chapter 17.620; figures not quoted on the city's permit pages · same | $0; over 7 ft about $291 for a $3,500 job ($554 if Planning charges its $263 minimum) |
| San Diego | Exempt below a height | Over 7 ft, masonry included | 3 ft solid at the front line rising to 6 ft at the setback (6 to 9 ft if open) · 9 ft, open above 6 ft | $0; a fence over 7 ft about $3,310 per 100 ft |
| San Francisco | Exempt below a height | Over 6 ft at the side or rear; over 3 ft at the front | 3 ft solid, 6 ft if 75% open, in the front setback · 10 ft in required yards, over the counter | $0; an 8 ft backyard fence about $1,150 (DBI valuation fees + $504 Planning fee) |
| San Jose | Exempt below a height | Over 7 ft | 3 ft in the front setback area · 7 ft (6 ft where grade drops more than 2 ft across the line) | $0; a permitted fence about $585 ($211 processing + Tier 1 inspection + plan check) |
A ⚠ marks a city whose own documents give two different answers. To compare more cities, see fence permit rules in 30 cities and fence permit fees in 30 cities.
Not in one of these cities?
The rule that binds you is the one your own city has adopted, or your county’s if you live outside city limits. Ask the building department for its list of work exempt from permit and its zoning rules for accessory structures before you buy materials; the phone call is free and the answer is specific to your lot.
Frequently asked questions
Sources
Every statement about state law on this page is taken from the documents below, read on the date shown at the top. Laws and adopted code editions change; the linked text is the authority, and your city or county building department has the final word on your project.
- California Building Standards Commission, Codes page (2025 Triennial Edition of Title 24) — dgs.ca.gov
- 2025 California Residential Code Section 1.1.1 (up.codes mirror); 2025 California Residential Code R105.2 Building item 2 (up.codes mirror); 2025 California Residential Code, Chapter 1 Division II adoption note (up.codes mirror); 2025 California Residential Code, Chapter 1 Matrix Adoption Table (nonregulatory; up.codes mirror, table rendered with column labels in src_crc_2025_matrix_ch1.txt); 2025 California Residential Code Section 1.8.2.1.1 (up.codes mirror); 2025 California Residential Code, Section 1.8.6.1 (up.codes mirror); 2025 California Residential Code R105.2 (up.codes mirror) — up.codes
- Health and Safety Code 17958.5(a); Health and Safety Code 17958.5(c); Health and Safety Code 17958.5(c)(1) — leginfo.legislature.ca.gov
- Health and Safety Code 17958.7(a) — leginfo.legislature.ca.gov
- Health and Safety Code 17960 — leginfo.legislature.ca.gov
- Civil Code 841(b)(1); Civil Code 841(b)(2); Civil Code 841(b)(3) — leginfo.legislature.ca.gov
- Civil Code 841.4 — leginfo.legislature.ca.gov
- Civil Code 4765(a); Civil Code 4765(a)(1); Civil Code 4765(a)(2); Civil Code 4765(a)(3); Civil Code 4765(a)(4) — leginfo.legislature.ca.gov
- Business and Professions Code 7044(a)(1); Business and Professions Code 7044(a)(1)(A); Business and Professions Code 7044(a)(1)(B) — leginfo.legislature.ca.gov
- Business and Professions Code 7048(a); Business and Professions Code 7048(a), as amended by Stats. 2025, Ch. 67 (AB 1170); Business and Professions Code 7048(c)(2); Business and Professions Code 7048(c)(1) — leginfo.legislature.ca.gov
Related: California shed permit · California deck permit · California pool permit · Fence permit guide · All state guides