Home Improvement10 min read

What the Code Requires at a Gas Appliance Connection: Shutoff, Sediment Trap, Connector

By Seamless Home Team, Home services operations · September 23, 2026

Quick answer

Three requirements meet in the last few feet of pipe and they have a required order. First, an accessible shutoff valve within 6 feet of the appliance and in the same room as it. Second, downstream of that shutoff valve and as close to the appliance inlet as practical, a sediment trap — unless the appliance has one built in, or is one of the six types the code exempts: illuminating appliances, ranges, clothes dryers, decorative vented appliances for installation in vented fireplaces, gas fireplaces and outdoor grills. The trap is a tee fitting with a capped nipple of any length installed vertically in the bottommost opening, or another device approved as an effective sediment trap. Third, the connector itself, which under the 2021 residential code may not exceed 6 feet overall, is limited to one connector per appliance, must have the capacity for the total demand of the appliance, and may not be concealed within or extended through walls, floors, partitions, ceilings or appliance housings. Older editions and some jurisdictions still in force set the connector limit at 3 feet with a 6-foot allowance for ranges and domestic clothes dryers, so a correct citation can look wrong to someone reading a different edition.

The last few feet of gas pipe before an appliance are governed by three separate requirements that arrive from three different places in the code. They have a required order, two of them carry exemptions that are easy to misremember, and the single most quoted figure of the three changed between editions.

Running toward the appliance, the sequence is:

supply piping → shutoff valve → sediment trap → connector → appliance

Everything below is about why it is that order and where each piece actually fails.

The shutoff valve: three conditions, and the third is the one that fails

An accessible shutoff valve is required within 6 feet of an appliance and in the same room as it.

Three conditions, and they are not interchangeable:

  • Accessible. It excludes a valve reachable only by dismantling a permanent part of the building. It does not require the valve to be in plain sight — behind a cabinet door is fine.
  • Within 6 feet. A measured distance to the appliance.
  • In the same room. This is the one that gets missed, because it is the only one that can fail while the other two pass.

A valve in the basement directly below a kitchen range can genuinely be within 6 feet by tape measure and be in the wrong place. The point of the rule is that somebody dealing with a problem at the appliance can isolate it while standing there — not after going downstairs, and not after searching. Distance is a proxy for that; the room is the actual requirement.

The sediment trap: what it is, and the six appliances that do not need one

What it does

A sediment trap is a short dead-end leg of pipe pointing downward at the appliance inlet. Debris travelling in the gas stream — rust, scale, thread cuttings, cutting oil from the pipe fabrication — arrives at the last fitting with momentum. To continue toward the appliance the gas has to turn. Anything heavier than gas does not make the turn, drops into the capped leg, and stays there.

What it is protecting is the appliance's control valve, a precision component in which a fragment of scale across a seat is enough to prevent sealing.

The construction is specified rather than left open:

a tee fitting having a capped nipple of any length installed vertically in the bottommost opening of the tee… or other device approved as an effective sediment trap

"Of any length" is doing useful work — the leg does not have a minimum depth. What it does need is room to unscrew the cap and clean it out, which is a real constraint in a tight appliance closet and is the reason a technically compliant trap jammed against a wall is still a bad trap.

Many people call this a drip leg. A drip leg is a related but distinct fitting aimed at condensed liquids, and the terms are not interchangeable in the code even though they are in conversation.

The order is stated, not implied

Where a sediment trap is not incorporated as part of the appliance, a sediment trap shall be installed downstream of the appliance shutoff valve as close to the inlet of the appliance as practical.

Downstream means on the appliance side of the valve. A trap installed upstream of the shutoff is a genuine defect rather than a cosmetic one, for two reasons: it cannot be serviced without isolating gas somewhere further back, and it leaves the run between the valve and the appliance — the part nearest the control it is protecting — uncovered.

"As close to the inlet of the appliance as practical" is the second half. A trap in the right sequence but several feet back is collecting debris from less of the piping that matters.

The six exemptions, two of which are the familiar ones

Illuminating appliances, ranges, clothes dryers, decorative vented appliances for installation in vented fireplaces, gas fireplaces and outdoor grills need not be so equipped.

Ranges and clothes dryers are on that list. Those are precisely the two appliances most people picture when they picture a flexible gas connector, which means the common mental model — a trap on every gas appliance — is wrong at its two most familiar examples.

