A dip tube is a plastic tube in your water heater that was installed by the manufacturer to insure that the water flowing in at the top of tank will mix only with the water dwelling within the bottom of the tank.
Water heaters didn't always have dip tubes. Decades ago the inlet port of a water heater was at the bottom of the tank. This was done to accommodate the fact that hot water rises above cold water.
Here is why, in case you want to know.
All matter is made up of atoms and molecules. These particles are constantly vibrating and this vibration creates space between them. As molecules absorb heat they vibrate faster, this expands the space between the molecules and so expands the space they fill as a mass. The actual weight of the molecules however is unchanged, they simply take up more space. In water this causes a volume of hot water to be lighter than an equal volume of cold water, the former baring fewer molecules per cubic foot. Thus hot water rises above cold water. This same function in air is what makes hot air balloons rise.
When the inlet port of a water heater was at the bottom of the tank the outlet port was typically at the apex of the domed top of the tank. This created an elegantly simple and functional system, heavy cold water in at the bottom light hot water out at the top. At some point manufacturers abandoned this form in favor of both inlet and outlet ports at the top of the tank. Not only did they relocate the cold inlet, they relocated the hot outlet. It was no longer at the apex, it was offset which created symmetry between the hot and cold ports. I must be honest and admit that I don't understand why the change was embraced but it certainly looks to me like a classic example of form thwarting function. What did not change is the thing that never changes, the immutable laws of physics. They still needed the cold water to encounter the entire pool of water at the bottom of the tank. To do this they narrowed the inlet port at the base of its female thread and inserted a plastic tube that was flared at one end. This flare hung from the narrowed ring of the inlet port and once a pipe nipple was threaded into the port the tube was trapped into position. Incoming cold water was shunted by the tube that dipped into the tank from the new high inlet, the "dip tube" was created.
Originally it was possible to accidentally drain a water heater when the piping system was depressurized and opened during work. It still is if the dip tube which reaches into the bottom of the tank creates a siphon. If an electric water heater is not turned off at the power source and a siphon drainage occurs the elements could become exposed to air and will burnout if the thermostat closes the second leg of 120 volt power to one or both of them. A dip tube has a small hole in it that should be higher than the top element in the water heater. This hole is intended to break any siphon that occurs by allowing air to enter the cold water side. The hole is small however and not 100% to be relied upon as it could become plugged. If you are draining water from a cold water pipe during work and the water is hot or warm you are probably siphoning from the water heater and should power down the heater. Power it down before you try to stop the siphon, you should probably power it down when opening the piping in any case.
Dip tubes are fraught with problems. They have a tendency to disintegrate in hot water, especially 140 degree water. They can also break lose at their point of attachment. In either case there is a reduction of available hot water the reason for which is not obvious to the layman. Because dip tubes are typically made of petroleum based plastic, small pieces that slough off of them float in the tank. These pieces accumulate at the unported apex of the tank's domed top where they are available to be drawn into the outlet port at random. Once they invade the pipes of the branched hot water system they have a tendency to migrate toward the faucets and valves that are open for the longest intervals. The single most common place to find dip tube therefore is the tub and or shower valve.
Sorry about the older phone images from jobs.
Above, the photo on the left shows a Delta kitchen sink faucet diverter assembly bound with bits of rust and a veritable tissue of dip tube fragments. On the right is the view into an angle stop with the stem and handle removed. This mat of dip tube slowed the flow to the down stream faucet and prevented the supply stop from working properly .
Clearing dip tube from faucets and valves is not always easy but the greater problem is that it tends to just keep coming into the hot water system until the offending water heater is replaced. Not only is it near impossible to clear a water heater tank of the hundreds of small particles in it, by the time you notice a serious problem, even after the new tank is installed, bits of dip tube will wend their way to points of use till all flow through or are removed. It is frustrating to remove a tank before it actually rusts out but this is called for in many instances.
To save that tank one would have to remove and replace the plastic tube as soon as there is any evidence of a problem or even before, by installing a new tube at about half way through the expected life of the tank.
How to diagnose a dip tube problem when there is a dis-attachment or the particles don't float. Here is my standard in the field explanation. There are two ways to run out of hot water during use, while showering let us say. There is, in a normally functioning water heater, a band of tepid water that separates the pool of heated water from the pool of not yet heated water. As you exhaust the available heated water this band slowly rises toward the top of the tank. When it reaches the outlet port you will notice a cooling of the water as you shower, you will adjust the valve but the water flowing from it is not as hot as it was a moment ago. In a moment you will be closing the cold side of the valve, using water only from the hot side and still the water will not be hot enough. Maybe two minutes after you note the first change there will be only cold water flowing from the valve, game over till the tank recovers. Perfectly normal.
Alternately, you begin to shower and three to five minutes later the water temperature changes, is cooler. The water flowing from the hot side is tepid and continues to be tepid, not becoming cold after the expected brief interval. This happens because incoming cold water is now spoiling the floating pool of hot water at the top of the tank, not being shunted to the bottom any longer. A new tube or a new tank is the solution.
Once, years ago before I was self employed, I was dispatched to service a new water heater that was showing signs of a dip tube failure. I was not the first plumber sent to deal with the problem and as on other occasions my boss told me to deal with it, I was to be the last plumber he would send to resolve the issue. I pulled the nipple out of the inlet port and sure enough the previous plumber had installed a new tube, all was proper. Stopping to consider, I did not believe the tank had been assembled sans a dip tube but I could believe it had been slipped into the hot port instead of the cold. There is no retainer ring on the hot side and a flanged dip tube would simply drop into the tank uselessly. Worse, it would float to the top of the tank and its upper tip would be drawn toward the outlet port by the flow of water from the tank where it would hang till some disturbance dislodged it. So, with a functioning tube on the cold side and a rogue tube on the hot side incoming cold water would be carried to the bottom of the tank and outgoing water would be drawn from the bottom of the tank. The effect would be the same as if there were no dip tube at all. Investigating my theory, I pulled the nipple from the outlet port and discovered there were indeed two tubes in the tank. Unfortunately this action dislodged the lightly floating tube and I had to fish it out. When I finally got it to realign with the outlet port, remember it would not pass through he inlet port's restriction, I bent a sharp hook into the tip of a fresh roll of solder and carefully passed it into the end of the tube. I unrolled and passed solder into the tube till the hook emerged out of the far end, effectively capturing the tube, then I worked it out of the tank.
This is how one would remove a detached floating dip tube from a tank and I have done it more than once. A sinking tube is pretty much of no consequence. For the most part however, experience has shown that it is not worth the effort if the tube has fallen away because it is shredding. The tank will have diminished value by then as by that time it will be far from new and there will be too much debris in it to justify the effort.
Dip tubes are available in a few forms. Aside from the standard flanged style I have described there is a style that is permanently attached to the inlet port nipple. It will draw out of the tank with the nipple and the replacement has a new pipe nipple attached to it. No matter which you use the tube must be cut to length before it is installed. The proper length is so that it reaches below the lower element but is off the bottom.
Occasionally you will see a tank with a tube that reaches to the bottom and turns to arc around. It is supposed to keep debris from settling on the bottom so that it may be flushed away. This seems kind of gimmicky to me on the one hand, on the other I wouldn't want the incoming cold water to be so very focused on the welded seam at the base of the heater. The welded seams in the tank expand and contract as they heat and cool, that expansion and contraction is work and work is not particularly good for welded joints. Mid way between the element and the bottom is a good enough place to infuse cold water in my book.