
Learn about the different factors that go into water heater gas valve replacement costs to see if you should DIY the project or call a pro.
By the book is your safest bet
Code requirements for a water heater expansion tank depend on whether your system is closed, meaning backflow prevention devices block excess pressure from returning to municipal lines.
Expect to pay $90 to $350 for expansion tank installation and $810 to $1,570 for water heater replacement, so addressing code violations early helps avoid higher costs.
Your water heater needs proper clearance, ventilation, and safety features like pressure relief valves and sediment traps to meet code and protect your home from hazards.
Hiring a local water heater installation professional keeps your system compliant with plumbing codes and building permits, handling everything from venting to pressure valve installation.
Most homeowners don’t give much thought to everything their home's water heater does for their day-to-day comfort. But when your water heater has reached the end of its lifespan, the odds are that replacing it is pretty high on your to-do list. But water heater replacement isn’t something you can jump right into, as there are multiple codes that you and your local water heater installation pro must adhere to.
Water heater codes require enough clearance for airflow, ventilation, and proper installation of a pressure relief valve. Let’s discuss water heater installation code requirements and common violations that can occur if you’re not careful.

While you may be tempted to install a water heater yourself to save some money or you may forget to inspect the water heater to keep it up to code, risking code violations is not worth it. In addition to facing penalty fines, code violations can void your water heater warranty, which can be costly if something needs to be repaired or the water heater needs to be replaced. Not only that, but code violations can create life-threatening risks to your household.
Here are a few water heater installation code requirements to know so you can ensure your water heater is always up to code:
If your water heater is in a finished basement or anywhere where leaking can cause damage, you must install a catch pan underneath it. However, according to the International Code Council (ICC), if the catch pan wasn’t previously installed, there’s no need to add one when you’re replacing it. However, if your existing water heater had a catch pan, it’s a violation not to include it when replacing your unit.
Another code violation is skipping out on a sediment trap. A sediment trap prevents any debris in the gas line from getting into the gas valve of your water heater and damaging it. The sediment trap should be installed downstream of the shut-off valve and as close to the inlet as practical.
Because gas and propane water heaters release carbon monoxide (CO) while in use, it’s a code violation to place them in a prohibited area of your home. Some of these prohibited areas include:
Bedrooms
Bathrooms
Toilet rooms
Storage closets
Other code regulations say water heaters have to sit on an external wall or, if that space is used for no other purpose, equipped with a solid weatherstripped door and an approved self-closing device. Combustion air should be taken directly from outdoors and comply with that code.
Also, a water heater’s location needs to have at least 12 inches of clearance all around to make sure it’s getting sufficient airflow.
Suppose you live in an area that experiences earthquakes. In that case, it’s a code violation not to have earthquake straps on your water heater to resist horizontal force equal to one-third of the operating weight of your unit. This means that if an earthquake hits, your water heater needs to be strapped down so that the natural disaster doesn’t damage it and, as a result, your home.
One of the most common water heater code violations is not giving your unit enough venting space. Your unit needs proper ventilation to minimize the risk of CO poisoning and back-drafting (exhaust gasses entering your home instead of going outdoors).
There are various ways to vent your water heater, each with different requirements. If you need help figuring out which option works best for your unit, reach out to a water heater installation pro for guidance.
Not every home requires an expansion tank. The code requires homeowners to install an expansion tank if their water heater is on a closed system. Closed systems mean that you have a backflow prevention device, such as a check valve, installed that prevents excess pressure from flowing back into the municipal water supply system or pressure regulating valve. If you do, expansion tanks help stop pressure fluctuations commonly caused by a closed system.
Expansion tank installation costs about $90 to $350, or $220 on average.
Fuel-based water heaters require a healthy amount of combustion air to work. If there’s not enough, your water heater won’t work. To guarantee your water heater is getting enough combustion air to function, you’ll need to determine whether you’ll get it from indoors or outdoors. Combustion air requirements are calculated using the formula provided by the ICC.
The temperature and pressure relief valve helps keep the pressure inside your water heater in check so that it doesn’t rise to dangerous levels (i.e., over 210 degrees Fahrenheit or 150 PSI). It’s practically essential to the safety of you, your home, and your plumbing system.
The problem isn’t why it’s needed, but more so if it’s installed correctly. Incorrect installation can cause the (TPR) valve not to work correctly or at all, leaving your home vulnerable to exceedingly high water pressures and, worst-case scenario, a water heater explosion.
Some homeowners might ignore high water pressure or think it’s normal, but it’s not. It’s a code violation if the water pressure in your home constantly exceeds 80 PSI and you don’t have a pressure regulator to help lower your water pressure to safer levels.
The water heater should have its own shut-off valve, so you can turn off water only to the water heater and not the entire house. This is useful for regular maintenance, like flushing the water heater, and for any repairs. Just make sure that the shut-off valve is not placed between the temperature and pressure relief valve (TPR) and the termination.
The discharge pipe helps the (TPR) valve release hot water and direct it to a safe location. It must be connected to the (TPR) valve with a pipe that isn’t smaller than the (TPR) valve. This pipe can release water either outside, into a drain on the floor, or into a catch pan.
No matter where the water is released, the pipe should end at most 6 inches above the ground and at least two times the amount of the pipe’s diameter. Discharge pipes that release water outside must be visible from the home’s exterior.
Further, discharge pipes must:
Include an air gap.
Only serve one system.
Not be trapped or blocked.
Slope to promote flow by gravity.
Not cause structural damage.
Be made with materials approved for drinking water.
Not be threaded.
Water heaters with ignition sources, like gas or propane, need to sit on a platform at least 18 inches off the floor. This code requirement is important in preventing fires or explosions. The water heater could release vapors that sink toward the floor. A spark from the water heater could ignite the vapors, putting your family in serious danger.

