
Gas Pipe Materials, Sediment Traps, and Testing: Code Guide
Gas pipe installations fall under IFGC Chapter 4 and UPC Chapter 12. Steel (black iron) pipe, CSST and copper serve inside buildings, and polyethylene is limited to outdoor underground runs. Every appliance needs a shutoff valve, most need a sediment trap downstream of it, and new piping must pass an air or inert-gas pressure test before appliances are connected.
What type of pipe is used for natural gas lines?
Natural gas lines inside a building are run in steel pipe (the black iron pipe on most job sites), in corrugated stainless steel tubing (CSST), or in copper. Plastic gas pipe stays outdoors and underground. The materials rules sit in IFGC Section 403 and UPC Section 1208.
The IFGC uses piping to mean pipe, tubing or both:
- Pipe is rigid conduit of iron, steel, copper, copper-alloy or plastic.
- Tubing is semirigid copper, copper-alloy, aluminum, plastic or steel.
CSST is the flexible gas line crews pull through framing. It is sized by EHD number rather than nominal pipe size. The higher the EHD number, the more gas the tubing carries. The comparison below sets the metallic choices against polyethylene (PE), the plastic used for buried gas piping.
Metallic gas piping vs polyethylene
| Metallic piping | Polyethylene (PE) | |
|---|---|---|
| Where it may run | Inside and outside buildings | Outdoors and underground only. Never within or under a building or slab |
| Bends | Made with bending tools only, no more than 90 degrees, inside radius at least 6 times the outside diameter, longitudinal weld near the neutral axis | Inner radius at least 25 times the inside diameter, no joints in the bend, manufacturer's tools where specified |
| Transitions | Insulating coupling or fitting wherever dissimilar metals join underground (UPC) | Metal-to-plastic joints outdoors underground only, with ASTM D2513 Category I or ASTM F1973 transition fittings (the UPC also accepts ASTM F2509) |
| Identification | Steel pipe and CSST need no yellow label. CSST is marked to ANSI LC 1/CSA 6.26. Other exposed piping gets yellow labels reading Gas in black, no more than 5 feet apart, except in the room of the appliance served | Buried, so located by tracer wire instead |
| Bonding and locating | Electrical bonding per IFGC Section 310, with arc-resistant CSST covered in 310.3 | Yellow insulated copper tracer wire, 18 AWG minimum (IFGC), or insulated copper conductor, 14 AWG minimum (UPC) |
The difference
Inside the building, run metal. Underground outside, PE is an option.
Running polyethylene gas pipe underground
PE suits long buried runs, such as the line to a detached garage. IFGC Section 404.17 attaches conditions to it, and UPC Section 1210.1.7 sets the same outdoor-underground limit. Before backfilling a PE line, confirm each of these:
- Route: outdoors and underground only, never within or under a building or slab. Outdoor patio, walkway and driveway slabs are the exception, provided the burial depth meets IFGC Section 404.12.
- Pressure: no more than 100 psig on natural gas or 30 psig on LP-gas (IFGC).
- Tracer: a yellow insulated copper tracer wire, 18 AWG or larger under the IFGC, with insulation suited to direct burial, laid beside the pipe. Under the UPC, an insulated copper tracer must be 14 AWG or larger. Either give access to it or bring it above ground at each end of the plastic run.
- Metal-to-plastic joints: made only with transition fittings to ASTM D2513 Category I or ASTM F1973. The UPC also accepts ASTM F2509.
- Coming out of the ground: terminate above grade outside the building in a premanufactured anodeless riser or service head adapter riser, installed to the manufacturer's instructions. Inside a building, PE may end at a wall head adapter only where it is inserted in a piping material approved for fuel gas in buildings.
Warning
Under the UPC, a steel riser connected to plastic pipe must be cathodically protected by a welded anode unless it is an anodeless riser.
Placing the appliance shutoff valve
The IFGC defines the piping system as ending at the outlet of each appliance shutoff valve. That makes this valve the first fitting you set on every appliance drop. IFGC Section 409 covers shutoff valves, with appliance valves and access to them in Section 409.5. Under IFGC 409.5.1 the usual location is in the same room as the appliance, within 6 feet of it, upstream of the union, connector or quick-disconnect it serves, with access. IFGC 409.5.2 lets valves for vented decorative appliances and room heaters sit remote from them with ready access, and 409.5.3 allows a valve at a manifold within 50 feet of the appliance. UPC 1212.6 sets the 6-foot limit and puts the valve upstream of any connector.
UPC Section 1208.14 says a shutoff valve must be approved and chosen for pressure drop, service, emergency use and reliable operation. Any valve 1 inch NPT or smaller must be listed. The UPC also sets these location rules:
- A valve for a decorative appliance stays out of the fireplace firebox unless it is listed for that spot.
- A valve may sit inside a recessed wall heater or wall furnace where servicing does not mean removing it.
- Valves are barred from the space above a dropped ceiling. The exception is appliance shutoff valves in accessible spaces that contain vented appliances.
Several different types of gas shut off valves appear in these sections, each with its own job:
- Appliance shutoff valve: one at each appliance, ahead of the sediment trap.
- Manual shutoff valve with a non-displaceable valve member: required upstream of any quick-disconnect device installed indoors (the device itself listed to CSA Z21.41).
- Listed shutoff valve immediately ahead of each MP regulator (IFGC).
- Low-pressure protective device: installed between meter and appliance where the appliance could produce a vacuum or a dangerous pressure drop at the meter. Such devices include, but are not limited to, mechanical, diaphragm-operated or electrically operated low-pressure shutoff valves (UPC).
- Excess flow valves: where fitted, listed to CSA Z21.93 under the UPC or ANSI Z21.93/CSA 6.30 under the IFGC, sized and installed to the manufacturer's instructions.
How to build a water heater sediment trap
A water heater sediment trap keeps debris in the gas out of the gas control valve. Where the appliance has no trap built in, both codes require one downstream of the appliance shutoff valve, as close to the appliance inlet as practical. The UPC adds that it goes in when the appliance is installed.
The standard trap is a tee with a capped nipple in its bottom opening. Another device recognized as an effective trap is also allowed. On a vertical drop, gas comes down into the tee and turns 90 degrees out the side opening toward the appliance. The nipple carries on straight down as a dead-end pocket where sediment settles.
The gas sediment trap requirements differ on nipple length:
- UPC Figure 1212.9: at least 3 inches.
- IFGC Section 408.4: any length, installed vertically in the bottommost opening.
A nipple laid horizontally in a side opening is not a sediment trap under either code.
Both codes exempt these appliances from the trap:
- illuminating appliances
- ranges
- clothes dryers
- decorative appliances for vented fireplaces
- gas fireplaces
- outdoor grills or cooking appliances
A water heater is not on that list.
Watch out
Watch the order on the drop. A drip leg built on the riser above the shutoff valve fails both codes, because the trap belongs between the valve and the appliance inlet.
Check yourself
You are checking a new 40-gallon water heater hookup under the UPC. Coming down the drop you find a tee with a 2-inch capped nipple pointing down, then the appliance shutoff valve, then a short nipple into the gas control valve. What is wrong?
- Nothing. The trap and valve both meet the code.
- The trap is upstream of the shutoff valve, and the nipple is shorter than 3 inches.
- Only the nipple length is wrong.
- Water heaters do not need a sediment trap.
Sizing gas piping to total appliance demand
Gas piping must carry the maximum demand and still deliver at least the minimum supply pressure each appliance needs at its inlet (IFGC Sections 402.1 and 402.6).
Under UPC Section 1208.4.1, demand is the sum of the maximum input ratings, in Btu/h, of every appliance served. All appliances are assumed to fire at full capacity together, unless established load diversity factors are used. Above 2000 feet, adjust the flow for altitude.
Where the input is not marked, ask the gas supplier, the manufacturer or a qualified agency, or estimate from Table 1208.4.1. Selected values:
| Appliance | Approximate input (Btu/h) |
|---|---|
| Water heater, automatic storage, 30 to 40 gallon | 35,000 |
| Water heater, automatic storage, 50 gallon | 50,000 |
| Warm-air furnace, single family | 100,000 |
| Range, freestanding, domestic | 65,000 |
| Clothes dryer, Type 1 (domestic) | 35,000 |
| Gas fireplace, direct-vent | 40,000 |
With the load known, the branch length method in IFGC Appendix A (informative guidance, not code text) sizes the system from the tables:
- Find the gas load of each appliance.
- Starting at the meter, divide the system into segments. Find each segment's length and its load with every appliance running. Add an equivalent length from Table A102.2 for any segment with four or more fittings.
- Measure from the meter outlet to the farthest appliance.
- Size every segment on that longest run using that longest distance.
- For each of those segments, take the longest length and the segment's connected load.
- In the sizing table for your operating conditions and piping material, find that length in the first column, or the next longer one.
- Read across that row to the load, or the next larger capacity.
- Read up to the pipe size in the top row. Repeat steps 6 to 8 for each segment on the longest run.
- Size each remaining branch by measuring from the meter to the most remote outlet on that branch, using its attached load and steps 2 to 8.
The appendix also gives a hybrid pressure method for low-pressure piping downstream of a line regulator. Operating conditions and piping material decide which sizing table you open, and a different operating pressure or pressure drop means a different table.
Its retrofit example adds a barbecue to an existing system:
- 0.60 specific gravity gas
- 0.5-inch w.c. pressure drop
- 40 feet from the point of delivery
- 40 cfh load
Table 402.4(15) gives EHD 18 CSST for that run.
Adding an appliance also means rechecking the existing pipe. Under UPC Section 507.18, an undersized system is enlarged, or a separate line of adequate size is run from the point of delivery.
Pressure testing new gas pipe before appliances go on
IFGC Section 404.20 requires gas pipe to be tested gastight before it is put in service or covered, following Section 406. Under IFGC 406.4.1 the test pressure is at least 1 1/2 times the proposed maximum working pressure and never less than 3 psig, and under 406.4.2 it is held at least 10 minutes in a single-family dwelling or a system under 10 cubic feet, otherwise 1/2 hour for each 500 cubic feet.
The UPC ties the test to its final piping inspection (Section 1203.3.2), which must comply with Section 1213.1. That inspection happens after the piping is installed and after any portions to be covered or concealed are concealed, and before any fixture, appliance or shutoff valve is attached. Notify the Authority Having Jurisdiction (AHJ), and leave underground trenches open until approval.
The test medium is air, nitrogen, carbon dioxide or another inert gas. UPC Section 1213.3 sets these minimums, and the AHJ may require a longer hold:
| Piping | Minimum test pressure | Minimum hold |
|---|---|---|
| Standard system | 10 psi | 15 minutes, no perceptible drop |
| Welded piping, or gas above 14 inches w.c. | 60 psi | 30 minutes |
| CSST carrying gas above 14 inches w.c. | 30 psi | 30 minutes |
Prepare the system as both codes require:
- Clear all foreign material from inside the pipe (IFGC).
- Leave joints and welds exposed, except concealed end joints already tested to code.
- Restrain expansion joints temporarily if the test thrust requires it.
- Disconnect appliances not in the test, or isolate them with blanks, blind flanges or caps.
- Disconnect appliances rated below the test pressure and cap the outlets.
- Isolate appliances rated at or above the test pressure by closing their shutoff valves.
- Run the test so workers and the public stay safe.
Warning
Never test with oxygen. Never use a valve as the bulkhead between live gas and test medium unless a double block and bleed system is installed. Never put a valve under test pressure unless it, including its closing mechanism, is designed to take it.
Final piping inspection test on a threaded steel system carrying gas at 14 inches w.c. or less (UPC)
Tap Next to go through it.
Step 1
With the piping installed, any portions to be covered or concealed so concealed, and no fixture, appliance or shutoff valve yet attached, notify the AHJ that it is ready for the final piping inspection.
Step 2
Clear the pipe interior. Close every outlet gastight with a threaded plug or cap.
Step 3
Mount a test gauge that meets UPC Section 318.0. The permit holder supplies the test apparatus.
Step 4
Pressurize with air, nitrogen or carbon dioxide to at least 10 psi.
Step 5
Hold for at least 15 minutes, or longer if the AHJ requires, in the AHJ's presence. Watch the gauge.
Step 6
Treat any drop as a leak unless another cause clearly explains it.
Step 7
Find the leak with an approved gas detector or noncorrosive leak detection fluid on the joints.
Step 8
Repair or replace the leaking section, then retest.
What to take from it
A pass means the full pressure held for the full time, with the AHJ watching and every exposed joint in view.
Follow these steps when gas is first turned on:
- Confirm there are no open fittings or ends.
- Confirm every unused outlet valve is closed and plugged or capped.
- Leak-check the piping immediately. If leakage is indicated, shut off the gas supply until the necessary repairs have been made.
- Purge the piping.
- Leak-check the appliance connections.
- Once the piping system is in operation, purge the appliances and equipment.
Appliances go into operation only after all of these are done.
Frequently asked questions
Does adding a branch mean retesting the whole gas system?
No. Only the newly installed branch to the new appliance needs a pressure test. The joint between new and existing piping is checked with noncorrosive leak-detecting fluid or another approved method. Minor repairs and additions can skip the pressure test if the work is inspected and the connections are leak-checked the same way.
When does new gas piping have to be purged outdoors?
Purge to the outdoors when the design operating pressure is above 2 psig, or when the piping includes sections that meet the size and length table. That table starts at 2½ to under 3 inch pipe longer than 50 feet and covers 8 inch and larger at any length. Smaller, lower-pressure systems may instead discharge indoors through a burner with continuous ignition, or with a listed combustible gas detector monitoring the discharge point.
Where is gas piping not allowed inside a building?
The UPC bars gas piping from clothes chutes, chimneys and gas vents, dumbwaiters, elevator shafts and air ducts. Combustion air ducts are the exception, along with ventilation-air ducts permitted by the code.
How far must a gas outlet stick out of a wall or floor?
The unthreaded portion must extend at least 1 inch through finished ceilings and indoor or outdoor walls. It must stand at least 2 inches above floors, outdoor patios or slabs. These distances do not apply to listed flush-mounted quick-disconnect devices or listed gas convenience outlets. Outlets also cannot sit behind doors and need room for a wrench.
Can gas pipe run above a dropped ceiling?
Yes. The UPC permits gas piping in accessible spaces between a fixed ceiling and a dropped ceiling, whether or not the space is used as a plenum. The piping itself is allowed there. Valves follow the stricter rule covered under shutoff valves.
Disclaimer: The information provided in this educational content has been prepared with care to reflect current regulatory requirements for continuing education. However, licensing rules and regulations can vary by state and are subject to change. While we strive for accuracy, ExpertCE cannot guarantee that all details are complete or up to date at the time of reading. For the most current and authoritative information, always refer directly to your state’s official licensing board or regulatory agency.


