# ASME B31.3 vs B31.4 vs B31.8: which piping code applies?

> ASME B31.3 covers piping inside process plants and terminals; B31.4 covers liquid pipelines; B31.8 covers piping that transmits and distributes gas. All three come from the American Society of Mechanical Engineers (ASME). In the US, pipelines must also meet federal rules: 49 CFR 195 for liquids and 49 CFR 192 for gas.

- Label: Fact
- Type: Explainer
- Published: 2026-11-13T15:18:43+09:00
- By: Jun Zhong
- Researched and drafted by: Beacon's AI newsroom
- Checked by: Jun Zhong on 2026-11-13
- Topics: LNG, Pipelines, Refining, Upstream and offshore
- Canonical: https://beacon.winda.ai/library/asme-b31-3-vs-b31-4-vs-b31-8/

## Why does it matter?

ASME B31.8 is not the design rule for US gas pipelines: 49 CFR 192 sets its own design formula and incorporates B31.8 for only three sections [4][5]. The liquid rule works the same way, with its own formula in 49 CFR 195.106 and B31.4 incorporated only for expansion and flexibility [9][10]. In-plant piping at refineries and similar facilities sits outside the federal liquid pipeline rule, and the Occupational Safety and Health Administration (OSHA) treats B31.3 as good engineering practice for covered processes [8][13]. Which document governs a line decides its design pressure basis, its pressure test, its maximum operating pressure and its inspection regime for life.

## B31.3 vs B31.4 vs B31.8 at a glance

| | B31.3 | B31.4 | B31.8 |
|---|---|---|---|
| Full title | Process Piping | Pipeline Transportation Systems for Liquids and Slurries | Gas Transmission and Distribution Piping Systems |
| Current ASME edition | 2024 | 2025 | 2025 |
| Where it applies | Refineries, chemical, hydrogen, cryogenic and related plants and terminals | Liquid pipelines between fields, tank farms, gas plants, refineries, pump stations and terminals, plus piping inside those stations | Gas transmission, gathering and distribution lines, compressor, metering and regulating stations, mains and service lines to the customer meter |
| Fluids | Any fluid, including chemicals, hydrocarbons, steam, water and cryogenic liquids | Liquid petroleum, anhydrous ammonia, carbon dioxide, liquid alcohol and slurries | Gas |
| Lifecycle covered | Construction only | Design through operation and maintenance | Construction, plus operator topics such as personnel qualification and damage prevention |
| US federal rule for the asset | None for in-plant piping; OSHA process safety rule cites B31.3 as good practice | 49 CFR 195 | 49 CFR 192 |
| Edition incorporated by the federal rule | Not applicable | B31.4-2019, for expansion and flexibility only (195.110(a)) | B31.8-2018, for 192.112(b), 192.619(a) and 192.911(m) only |
| Pressure design in US practice | Allowable stresses listed in the code | P = (2St/D) × E × F, 49 CFR 195.106 | P = (2St/D) × F × E × T, 49 CFR 192.105 |
| Test before service | Pressure test under the code | At least 125% of maximum operating pressure for 4 hours (195.304) | Strength test for at least 8 hours for lines at 30% or more of specified minimum yield strength (192.505) |
| In-service inspection | API 570 (5th edition, 2024) or other in-service code | 49 CFR 195, including integrity management in high consequence areas (195.452) | 49 CFR 192, including Subpart O integrity management, which incorporates ASME B31.8S |

Sources: ASME product pages [1][2][3]; 49 CFR 192.7, 192.105, 192.505 [4][5][7]; 49 CFR 195.1, 195.3, 195.106, 195.110, 195.304 [8][9][10][11]; US Department of Energy (DOE) PRE-L-02, 2024 [12]; OSHA, 2016 [13]; API 2025 catalog [14]. Federal formula symbols: P design pressure, S yield strength, t wall thickness, D outside diameter, F design factor, E joint factor, T temperature factor.

## When is B31.3 used?

- For piping inside refineries, chemical and hydrogen plants, cryogenic facilities and related terminals, carrying any process or utility fluid [1].
- For piping that links the stages of packaged equipment [1].
- For new construction only; a 2024 DOE review notes it has no rules for periodic inspection, fitness-for-service or repair [12].
- In US processes covered by OSHA's process safety management standard, as an example of recognized and generally accepted good engineering practice (RAGAGEP) [13].

## When is B31.4 used?

- For pipelines moving liquid petroleum, anhydrous ammonia, carbon dioxide or liquid alcohol between production fields, tank farms, gas plants, refineries, pump stations and terminals [2].
- For piping inside the pump stations, tank farms and terminals of such a system, and for liquid petroleum piping on land set aside for it within refineries and gas plants [2].
- For slurry pipelines carrying nonhazardous solids such as coal or mineral ores [2].
- In the US, alongside 49 CFR 195, which covers hazardous liquid and carbon dioxide pipelines and incorporates B31.4-2019 only for expansion and flexibility [8][9][10].

## When is B31.8 used?

- For gas transmission and gathering pipelines, including offshore lines carrying gas from production facilities to shore [3].
- For compressor, metering and regulating stations, distribution mains and service lines up to the customer's meter set, and pipe-type gas storage [3].
- In the US, alongside 49 CFR 192, which incorporates B31.8-2018 for three sections; one of them, 192.619(a), uses a B31.8 appendix to test converted or uprated pipe to yield when design data are unknown [4][7].

## Where does one code end and the next begin?

The federal liquid rule excludes in-plant piping at production, refining and manufacturing facilities, and short low-stress lines serving refineries or terminals that run less than 1 mile outside facility grounds and cross neither offshore areas nor waterways used for commercial navigation [8]. B31.4's scope, by contrast, reaches into land set aside for pipeline piping inside refineries and gas plants [2]. So one refinery can hold both B31.3 and B31.4 piping, and the code named for each line decides the formula, test and inspection rules that apply to it [2][8].