Even if you’re comfortable tackling home upgrades on your own, you shouldn’t DIY install a water heater. Not only does it pose a safety risk, but you could also unknowingly violate code requirements by installing a water heater on your own.
Plumbing codes: A water heater and its set-up must adhere to official water heater plumbing codes, so you’re not unintentionally committing a code violation. You’ll also need to make sure it's set up to prevent the water heater from leaking.
Warranty: If you replaced your water heater yourself versus hiring a licensed plumber, not all manufacturers will cover your water heater if something happens to it.
Permits: Not all cities require you to have a permit to replace your water heater. However, it’s highly recommended that all homeowners get a water heater permit for this project. Also, some cities might require you to get secondary—plumbing or electrical—permits. To see what type of permits you’ll need, check your local building codes.
Supporting skills: A lot goes into replacing a water heater, like making sure all the wiring and plumbing are correct and there are no leaks or holes that gas or pressure can escape out of. Plus, depending on your new water heater, you could have to make an opening in your wall to stay within its dimensions.
Building codes are in place to ensure that your home is structurally sound and safe for you and your family. And since a licensed pro is familiar with building codes, water heater replacement is a job that’s best left to them. For this project, expect to pay between $810 and $1,570.
As usual with ECO, tech Jordan was outstanding, very professional, very knowledgeable, and very thorough with repairs made to tankless water heaters. Very highly recommend ECO!!!
Did a great job replacing the ice maker and water regulator on my refrigerator. He was quick and thorough, very friendly and professional. If I needed a heart transplant I'd want him to do it!!!
We had a gutter blockage that was causing water to sheet down the side of the house and ultimately it started to come in at a window (need mortar people next). Called around 7:30am, and he responded by 8am. He was able to come out the same morning and do a look over and clean out. He also...
Scott checked our large crawl space for mold and water infiltration and recommended a viable solution. The crew was efficient and they cleaned up well after the job. The job was expensive but I am confident that I won't have to deal with the problem again. Highly recommend.
They were the most through inspecting the water system in my house. Even going the extra mile to get the water professionally tested for contamination.
Very well. Have already used them again to fix hot water heater
The Paul Davis team was very professional and went the extra mile to take care of my water damage. The work was very high quality and done in a timely manner. I would highly recommend their services.
Honesty is hard to find in business today. GBR met me today at a 3 story building regarding my being told that I needed to tuckpoint the brick because of water leaks. The owners took the time to evaluate the situation and advised me that I did not need their service at all. They pointed me...
They unclogged the drain and sent me a bill for more than 4 times what I paid before. I called the Water Works to ask why the bill was so high and that they should have gotten my authorization before assuming they could make expensive decisions like that on my behalf and for their benefit....
We had two outdoor fixtures swapped for motion sensing fixtures and a GFCI outlet added to the outside of the garage for the bird bath heater. <br /> He arrived at the agreed upon time and I was surprised and impressed at how quickly everything was completed. <br /> I would definitely...
From average costs to expert advice, get all the answers you need to get your job done.

Learn about the different factors that go into water heater gas valve replacement costs to see if you should DIY the project or call a pro.

Running out of hot water too quickly or hearing strange noises when you call for hot water? Use this water heater repair cost guide to see what a fix will cost.

Wondering how much a water heater expansion tank costs? Use this cost guide to get an accurate estimate and learn how to choose the right one for your home.

Leakage, lacking hot water, and other signs tell you that your water heater is failing. Take action before it’s too late.

Many homeowners don’t know the importance of water heater maintenance until it’s too late. If your water tank leaks, or even bursts, you may wake up to a catastrophic pool in your home. Prevent disaster by following these seven easy steps.

If you’re wondering if you can install a water heater by yourself, know that you should leave this job to a licensed plumber to avoid financial risk and safety risks.