The fence contractor is standing in your driveway with a tape measure and says the magic words: "Anything under seven feet, you don't need a permit." It sounds authoritative, and it is genuinely in the code. Six months later a neighbor complains, a code enforcement officer comes out, and the six-and-a-half-foot fence you paid for has to come down to six feet — because the number the contractor quoted answers a completely different question than the one that mattered.
The short answer: California's building code says a building permit is not required for fences not over 7 feet high (§ R105.2). That is a permit threshold, not a height limit. How tall your fence may actually be is set by your city or county's zoning ordinance, and the same code section states plainly that a permit exemption never authorizes work that violates other local laws.
Key numbers
| Item | State code threshold | Source |
|---|---|---|
| Fence, no building permit required | Not over 7 feet high | § R105.2 |
| Fence, no building permit required (commercial code) | Not over 7 feet high, excluding swimming pool barriers | § 105 |
| Retaining wall, no permit required | Not over 4 feet, footing bottom to wall top, and not supporting a surcharge | § R105.2 |
| Detached accessory structure, no permit required | Floor area not over 120 square feet | § R105.2 |
Two different rulebooks are talking about your fence
This is the distinction that costs people money, so it is worth being precise about it.
The building code is about safety and construction: is the thing you built going to fall over, catch fire, or hurt someone? It decides whether the city needs to review your plans and send an inspector. Its answer for fences is a simple size cutoff.
The zoning code is about land use: what may go where on your lot, how tall, how close to the line. It is written by your city or county, it varies from one town to the next, and it is where fence height limits actually live. Zoning ordinances typically treat front yards differently from side and rear yards, and often restrict height near driveways and street corners so drivers can see.
The seven-foot figure belongs to the first rulebook. It tells you the city will not require a building permit. It tells you nothing about whether the fence is allowed to be that tall on your lot.
What the state code actually exempts
Here is the relevant line, verbatim:
"Fences not over 7 feet (2134 mm) high." (§ R105.2)
That item sits in a list of work that does not require a building permit under the residential code — the book that governs houses, duplexes and townhouses. The same list includes several things homeowners run into on the same weekend project:
- One-story detached accessory structures — sheds, playhouses — with a floor area not over 120 square feet. Note that these may still be regulated under the state's wildland-urban interface rules despite being permit-exempt, if you are in a fire-hazard area.
- Retaining walls not over 4 feet, measured from the bottom of the footing to the top of the wall, unless the wall supports a surcharge. Surcharge is the code's word for extra load pushing on the wall: a slope above it, a driveway, a structure. A three-foot wall at the base of a steep bank can still need a permit.
- Sidewalks and driveways.
- Prefabricated swimming pools less than 24 inches deep, and playground equipment such as swings.
- Decks not exceeding 200 square feet, no more than 30 inches above grade at any point, not attached to a dwelling or townhouse, and not serving a required exit door.
Commercial and multifamily projects follow the parallel list in the building code, which reads almost identically — with one deliberate difference discussed below (§ 105).
The sentence that undoes the shortcut
Both versions of the exemption list open with the same warning, and it is the most important sentence in this article: exemption from permit requirements is not authorization to do work in any manner that violates the code, or any other law or ordinance of the jurisdiction.
Read plainly, that means a permit-exempt fence still has to obey:
- Your city's zoning height limits, front-yard rules and corner visibility rules.
- Any local fence permit or design requirement — a city is free to require its own planning-level permit even where the state building code asks for none.
- Private restrictions the state code has nothing to do with, such as an HOA's rules or a recorded easement.
So "no permit needed" and "allowed" are not the same statement, and the code says so out loud.
Pool fences are the one carve-out to memorize
The building code's version of the exemption is worded as fences "other than swimming pool barriers" not over 7 feet high. That phrase is doing real work. A barrier around a pool is a life-safety device, not a privacy fence, and it is not something the code lets you put up unreviewed.
If your fence is doing double duty — enclosing the yard and serving as the pool barrier — treat it as a pool barrier. Talk to your building department about the height, gap, gate and latch requirements that apply before you order anything, because a barrier that fails inspection has to be rebuilt, not adjusted.
What this article cannot tell you
The state building code sets the permit threshold. It does not set your fence height limit, and none of the sections cited here contain one. That number lives in your local zoning ordinance, which differs city by city — including how height is measured on a sloping lot, whether lattice on top counts, and how front yards are treated.
So the honest sequence before you build is:
- Look up your city or county's zoning rules for fence height in your yard type — front, side, rear, corner.
- Ask the building department whether they require any local permit even for a permit-exempt fence.
- Confirm the fence is on your property, not the neighbor's, and that no easement runs where you are digging.
- Only then compare against the state's 7-foot building-permit threshold.
The state number is the last check, not the first one. Getting that order backwards is what turns a weekend project into a rebuild.