THE SHORT VERSION
- Your local code decides. Most US homes fall under the International Residential Code (IRC); California and Washington build on the Uniform Plumbing Code (UPC). Cities amend both, so ask your permit office which edition applies.
- The relief valve’s discharge pipe is the classic failed item: full size, downhill, no valve, tee or threaded end, ending near the floor (IRC: 6 inches or less) or wherever your local code says.
- A check valve, backflow preventer or pressure-reducing valve makes a closed system, and codes then require thermal expansion control, usually an expansion tank.
- Location adds rules: a pan where a leak would cause damage, an 18-inch ignition height and vehicle protection in garages, earthquake straps in high-seismic areas (all of California), and access in attics and crawlspaces.
- Gas heaters need a shutoff within 6 feet, a sediment trap, combustion air and a rising vent. Electric heaters need a disconnect within sight or a lockable breaker.
Which code applies: your city or county decides
There is no national water heater code. Private groups write model codes; states, counties and cities adopt them as law, often years later and with local changes called amendments. Your permit office enforces its adopted edition plus the manufacturer’s installation instructions, which the IRC makes part of the code (M2005.1).
| Code | Who writes it | What it covers |
|---|---|---|
| International Residential Code (IRC) | International Code Council (ICC) | Houses and townhouses: plumbing, gas, mechanical and electrical chapters in one book. ICC says it is in use or adopted in 49 states and DC. |
| International Plumbing Code (IPC) | ICC | Buildings the IRC doesn’t cover; in use in 36 states. Its water heater chapter closely matches the IRC. |
| Uniform Plumbing Code (UPC) | IAPMO | The base for California’s Plumbing Code and Washington’s state plumbing code, among others. |
| Fuel gas and electrical codes | ICC (IFGC), NFPA (NFPA 54, NFPA 70) | Gas piping, venting, combustion air, wiring. The IRC folds in versions of both. |
| Energy code | ICC (IECC) or a state code | Insulation on new or altered hot water piping. |
Sources: ICC IRC and IPC pages; Washington Administrative Code chapter 51-56; 2025 California Plumbing Code. Some states write their own code: a Palatine, Illinois handout cites the Illinois State Plumbing Code, not the IRC.
Amendments matter. Utah’s 2021 IRC adds its own pan-drain and strapping rules. Scottsdale, Arizona, an IRC city, wants the relief valve pipe to end outdoors, 6–24 inches above grade. Southlake, Texas requires a pan with a leak alarm or automatic shutoff when an indoor replacement has none. Each is stricter than the base IRC and enforced locally.
Find your building department
Search your city name plus “building permit”; outside city limits it is usually the county.
Ask which codes and editions are in force
Look for a “codes adopted” page, such as “2021 IRC with local amendments”. Section numbers change between editions.
Get the water heater handout
Many departments publish a one-page list of what their inspectors check. It reflects local amendments, which makes it the most practical document you will find.
Many jurisdictions require a permit for a replacement, and the inspection is where these rules get checked. See water heater permits and inspections.
Every requirement at a glance
| Requirement | 2021 IRC | 2024 IRC | UPC (2025 California Plumbing Code) | Why it exists |
|---|---|---|---|---|
| T&P relief valve | P2804.1–P2804.5 | P2804.1–P2804.5 | 608.3, 504.6 | Keeps a tank from overheating or bursting |
| T&P discharge pipe | P2804.6.1 | P2804.6.1 | 608.5 | Sends scalding water somewhere safe and visible |
| Thermal expansion control | P2903.4 | P2903.4 | 608.2, 608.3 | Heated water expands; a closed system builds pressure |
| 80 psi maximum pressure | P2903.3.2 | P2903.3.2 | 608.2 | High pressure strains the tank and relief valve |
| Cold-water shutoff | P2903.9.2 | P2903.10.2 | — | Isolates the heater for service or a leak |
| Drain pan | P2801.6 | P2801.5 | 507.5 | Catches leaks that would damage the house |
| Garage: 18-inch ignition height | P2801.7, M1307.3, G2408.2 | P2801.6, M1307.3, G2408.2 | 507.13 | Gasoline vapor collects near the floor |
| Vehicle protection | M1307.3.1, G2408.3 | M1307.3.1, G2408.3 | 507.13.1 | A car can knock over the heater and its gas line |
| Seismic straps | P2801.8, M1307.2 | P2801.7, R301.2.2.10 | 507.2 | A toppled tank breaks gas and water lines |
| Vacuum relief valve | P2804.7 | P2804.7 | 608.7 | Keeps a tank from being siphoned or collapsing |
| Working space and access | M1305.1 | M1305.1 | — | The heater must be serviceable and replaceable |
| Attics and crawlspaces | M1305.1.2, M1305.1.3 | M1305.1.2, M1305.1.3 | 508.4 | Safe access to carry a tank in and out |
| Prohibited locations | M2005.2, G2406.2 | M2005.2, G2406.2 | 504.1 | Keeps combustion out of bedrooms, baths and storage closets |
| Combustion air | G2407 | G2407 | 506 | A starved burner makes carbon monoxide |
| Vent connector slope and clearance | G2427.10.5, G2427.10.8 | G2427.10.5, G2427.10.8 | 509 | Exhaust must rise and leave; hot pipe can ignite wood |
| Gas shutoff and sediment trap | G2420.5.1, G2419.4 | G2420.5.1, G2419.4 | Ch. 12 (fuel gas) | Shut gas off nearby; keep debris out of the gas valve |
| Condensate disposal | G2427.9, G2404.10 | G2427.9, G2404.10 | 509.9 | Condensing and heat pump units make water |
| Electric disconnect | E4101.5 | E4101.5 | California Electrical Code (NEC 422.31) | A technician must be able to lock power off |
| Hot water pipe insulation | N1103.5.2 | N1103.5.2 | California Energy Code | Less heat lost between heater and taps |
Sources: 2021 IRC (as adopted by Colorado’s Division of Fire Prevention and Control) and 2024 IRC (as adopted by the Maryland Board of Plumbing), read on UpCodes; 2025 California Plumbing Code, based on the UPC, effective January 1, 2026. Your jurisdiction may use another edition or amend these sections; the local permit office has the final word.
The T&P relief valve and its discharge pipe
Every storage water heater needs a temperature and pressure (T&P) relief valve. Under the IRC it opens at no more than 150 psi (and no higher than the tank’s rating) and no more than 210°F, sensing the top 6 inches of the tank (P2804.3, P2804.4). If a thermostat sticks or pressure spikes, it dumps hot water before the tank fails. New heaters come with the valve fitted; what the installer builds, and the inspector checks, is the pipe that carries the water away.
Under the 2021 and 2024 IRC (P2804.6.1) and the matching IPC section (504.6), the pipe needs:
- Full size: no smaller than the valve outlet, usually ¾ inch, to the end. With insert fittings (common on PEX), which narrow the bore, one size larger.
- An air gap in the same room, never piped straight into a drain. The gap protects drinking water from backflow.
- Ending no more than 6 inches above the floor or drain (and at least twice the pipe diameter), or into the pan or outdoors. At 6 inches, scalding water hits the floor, not a person.
- Downhill by gravity, with no traps or sags, which can scale up or freeze shut.
- No valve, no tee and no threads at the end, so nobody can cap or tap it. One relief valve per pipe, ending where someone will see it.
- Hot-water-rated pipe: a water distribution material rated 100 psi at 180°F, such as copper, CPVC or PEX. PVC drain pipe and garden hose don’t qualify.
UPC areas and cities differ. California’s code (608.5) wants the pipe to drain through an air gap into the drainage system or outside, its end 6–24 inches above the ground, pointing down, and it prohibits discharge into the pan. Newport Beach, California checks for an outdoor end; Everett, Washington lets a replacement keep an indoor end within 6 inches of the floor if the old one was piped that way. A.O. Smith’s manual adds that more than 30 feet of pipe or four elbows “can cause restriction and reduce the discharge capacity of the valve.”
Thermal expansion control in closed systems
Water expands as it heats. In an open system the extra volume pushes back into the city main. In a closed system, a check valve or backflow preventer at the meter, or a pressure-reducing valve (PRV), blocks that path, so each heating cycle raises pressure in your pipes. A.O. Smith says this can cause premature tank failure and a dripping relief valve, and that neither is covered by its warranty.
- IRC (P2903.4.1, P2903.4.2): where a backflow preventer or check valve lets expansion raise pressure on a system with a storage heater, or a PRV’s setting is exceeded, “a device for controlling pressure shall be installed.”
- UPC as adopted in California (608.2, 608.3): a closed system needs a listed, sized expansion tank fastened to the structure, “independent of the type of water heater used”, and every pressure regulator needs one downstream. Tankless heaters are exempt.
- Both cap house pressure at 80 psi (IRC P2903.3.2, UPC 608.2).
- The relief valve is not expansion control. The IPC says so (504.4), and A.O. Smith’s manual says expansion tanks “are required on all closed water systems.”