There is a second, separate reason an appliance may legitimately have no visible trap. The requirement applies where a sediment trap is not incorporated as part of the appliance. A unit with an integral trap does not need a second one outside it. That is a manufacturer's-documentation question, not something to settle by looking at the pipe.

The connector: one of them, six feet, and nothing hidden

The length figure changed editions

Under the 2021 residential code:

Connectors shall have an overall length not to exceed 6 feet… Only one connector shall be used for each appliance.

Older editions, and some state and city codes still in force today, say something different: 3 feet, with a separate allowance of 6 feet for range and domestic clothes dryer connectors.

Both are real code text. They are from different documents. This is the same failure mode as a renumbered section — a correct citation looks obsolete to somebody reading a different edition, and the argument that follows is not about the installation at all. Confirm the edition the jurisdiction has actually adopted before anyone measures anything. Which edition applies is a question worth asking early on any permitted job, for the same reasons it matters when a code edition changes mid-project.

One connector, and no joining two

"Only one connector shall be used for each appliance" is the clause most often broken, usually with good intentions. Two connectors coupled together to bridge an awkward distance is not a compliant 6-foot run. It is two connectors, and no fitting between them makes it one.

Where the distance is genuinely too great, the answer is to extend the piping and shorten the connector, not to extend the connector.

It may not disappear into the building

Connectors shall not be concealed within, or extended through, walls, floors, partitions, ceilings or appliance housings.

Two separate prohibitions live in that sentence: passing through a building element, and being concealed within one. A connector that crosses behind a finished wall and emerges is prohibited; so is one that goes into a chase and never comes out.

The reason is what a connector is. It is not piping. It is a flexible, comparatively vulnerable component with a shorter service life than the pipe it attaches to, and its entire basis is that it stays visible and reachable for inspection and replacement. Concealing it removes the thing that made it acceptable.

There are narrow exceptions — connectors made of materials approved for piping systems and installed under the piping provisions, and rigid steel pipe connectors extending through openings in appliance housings — but neither covers the ordinary corrugated flex connector that this rule is usually about.

It has to be big enough

Connectors must have the capacity for the total demand of the connected appliance. A connector is a restriction as well as a link, and a physically fitting connector that starves a high-input appliance is a real defect that shows up as a performance complaint rather than as an obvious fault — which makes it one of the harder ones to diagnose after the fact.

Where this lands in practice

These requirements attach to an installation. The passage of time does not trigger them; a replacement does.

Which makes the appliance replacement the moment when all of this is cheap. The last few feet of pipe are open, the shutoff, the trap and the connector are all being handled anyway, and correcting a sequence or adding a missing trap at that point costs close to nothing against the cost of the visit. Six months later it is a separate call-out.

The way that actually happens is by being written into the scope of work rather than left to the judgement of whoever turns up — the same reason a clear scope prevents change orders on larger jobs. Where that appliance sits in a garage, the garage appliance installation checker covers the two requirements that attach to the appliance in that room, separately from the pipe reaching it.

Three lines cover it: where the shutoff is and confirmation it is in the same room, whether a sediment trap is required for this appliance and where it sits relative to the shutoff, and the connector's length and that there is exactly one of them.

The bottom line

Shutoff, then trap, then connector, then appliance — and the order is part of the requirement, not a convention. The shutoff has to be in the same room, not merely within six feet. The sediment trap goes downstream of it, and ranges and clothes dryers are exempt from it entirely. The connector is limited to one per appliance, has to carry the appliance's full demand, and may never be concealed in or run through the building. And the length limit is an edition question before it is a measurement.

If you are coordinating an appliance replacement and want these settled in the scope rather than discovered at inspection, talk to us.

Frequently asked questions

What is a sediment trap and what does it actually do?

It is a short dead-end leg of pipe pointing downward at the appliance inlet, and its job is to catch debris travelling in the gas stream before that debris reaches the appliance's control valve. Rust, scale, pipe-thread cuttings, and cutting oil carried out of the supply piping arrive at the last fitting with some momentum. At the trap the gas has to turn to continue toward the appliance and anything heavier than gas does not make the turn, so it drops into the capped leg and stays there. The control valve on a modern appliance is a precision component and a fragment of scale across a seat is enough to stop it sealing. The construction is specified: a tee fitting having a capped nipple of any length installed vertically in the bottommost opening of the tee, or another device approved as an effective sediment trap. Many people call it a drip leg, which is a related but different fitting intended for condensed liquids.

