Most people facing a building code violation never planned to study housing law. The issue usually arrives as a letter from a city, a notice posted on a door, or a line in an inspection report on a house someone inherited or just bought. The questions come fast. What does the notice mean? Who sent it? How much time is there, and is the choice really between fixing the work and letting the property go? This guide explains how California defines the problem, who enforces it, and how owners compare the paths open to them. One point holds throughout: a sale does not change what the law requires.

A building code violation is a condition on a property that does not meet the building or housing standards a California city or county enforces. The local building or housing department, not a state office, cites it. The owner then generally weighs correcting it, legalizing unpermitted work, or selling the property in its present condition.
On this page
What It Means for Owners
California law sets the standard in two overlapping layers. The State Building Standards Code covers how buildings are built, altered and repaired. The State Housing Law, part of the Health and Safety Code, covers how dwellings are kept up, used and occupied. A violation can arise under either one.
The most serious label is "substandard building." Under Health and Safety Code section 17920.3, any building or portion of one "in which there exists any of the following listed conditions to an extent that endangers the life, limb, health, property, safety, or welfare of the occupants of the building, nearby residents, or the public shall be deemed and hereby is declared to be a substandard building." The list is long and partial. It includes inadequate sanitation, such as visible mold growth as determined by a health officer or code enforcement officer, and general dilapidation or improper maintenance. It also includes structural hazards, such as deteriorated or inadequate foundations, and goes on to faulty wiring, plumbing, weather protection, exits and more. These conditions are described only as the statute lists them; whether any one applies to a particular home is a question for the inspecting office.
Enforcement is local. Under Health and Safety Code section 17960, the building department of every city or county enforces the State Building Standards Code within its jurisdiction. Under Health and Safety Code section 17961, the housing or building department, or the health department where there is no building department acting under that section, enforces the rules on maintenance, sanitation, ventilation, use or occupancy of dwellings.
In practice, the office that writes the notice, inspects and sets the correction date is a city or county department. Knowing which department that is matters, because its procedures shape everything that follows.
Who It Affects: Owners, Heirs and Buyers of Problem Property
The notice goes to the owner of record, the person or persons whose names are on title. That is a different role from an occupant or tenant, who lives in the property, and a co-owner, who shares title with others. A relative living in the house is not the owner of record unless title says so.
Owners tend to meet code enforcement in a handful of ways:
- Inheriting a property with existing violations. The new owner takes over a problem someone else left.
- Buying a property with unpermitted work. An earlier owner built or altered without a permit.
- Owning a rental where someone filed a complaint. A neighbor or occupant contacted the local office.
- Doing construction without a permit. The owner's own project drew attention.
A case can also begin with a routine inspection or with a permit application that brings earlier, unpermitted work to light.
The County of San Diego offers one example of how a local program frames its work. The County's What We Investigate page says Code Compliance "investigates complaints on private property in the unincorporated County" and lists "Construction Without Permits" among its most common requests. The County's Code Compliance FAQs page says County Code Compliance only enforces in the unincorporated area, and that people in a city contact that city's department instead. Because each city and county runs its own program under Health and Safety Code section 17960, procedures and fees differ from place to place.
The first facts to pin down are which office issued the notice and which condition it names. From there, an owner can sort out whether the issue involves maintenance, construction or occupancy, since each points to different help.
Rules, Disclosures and Fine Print
The core timing rule is in Health and Safety Code section 17980. It applies when a building is constructed, altered, converted or maintained in violation, or when a nuisance exists in the building or on its lot. In that case the enforcement agency, "after 30 days' notice to abate the nuisance or violation, or a notice to abate with a shorter period of time if deemed necessary by the enforcement agency to prevent or remedy an immediate threat to the health and safety of the occupants of the building, nearby residents, or the public," institutes action to prevent, restrain, correct or abate it.
In plain terms, to abate means to correct or remove the violation. The period runs from the agency's notice, not from the day an owner first hears about the problem informally. The same section gives a separate period, generally at least 60 days after taking title, for a person who bought a residential property that had been foreclosed on or after January 1, 2008 and is diligently abating violations, unless the agency deems a shorter period necessary for an immediate threat.
Where an agency finds a building substandard, section 17980 says the owner "shall have the choice of repairing or demolishing." An owner who repairs is held to a reasonable and feasible schedule. The agency gives preference to repair whenever it is economically feasible without repairing more than 75 percent of the dwelling, as the agency determines. The agency may itself vacate, repair or demolish if:
- the repair work is not done in the period the notice requires,
- the owner does not choose in time, or
- the owner's choice cannot be finished in a reasonable time.
Notices to correct must also tell the owner that a tax deduction for interest, taxes, depreciation or amortization may not be allowed; a CPA or tax attorney reviews what that means for a given owner.
Section 17980 also refers to a notice of pendency of action an enforcement agency may record against a property, so an enforcement matter can appear in the property's records. A seller in California also owes disclosure duties about the property; which ones apply depends on the facts and the type of sale, and a real estate agent or attorney reviews them.
Local programs may also offer a way to challenge a notice. As one example, the County of San Diego's Code Compliance FAQs page points to a Filing an Appeal page explaining its appeal processes. Appeal steps, like fees, vary by city and county.
These rules depend on the facts, the city or county, and the law that applies. The notice starts the clock and states the required action, which lets an owner judge whether the stated period is realistic for the work involved.
Options and Trade-offs: Correct, Legalize or Sell?
Each path below fits some situations and not others. None of them is the answer for everyone.
Correct the violation. The owner hires a contractor, obtains the permits the work requires, completes the work, and asks the department for a final inspection. This addresses the cited condition directly, though it takes money and time up front, and the department, not the owner, decides when a case is closed.
Legalize unpermitted work. Where work was done without a permit, an owner may apply for an after-the-fact permit. The building department reviews whether the work meets code and may require changes or removal. Approval is not assured. Unpermitted additions and accessory dwelling units raise added questions of their own.
Sell the property in its present condition. A buyer who accepts the property as it is takes on the correction work. A buyer paying cash and taking the property as is often offers less than an open-market price, because that buyer carries the repairs, the risk and the cost of reselling. In exchange, the seller usually gets less preparation, fewer showings and less dependence on a buyer's loan.
List with a real estate agent. The agent markets the property, the seller discloses what the law requires, and the parties negotiate who addresses the violations or how the price reflects them.
Whatever the route, an enforcement order or a recorded notice stays in place through a sale, and the law's steps are the same whoever the buyer is. Owners often compare written offers and estimated net proceeds, meaning the price less commissions, repairs, carrying costs, loan payoffs and closing costs, to see which path fits. Red-tagged, condemned or nuisance properties add their own layers.
Where co-owners, a lender or the enforcement agency are in conflict with the owner, that contested matter is a different subject handled by an attorney.
Mistakes to Avoid After a Code Notice
The errors below come up often, and each traces back to the rules already described.
- Setting the notice aside. The period in Health and Safety Code section 17980 runs from the notice, and the agency may then take action or begin proceedings.
- Assuming a sale will not surface the issue. A recorded notice or open case can come up in a buyer's title and permit review.
- Fixing things without a permit. Repair work that needs a permit and does not have one can add a new problem to the old one.
- Treating an as-is or cash sale as a way around disclosure. A seller's disclosure duties do not depend on who the buyer is or how the sale is structured.
- Letting family agreement stand in for authority. Who can sign a permit application, contract or deed depends on how title is held, not on what relatives or occupants agree. A contested title question goes to an attorney.
An owner who inherited the property and is still sorting out the estate may feel several of these pressures at once. The notice remains the document that governs: it states the deadline, the required action and the office to contact. With it in hand, it becomes easier to see which of these mistakes is most likely in a given situation.
What to Do Next After a Notice Arrives
The steps below describe the order owners commonly work through. They are a sequence, not a prescription.
- Reading the notice closely. It names the violation, the required action, the deadline and the office that issued it.
- Identifying the enforcement agency. It may be a city building department, a county code compliance office or a housing or health department, and the notice cites the code it relies on.
- Pulling the permit and case history. The local building department holds permit records. As one example, the County of San Diego's Code Compliance FAQs page says owners can research a property for an open code compliance case through its online citizen access system, and that "Each violation is unique" for a buyer seeking to resolve one.
- Setting the options against the deadline. Correction, legalization and sale each take different amounts of time and money.
- Bringing in the professional the path calls for. A contractor or permit expediter handles correction work, a real estate agent or attorney a sale, and an attorney a dispute.
Each of these steps rests on facts only the owner and the local office hold. Gathering them first puts an owner in a better position to compare paths fairly.
Ready to talk through your options?
Share the details of your notice. You choose whether contractors or a sale consultant may contact you.
Get help with my propertyFrequently asked questions
What happens if code enforcement comes to your house?
An officer inspects, notes conditions that fall short of the code, and sends the owner of record a notice. From there, the notice period described above governs. In the County of San Diego, the Code Compliance FAQs page says the County has a Filing an Appeal page explaining how to appeal a citation or notice.
What is a substandard building under California law?
It is a building where conditions listed in Health and Safety Code section 17920.3 exist to an extent that endangers people or property. The label turns on the degree of danger, not just the presence of a condition. Some items, such as older wiring, are excepted where they met the law when installed and remain in good, safe condition.
Who enforces building codes in California?
City and county departments do, under Health and Safety Code sections 17960 and 17961. Section 17961 also says the departments involved coordinate with one another to avoid unnecessary duplication, so a building department and a health department may both have a role in one case.
How long does an owner have to fix a building code violation in California?
The notice sets it. Health and Safety Code section 17980 provides a 30-day notice to abate, or a shorter one for an immediate threat. Where an owner chooses to repair a substandard building, the agency also requires a reasonable and feasible schedule for the repair.
Can a property with open code violations be sold in California?
Yes, a property can be sold in its present condition. The sale changes who owns the problem going forward, not what the enforcement agency has ordered, and the seller's disclosure duties still apply. A real estate agent or attorney reviews which disclosures a particular sale requires.
What is the difference between a building code violation and unpermitted work?
Unpermitted work is construction or alteration done without a required permit. It is one common source of violations, but many violations involve no construction at all, such as poor maintenance, dampness or blocked exits listed in Health and Safety Code section 17920.3.
Does a code violation affect a property's title or sale?
It can. Health and Safety Code section 17980 refers to a notice of pendency of action an enforcement agency may record, which then appears in the property's records. A title company or real estate attorney reviews what shows on title for a specific property.