An expansion tank on the cold supply gives heated water somewhere to go. California’s code requires it to be fastened to the structure.
Thermal expansion tank on a water linePhoto: Tony Webster ↗ · CC BY 2.0 ↗The inspector looks for a supported tank on the cold line, on the house side of the check valve or PRV. Tampa asks for a photo of the “thermal expansion device … if a backflow device is installed.” See expansion tanks to tell whether your system is closed.
Seismic straps: quake zones, and all of California
A 50-gallon tank holds about 417 pounds of water (50 × 8.34 lb) before you count the steel. In an earthquake an unbraced tank can walk or topple and break its gas and water connections, and a broken gas line is a fire risk.
- 2021 IRC (P2801.8, M1307.2): in Seismic Design Categories D0, D1 and D2, and townhouses in category C, strap the upper and lower thirds of the tank to resist one-third of its operating weight, with the lower strap at least 4 inches above the controls.
- 2024 IRC (P2801.7): points to a general appliance rule (R301.2.2.10): brace per the manufacturer, or design for one-third of the operating weight with strapping in the upper third or anchorage that resists overturning.
- California: Health and Safety Code section 19211 covers “all new and replacement water heaters, and all existing residential water heaters,” and home sellers must certify compliance in writing. The state plumbing code (507.2) sets two straps, upper and lower third, the lower one 4 inches above the controls.
Your building department can tell you your Seismic Design Category. Common failures: one strap where two are required, a lower strap too close to the gas control, and a gap behind the tank with no blocking, which Everett, Washington’s handout calls out.
Drain pans: where a leak would cause damage
Tanks eventually leak. The IRC requires a pan wherever leakage “will cause damage”, such as in an attic, on an upper floor or in a closet over a finished room (2021 P2801.6, 2024 P2801.5). Whether a garage counts is the inspector’s call; Southlake, Texas wants a pan for a garage heater next to living space.
- Material: steel or aluminum at least 0.0236 inch thick, or plastic at least 0.036 inch. Plastic under a gas heater needs a flame-spread rating, so gas installs usually get metal.
- Size and drain: at least 1½ inches deep, with a ¾-inch drain to an indirect waste receptor or outdoors, 6–24 inches above the ground.
- Replacements: if no pan drain existed, the IRC doesn’t require adding one. It still requires the pan. Southlake goes further and requires a leak alarm or automatic shutoff with a new pan.
A.O. Smith asks for a metal pan at least 2 inches wider than the heater, piped to a drain, that doesn’t block combustion air, and suggests leak sensors or shutoff valves where a leak would be costly. An undrained pan buys minutes, not hours.
Garage installs: 18 inches up and out of the car’s way
Gasoline vapor is heavier than air and pools near the floor, where a pilot or burner can ignite it. The IRC requires the ignition source at least 18 inches above the garage floor (2021 P2801.7, 2024 P2801.6, plus M1307.3 and G2408.2). Spaces that open into the garage and aren’t living space count too.
- FVIR exception: heaters listed as flammable vapor ignition resistant (FVIR), designed and tested to resist igniting vapors, are exempt under the IRC; the rating label or manual says whether yours is. Southlake, Texas and Palatine, Illinois still tell installers to raise gas units 18 inches.
- Electric heaters: the IRC speaks of an “ignition source”, and Southlake lets electric units stay on the floor. California’s code (507.13) also names “heating elements, switches,” and Scottsdale applies 18 inches to electric heaters. Ask.
- Vehicle protection: no appliance where a vehicle could hit it unless behind approved barriers (M1307.3.1). The fuel gas chapter (G2408.3) puts unprotected gas appliances in private garages 6 feet up. Tampa asks for a photo of the “bollard or wheel stop.”
- Enclosed room: a heater in a room entered only from outside the garage can sit on the floor if its combustion air comes from outdoors (G2408.2.1).
For freezing, heat pump models and other location questions, see where a water heater can go.
Gas heaters: shutoff, sediment trap, air and venting
- Gas shutoff valve: same room, within 6 feet, upstream of the union or connector, accessible (G2420.5.1).
- Sediment trap (drip leg): a tee with a capped vertical nipple just before the gas inlet, unless built into the heater (G2419.4). It catches debris before it fouls the gas valve.
- Connector: a listed flexible connector, or a union within 6 feet on rigid pipe (G2422.1.4).
- Clearances to combustibles: from the heater’s label. One A.O. Smith gas model lists 0 inches at the sides and rear, 4 inches in front, 12 inches above and 6 inches to a single-wall vent.
Combustion air
A burner starved of air makes carbon monoxide. The IRC’s standard method needs 50 cubic feet of room per 1,000 Btu/h of all fuel-burning appliances in the space (G2407.5.1). Say a 40,000 Btu/h water heater shares a basement with a 60,000 Btu/h furnace: 100,000 Btu/h needs 5,000 cubic feet, about a 25 × 25-foot room with an 8-foot ceiling. A closet fails that test, so it needs two permanent openings, one within 12 inches of the top and one within 12 inches of the bottom; openings to rooms on the same floor need 1 square inch per 1,000 Btu/h each, at least 100 square inches (G2407.5.3.1).
Venting and location
An atmospheric heater’s vent connector must rise toward the chimney at least ¼ inch per foot with no dips (G2427.10.8). Single-wall pipe needs 6 inches from combustibles; Type B vent its listed clearance (Table G2427.10.5), which Southlake and Newport Beach check at 1 inch. Rheem calls improper venting, which can backdraft carbon monoxide indoors, “one of the most dangerous mistakes.” Fuel-fired heaters can’t go in storage closets, or in bedrooms and bathrooms unless direct vent or in a sealed enclosure (M2005.2, G2406.2). See water heater venting.
Electric heaters: a disconnect you can see, and bonding
The item inspectors check most on an electric heater is the disconnect: a breaker or switch within sight (visible and no more than 50 feet away) or lockable in the off position (IRC E4101.5, from NEC 422.31), so nobody re-energizes 240 volts while someone works on it. Tampa asks for photos of the disconnect, breaker and panel schedule; Newport Beach checks that breaker and wire are rated at least 125% of the nameplate. Fill the tank before power goes on: Rheem warns an empty tank burns out its elements instantly.
Bonding ties metal piping to the home’s grounding so a fault can’t leave a pipe live. The IRC requires bonding of the metal water piping system (E3609.6) and gas piping (G2411.1). Dielectric unions and plastic connectors at the heater can break that metal path, so some departments want a jumper across it: Danville, California asks for #8 bare copper joining hot, cold and gas lines; Palatine, Illinois lists 6-gauge.
Valves, vacuum relief and room to work
- Cold-water shutoff: a readily accessible, full-open valve at or near the heater (2021 P2903.9.2; 2024 P2903.10.2). Newport Beach and Palatine specify a full-bore (full-port) valve.
- Vacuum relief valve: required on bottom-fed tanks under the IRC (P2804.7), and under the UPC where the tank sits above the fixtures it serves, like an attic heater over a ground-floor shower (608.7). It lets air in so the tank can’t be siphoned or pulled into a vacuum.
- Working space: a level 30 × 30-inch space in front of the controls, and service or replacement possible without removing permanent construction (M1305.1). A heater boxed in by a new wall can fail.
- Attics (M1305.1.2): an opening at least 20 × 30 inches and big enough for the heater; a passageway at least 30 inches high, 22 wide and no more than 20 feet long, floored at least 24 inches wide; a 30 × 30-inch service space; and a light and receptacle. California’s code asks for a 22 × 30-inch opening (508.4). Expect a pan with a drain.
- Crawlspaces (M1305.1.3): a 22 × 30-inch opening, a 30-inch-high by 22-inch-wide passageway and a level 30 × 30-inch service space. Access through a bedroom closet is allowed (M2005.2.1).
Condensing, heat pump and tankless extras
High-efficiency gas heaters and heat pump water heaters make water. Condensing gas units need a way to collect and dispose of vent condensate (G2427.9); a Category IV unit needs an auxiliary pan where a blocked drain would cause damage, unless it shuts itself down when the drain clogs (G2404.10); and a condensate pump in an attic or crawlspace must stop the appliance if the pump fails (G2404.11). Rheem says to put a heat pump water heater near a floor drain or use a condensate pump. See tankless water heaters and heat pump water heaters for their other requirements.
Energy code: where the IRC’s energy chapter applies to a new hot water system in an existing home (N1111.1.3), hot water piping needs insulation (R-3 in 2021; 1 inch thick in 2024) on pipes ¾ inch and larger indoors, outside conditioned space, under slabs, on recirculation loops and from the heater to a manifold (N1103.5.2). Newport Beach checks the first 5 feet of hot and cold pipe under California’s energy code; Tampa asks for a photo of the insulated hot outlet.
Your installation-day checklist
You don’t need to inspect the plumber’s work, but you can see these without touching anything. Asking about them before the inspector arrives can save a second visit.
Look for these before the installer leaves
- A permit, and an inspection booked (ask who schedules it)
- Relief valve pipe: valve-outlet size, downhill, no valve, tee or threaded end, ending where your code requires
- Expansion tank on the cold line, supported, if your system is closed
- Full-open shutoff valve on the cold supply
- Two seismic straps where required (anywhere in California), the lower one clear of the controls
- A drained pan where a leak would damage the house
- Garage: burner 18 inches up (or an FVIR heater your code accepts) and a bollard or wheel stop
- Gas: shutoff within 6 feet, sediment trap, listed connector, and a vent rising to the chimney with label clearances
- Closet: combustion air openings near the top and bottom, unless direct vent
- Electric: a disconnect in sight or a lockable breaker
- Condensing or heat pump: a condensate line to a drain or pump
- 30 inches clear in front of the controls; manual and permit card left on site
Common questions
Does a replacement water heater have to meet current code?
Generally yes for the new work: the heater, its relief line and its connections are inspected to today’s code. A few items are grandfathered; the IRC, for example, doesn’t require adding a pan drain if none existed. That is why a replacement can include an expansion tank or straps the old heater never had.
Can the T&P discharge pipe go into the drain pan?
Under the IRC and IPC, yes; the pan is an allowed discharge point. Under the UPC as adopted in California, no. Check your local code.
Do I need an expansion tank?
If your water system is closed, almost certainly. A check valve or backflow preventer at the meter, or a pressure-reducing valve, makes it closed, and both the IRC and UPC then require thermal expansion control. The UPC exempts tankless heaters.
Do water heaters need earthquake straps outside California?
In the IRC’s high-seismic areas (Seismic Design Categories D0–D2, and townhouses in category C), yes. Elsewhere the model code doesn’t require them, though a local amendment or the manufacturer might. California requires them on every residential water heater, existing ones included.
Does a water heater in a garage have to be on a stand?
Under the IRC, a gas heater’s burner must be 18 inches above the floor unless the heater is listed FVIR. Many cities still require the stand for gas units, and some apply it to electric ones. It also needs protection from vehicles.
Who fixes it if the installation fails inspection?
Whoever holds the permit answers to the inspector. If a contractor pulled it, agree in writing before work starts that they will correct failed items and arrange the reinspection. If you pulled it yourself, the corrections are yours.
Sources
Sources checked October 4, 2026. Prices, codes and rebates change. Check current details with your installer and local permit office.
- CodeNotes: Water Heater Safety in the I-Codes (2021 IPC 504.6 and IRC P2804.6.1) ↗ · International Code Council
- 2021 IRC Chapter 28, Water Heaters (Colorado DFPC adoption) ↗ · International Code Council, via UpCodes
- 2024 IRC Chapter 28, Water Heaters (Maryland adoption) ↗ · International Code Council, via UpCodes
- 2021 IRC Chapter 29, Water Supply and Distribution (P2903.3, P2903.4, P2906.5) ↗ · International Code Council, via UpCodes
- 2024 IRC Chapter 29, Water Supply and Distribution (P2903.10.2) ↗ · International Code Council, via UpCodes
- 2021 IRC Chapter 13, General Mechanical System Requirements (M1305, M1307) ↗ · International Code Council, via UpCodes
- 2021 IRC Chapter 20, Boilers and Water Heaters (M2005) ↗ · International Code Council, via UpCodes
- 2021 IRC Chapter 24, Fuel Gas (G2404, G2406–G2408, G2411, G2419, G2420, G2422, G2427) ↗ · International Code Council, via UpCodes
- 2024 IRC Chapter 3, Building Planning (R301.2.2.10 seismic restraint) ↗ · International Code Council, via UpCodes
- 2021 IRC Chapter 41, Appliance Installation (E4101.5 disconnecting means) ↗ · International Code Council, via UpCodes
- 2021 IRC Chapter 36, Services (E3609.6 metal water piping bonding) ↗ · International Code Council, via UpCodes
- 2024 IRC Chapter 11, Energy Efficiency (N1103.5.2, N1111.1.3) ↗ · International Code Council, via UpCodes
- 2024 IPC Chapter 5, Water Heaters (Maryland adoption) ↗ · International Code Council, via UpCodes
- International Residential Code (adoption) ↗ · International Code Council
- 2025 California Plumbing Code §608.5, relief valve discharge piping ↗ · California Building Standards Commission, via GoCodebook
- 2025 California Plumbing Code §608.3, expansion tanks and T&P valves ↗ · California Building Standards Commission, via GoCodebook
- 2025 California Plumbing Code §507.2, seismic provisions ↗ · California Building Standards Commission, via GoCodebook
- 2025 California Plumbing Code §507.13, installation in residential garages ↗ · California Building Standards Commission, via GoCodebook
- 2025 California Plumbing Code §507.5, drainage pan ↗ · California Building Standards Commission, via GoCodebook
- 2021 IRC Chapter 35, Electrical Definitions (“within sight”) ↗ · International Code Council, via UpCodes
- 2025 California Plumbing Code §608.2, excessive water pressure ↗ · California Building Standards Commission, via GoCodebook
- 2025 California Plumbing Code §608.7, vacuum relief valves ↗ · California Building Standards Commission, via GoCodebook
- 2025 California Plumbing Code §508.4, appliances in attics and under-floor spaces ↗ · California Building Standards Commission, via GoCodebook
- California Plumbing Code, Chapter 5, Water Heaters (section list) ↗ · California Building Standards Commission, via GoCodebook
- California Health and Safety Code §19211 (water heater strapping) ↗ · California Legislative Information
- Chapter 51-56 WAC: adoption of the Uniform Plumbing Code ↗ · Washington State Legislature
- Residential gas water heater installation instructions and use and care guide (Signature 100, 100341468) ↗ · A.O. Smith
- The top installation mistakes plumbers see with water heaters ↗ · Rheem
- Heat pump water heater installation: complete Rheem guide ↗ · Rheem
- Offline field report checklist: water heater replacement (Rev 03/2026) ↗ · City of Tampa, Florida
- Water heater requirements (Rev 2/3/2026) ↗ · Town of Danville, California
- Water heater checklist ↗ · City of Newport Beach, California
- Guidelines for water heater replacement, 2021 IPC/IRC (June 2025) ↗ · City of Southlake, Texas
- 2026 water heater replacement handout ↗ · Village of Palatine, Illinois
- Water heater replacement handout (2019) ↗ · City of Everett, Washington
- Citizen’s guide to water heaters ↗ · City of Scottsdale, Arizona
- Utah Residential Code 2021, Chapter 28 (state amendments to the IRC) ↗ · State of Utah, via UpCodes