Which gas appliances do not need a sediment trap?

Six categories are named, and two of them surprise people: illuminating appliances, ranges, clothes dryers, decorative vented appliances for installation in vented fireplaces, gas fireplaces and outdoor grills need not be so equipped. Ranges and clothes dryers are exactly the two appliances most people picture when they picture a flexible gas connector, so the mental image of a trap on every gas appliance is wrong at the two most familiar examples. There is also a separate reason an appliance may legitimately have no external trap, which is that one is incorporated as part of the appliance. The requirement is written as applying where a sediment trap is not incorporated as part of the appliance, so a furnace with an integral trap does not need a second one bolted to the outside. That is a manufacturer's-documentation question rather than a visual one.

Does the sediment trap go before or after the shutoff valve?

After it, and the order is stated rather than implied. Where a sediment trap is not incorporated as part of the appliance, a sediment trap shall be installed downstream of the appliance shutoff valve as close to the inlet of the appliance as practical. Downstream means on the appliance side of the shutoff, so the sequence running toward the appliance is supply piping, then shutoff valve, then sediment trap, then connector, then appliance. A trap installed upstream of the shutoff is a real defect and not a cosmetic one, because it cannot be serviced without shutting off gas further back, and because it leaves the run between the valve and the appliance unprotected. The phrase as close to the inlet of the appliance as practical is the other half of it: a trap correctly sequenced but placed several feet back collects debris from less of the piping that matters.

How long can a flexible gas connector be?

Under the 2021 residential code the connector shall have an overall length not to exceed 6 feet, and only one connector shall be used for each appliance. That second clause is the one that gets broken: two connectors joined to reach the appliance is not a compliant 6-foot run, it is two connectors, and no length of coupling makes it one. Be careful with the figure, though, because it changed. Older editions and some state and city codes still in force set the limit at 3 feet, with a separate allowance of 6 feet for range and domestic clothes dryer connectors. Both numbers are real code text; they are just from different documents. This is the same trap as a renumbered section — a correct citation can look obsolete to someone reading a different edition, so confirm the edition the jurisdiction has actually adopted before arguing about a measurement.

Can a gas connector run through a wall or be hidden behind the appliance?

No, and this is the prohibition with the least ambiguity of any of them. Connectors shall not be concealed within, or extended through, walls, floors, partitions, ceilings or appliance housings. Two separate things are banned there: passing through a building element, and being concealed within one. A connector that runs behind a finished wall and emerges on the other side is prohibited, and so is one buried in a chase that it never exits. The reason is that a connector is not piping — it is a flexible, comparatively vulnerable component with a shorter service life, and its whole basis is that it stays visible and reachable for inspection and replacement. There are narrow exceptions for connectors made of materials approved for piping systems installed under the piping provisions, and for rigid steel pipe connectors extending through openings in appliance housings, but they do not cover the ordinary corrugated flex connector.

Where does the appliance shutoff valve have to be?

Accessible, within 6 feet of the appliance, and in the same room as the appliance. All three conditions matter and the third is the one most often missed, because a valve in the basement below a kitchen range can genuinely be within 6 feet of it by measurement and still be in the wrong place. The purpose is that someone dealing with a problem at the appliance can isolate the appliance while standing at it, without leaving the room and without hunting. Accessible has meaning too: it excludes a valve that can only be reached by removing a permanent part of the building, though it does not require it to be visible without opening a cabinet door. There is also a separate rule that a shutoff valve is installed ahead of the connector, which is the same valve viewed from the sequence rather than from the room.

Is a missing sediment trap something to fix on an existing appliance?

It is worth separating two questions that get merged. Whether an existing installation is required to be brought up to current requirements is a question about the jurisdiction and about what work is being done — requirements generally attach to the installation, so a replacement triggers them and the passage of time does not. Whether it is worth fixing is a different question, and the answer is usually yes when the appliance is already being worked on, because the fitting is inexpensive and the failure it prevents is a control valve. The practical moment for this is an appliance replacement: the last few feet of pipe are open, the shutoff, the trap and the connector are all being handled anyway, and correcting the sequence at that point costs almost nothing. Getting it listed in the scope of work beforehand is what makes it happen.

Ready to close more deals and hand off the rest?

Seamless Home connects your organization to financing, discounted materials, vetted installers, and full project management, so you can focus on selling.

Get In Touch