Why is my brand new PEX clear tubing turning green near the water heater?
I am a professional plumber and I have been using PEX tubing for 20 years and I am also manufacturer-certified to do so.  

The only time I've ever seen this green color in PEX tubing it was algae.  The pipe was a cold water supply line that was wrapped with heat tape and pipe insulation, and run above ground underneath my camper. When I removed the pipe it had algae growth along its whole length.

However, the algae will not stick to the pipe. When you kill it, it will just wash away out through your faucets; just make sure you remove your aerators in order not to clog them.


Shut off the water supply line to your water heater.
Drain some water out of your water heater from the drain valve. 
Disconnect the supply line from your water heater, so you can pour your bleach in from there. 
Reconnect your water heater and run hot water out all your faucets until you can smell the bleach. 
After letting it sit for a sufficient amount of time, flush all the water out of your hot water pipes and water heater until no more bleach is detected.


This will kill your algae, but you may still have it inside your pipes. You might need to tap on the pipe to knock it loose before flushing.

In my case I drained the pipe and the algae dried up and fell from the pipe. Or you could remove and replace the affected area.