You want to push the new addition toward the fence. Your contractor says you need five feet, a neighbor swears he built right on his line years ago, and a forum thread insists wildfire country requires thirty. Confusingly, all three can be right — because three separate rulebooks stack on the same property line, and the strictest one controls your project.
Here's the short version: your city's zoning setbacks decide where a building may sit at all (the number varies by city and district). The state building code then controls how anything near the line is built — unrated walls need 5 feet or more of fire separation distance, windows and doors are banned within 3 feet, and eaves may not project within 2 feet, per § R302.1. And in designated wildfire (Wildland-Urban Interface) areas, a 30-foot siting setback applies on top, per § 608.2.
The numbers at a glance
| Distance from the line | What the rules say | Which rulebook |
|---|---|---|
| Your district's setback (varies) | The buildable envelope — where structures may sit at all | City zoning code |
| 0 feet | Wall allowed only as 1-hour fire-rated construction (both sides) | § R302.1, Table R302.1(1) |
| Under 2 feet | No projections (eaves, overhangs) | § R302.1 |
| Under 3 feet | No windows or doors in the wall | § R302.1 |
| 5 feet and beyond | Ordinary unrated walls, unlimited openings | § R302.1 |
| 30 feet (wildfire areas) | Minimum building siting setback, reducible with compensating features | § 608.2 |
Layer 1: zoning — the number that usually controls
When people ask "how close can I build," the answer they're usually looking for is a zoning setback: the minimum yard your city requires between structures and each lot line. These are local law, they differ between cities and between districts within a city, and for side and rear yards they're commonly larger than anything the building code asks for. They're also where the exceptions live — accessory structures, ADUs and small sheds often get their own, smaller setbacks. Before anything else, look up your parcel's zoning district and read its development standards; that one step answers most of this question for your specific lot.
Layer 2: the building code — how the wall must be built
The state building code doesn't tell you whether you may build near the line; it tells you what the construction must be once you do. The mechanism is fire separation distance — the code's term for the gap between a wall and the property line — and the rules step down at 5, 3 and 2 feet as shown in the table above. A wall right at the line is legal construction-wise if it's 1-hour fire-rated with no openings; it just usually isn't legal zoning-wise. For the full breakdown, including how the distance is measured between buildings on one lot and the exceptions for sheds and detached garages, see our companion guide: California's fire rules for building near the fence.
Layer 3: wildfire country — the 30-foot rule
If your parcel falls under California's Wildland-Urban Interface fire rules, there's a third layer aimed at keeping a burning building from igniting the next one:
"All parcels shall provide a minimum 30-foot setback for all buildings from property lines and the center of a road" — § 608.2
Thirty feet is obviously impossible on many legal lots, and the code knows it: § 608.2.1 allows reductions for parcel size, topography, density patterns and other constraints — in exchange for compensating features such as noncombustible walls or fences, a 5-foot noncombustible zone around the building, hardscape landscaping, or fewer exposed windows on the close side. The stated intent (§ 608.1) is to slow structure-to-structure ignition and give firefighters and evacuees room to work.
How the layers combine
Think of it as three filters your site plan must pass in order: zoning says where, the building code says how, the wildfire rules say whether the site itself needs more room. The most restrictive applicable rule wins. Each layer also has its own relief path — a zoning variance from planning, a siting reduction under § 608.2.1, or simply building the wall to the required fire rating. What no layer offers is forgiveness after the fact: a wall framed 18 inches from the line with a window in it gets rebuilt, not waived.
Two practical moves before you draw plans: pull your parcel's zoning district and its setback table, and ask the building department whether the lot sits in a designated fire-hazard area. Those two answers turn this whole article into a single number for your project.