Not every pipe is a pipeline in law: the federal liquid rule leaves in-plant piping out of its scope [8]. See [Piping vs pipeline: what is the difference?](/library/piping-vs-pipeline/) for how the two are defined.

## Where integrity problems show up

| Decision or step at this stage | What it affects later | In the Library |
|---|---|---|
| Class location and design factor chosen for a gas line | If nearby building counts rise, the maximum allowable operating pressure (MAOP) must be confirmed or revised, which can mean a lower pressure or a new test [5][6] | [Class location](/glossary/class-location/), [Maximum allowable operating pressure](/glossary/maximum-allowable-operating-pressure/) |
| Pressure test after construction | Sets one of the ceilings on MAOP for gas lines and on maximum operating pressure for liquid lines [7][11] | What is a hydrostatic test? |
| Records of pipe grade, wall and seam type | If yield strength is unknown and untested, federal rules fall back to 24,000 pounds per square inch (psi); under the gas rule an unknown seam type is limited to the joint factor for "other" pipe [5][10] | [What is material traceability?](/library/material-traceability/), Specified minimum yield strength (SMYS) |
| Wall thickness and grade fixed at design | Later corrosion is assessed with remaining-strength methods that federal rules incorporate, ASME B31G and RSTRENG [4][9] | [ASME B31G vs RSTRENG: how is corroded pipe assessed?](/library/b31g-vs-rstreng/) |
| Code chosen for each segment | Plant piping is inspected under API 570 within OSHA process safety rules; pipelines fall under federal integrity management [4][13][14] | [API 510 vs API 570 vs API 653: which code covers which equipment?](/library/api-510-vs-api-570-vs-api-653/), [What is pipeline integrity management?](/library/pipeline-integrity-management/) |

Sources: eCFR, 49 CFR 192.5, 192.7, 192.107, 192.113, 192.611, 192.619 [4][5][6][7]; 49 CFR 195.3, 195.106, 195.406 [9][10][11]; OSHA, 2016 [13]; API 2025 catalog [14].

## Sources

1. [B31.3, Process Piping (product page) (2024), American Society of Mechanical Engineers (ASME)](https://www.asme.org/codes-standards/find-codes-standards/b31-3-process-piping)
2. [B31.4, Pipeline Transportation Systems for Liquids and Slurries (product page) (2025), American Society of Mechanical Engineers (ASME)](https://www.asme.org/codes-standards/find-codes-standards/b31-4-pipeline-transportation-systems-liquids-slurries)
3. [B31.8, Gas Transmission and Distribution Piping Systems (product page) (2025), American Society of Mechanical Engineers (ASME)](https://www.asme.org/codes-standards/find-codes-standards/b31-8-gas-transmission-distribution-piping-systems)
4. [49 CFR 192.7, What documents are incorporated by reference partly or wholly in this part?, eCFR, US Office of the Federal Register](https://www.ecfr.gov/current/title-49/subtitle-B/chapter-I/subchapter-D/part-192/subpart-A/section-192.7)
5. [49 CFR 192.105 to 192.115, Design formula for steel pipe and its factors, eCFR, US Office of the Federal Register](https://www.ecfr.gov/current/title-49/subtitle-B/chapter-I/subchapter-D/part-192/subpart-C)
6. [49 CFR 192.5, Class locations, and 192.611, Change in class location, eCFR, US Office of the Federal Register](https://www.ecfr.gov/current/title-49/subtitle-B/chapter-I/subchapter-D/part-192)
7. [49 CFR 192.505, Strength test requirements, and 192.619, Maximum allowable operating pressure, eCFR, US Office of the Federal Register](https://www.ecfr.gov/current/title-49/subtitle-B/chapter-I/subchapter-D/part-192)
8. [49 CFR 195.1, Which pipelines are covered by this Part?, eCFR, US Office of the Federal Register](https://www.ecfr.gov/current/title-49/subtitle-B/chapter-I/subchapter-D/part-195/subpart-A/section-195.1)
9. [49 CFR 195.3, What documents are incorporated by reference partly or wholly in this part?, eCFR, US Office of the Federal Register](https://www.ecfr.gov/current/title-49/subtitle-B/chapter-I/subchapter-D/part-195/subpart-A/section-195.3)
10. [49 CFR 195.106, Internal design pressure, and 195.110, External loads, eCFR, US Office of the Federal Register](https://www.ecfr.gov/current/title-49/subtitle-B/chapter-I/subchapter-D/part-195/subpart-C)
11. [49 CFR 195.304, Test pressure, and 195.406, Maximum operating pressure, eCFR, US Office of the Federal Register](https://www.ecfr.gov/current/title-49/subtitle-B/chapter-I/subchapter-D/part-195)
12. [PRE-L-02, Assessment of Safety Equivalency: EN 13480 and ASME B31.3, Process Piping (G. Antaki), US Department of Energy (DOE)](https://www.energy.gov/sites/default/files/2024-08/Report%20-%20EN%2013480,%20ASME%20B31%20Comparison%20-%2021%20A.pdf), 2024-08-12
13. [RAGAGEP in Process Safety Management Enforcement (memorandum), US Occupational Safety and Health Administration (OSHA)](https://www.osha.gov/laws-regs/standardinterpretations/2016-05-11), 2016-05-11
14. [2025 Publications Catalog (entry for API 570, Piping Inspection Code) (API 570, 5th edition, February 2024), American Petroleum Institute (API)](https://www.api.org/-/media/files/publications/2025-catalog/2025_pubs%20catalog.pdf)

Published by Winda Beacon (https://beacon.winda.ai).
