A P-trap is the U-shaped bend in the drain pipe under every sink, tub, and shower. It holds a small pool of water that blocks sewer gas from rising into your home. Plumbing code sets that water seal at 2 to 4 inches deep and requires a trap on every fixture.
What a P-trap is and where it sits
A P-trap is a curved section of drain pipe shaped like the letter U lying on its side, or sometimes a J. Water leaves your sink, drops through the U, and the back half of the bend rises before connecting to the drain line in the wall. The shape is the whole point. After the water you ran finishes draining, a little stays trapped in the low part of the curve. That standing water is the trap seal.
The seal is a plug made of water. Drain and sewer pipes carry gas as well as waste, and that gas wants to move toward open air. Without a barrier it would drift up the pipe and out the drain opening into your bathroom or kitchen. The pool of water in the bend closes the pipe off and stops the gas, while still letting waste water pass through each time you use the fixture.
You will find a P-trap on nearly every drain in the house. Sinks, bathtubs, showers, washing machines, and floor drains all have one you can usually see or reach. A toilet does not have a separate trap under it because its trap is built into the porcelain, the curved passage molded into the base that always holds water in the bowl. The job is the same either way: keep a water seal between you and the sewer.
How the water seal blocks sewer gas
The seal works because of a basic fact about pipes: gas cannot push through standing water. As long as the bottom of the U stays full, the column of water sits there as a barrier. Sewer gas builds up on the pipe side, but it has no path past the liquid, so it stays in the drain system and vents safely out the roof.
This matters because sewer gas is unpleasant and can be unhealthy. The rotten-egg smell people notice is hydrogen sulfide. According to the ATSDR and CDC, you can smell hydrogen sulfide at very low levels, with an odor threshold around 0.0005 to 0.3 parts per million. At low concentrations it irritates the eyes, nose, and throat and can bring on headaches. The bigger point is comfort and warning: a working trap keeps that air where it belongs.
Sewer systems also carry far more than odor. The EPA reports that sanitary sewer systems experience tens of thousands of overflow events a year nationwide, releasing billions of gallons of untreated wastewater. Your home's traps are the last line keeping that whole network sealed off from your living space. A pool of water a few inches deep is doing a lot of quiet work.
The depth of that pool is set by code, not by guesswork. The International Plumbing Code in section 1002.4 states that a trap seal "shall be not less than 2 inches and not more than 4 inches." Too shallow and it evaporates or siphons away too easily; too deep and waste does not flush through the bend cleanly. The 2-to-4-inch range is the tested sweet spot, and inspectors check for it on new work.
Why code requires a separate trap on every fixture
Plumbing code does not just ask for a trap of the right depth. It requires that each fixture have its own. The idea is that one dried-out or failed trap should not open a path for gas through the rest of the house. Trapping fixtures one by one keeps each seal independent. As a plumbing-code summary from the ASPE puts it, the code's trap rules exist to maintain that water seal at every fixture and keep sewer gases out of the building.
This is also why the older S-trap is no longer allowed. An S-trap curves down, back up, and then turns down again into the floor. That second downward turn lets a full rush of draining water pull the seal right out behind it, a problem called self-siphoning. The fixture drains, the trap empties along with it, and you are left with an open pipe and no water barrier. Modern code requires the P shape, which turns into the wall and resists that siphon, paired with proper venting.
Venting is the partner to the trap, and it is why the connection turns horizontal toward a vent rather than straight down. A plumbing vent brings air in behind the draining water so the drain does not create a vacuum that sucks the trap dry. The IPC limits how much pressure a vent system is allowed to let build, holding the swing to within 1 inch of water column, because that is roughly the most a 2-to-4-inch seal can take before it gets siphoned or blown out. Trap and vent are designed to work as a pair. For more on that side of the system, see our explainer on what a plumbing vent is.
Why a P-trap dries out, and the smell that follows
The most common reason a trap stops working is simple: the water in it evaporates. If a drain goes unused for long enough, the standing pool slowly dries away until the bend is empty and gas has a clear path up. This happens fastest in drains you rarely touch, like a guest-bathroom sink, a basement floor drain, or a tub in a spare bathroom. In a hot, dry climate like Phoenix, evaporation runs faster, so a seldom-used trap can give out sooner than it would in a humid place.
The classic symptom is a sewer smell coming from a drain you have not used in a while. If a spare bathroom suddenly smells like rotten eggs, a dried-out trap is the first thing to check. The fix is usually as easy as the cause: run water down that drain for a minute to refill the trap. Pouring a cup or two of water into a rarely used floor drain every month keeps the seal topped off. Where a drain almost never sees water, code allows a trap seal primer or a barrier device to keep the bend wet automatically. We cover the smell side of this in detail on our page about why a bathroom drain smells like sewer.
A trap can also lose its seal for reasons other than drying out. A blocked or missing vent can siphon it empty on every use. A clog can hold dirty water in the bend so it never refills cleanly. And buildup of grease, hair, and soap inside the bend can both slow the drain and trap odor on its own. If a drain runs slowly along with the smell, the trap or the line past it may be partly clogged, which we walk through in our guide on how to fix a slow-draining sink.
What to know if you ever open or replace a trap
A P-trap is one of the few plumbing parts a homeowner can often reach without tools beyond a bucket and a wrench. The bend usually joins the rest of the drain with slip-joint nuts you can loosen by hand or with light force. People open a trap to clear a clog, to find something dropped down the drain, or to replace a part that leaks at the joints. If you do, put a bucket underneath first, because the trap is full of water by design.
When a trap is reassembled, two things have to stay true to code. The seal still has to sit in that 2-to-4-inch range, and the trap still needs proper venting behind it. A common mistake during DIY work is rebuilding the drain in a way that recreates an S-trap or adds extra bends, which can cause slow draining and siphoning that pulls the seal. If a drain that used to work fine starts gurgling or smelling after a repair, the new trap geometry is a likely cause.
The trap itself is cheap, but the seal it holds is what protects the house. A pool of water two to four inches deep, refilled now and then, is all that stands between your rooms and the sewer line. Keep rarely used drains wet, fix slow drains before they get worse, and make sure any drain work keeps the P shape and the vent that supports it.
