Code vs standard vs recommended practice: what is the difference?
A code is a standard written for adoption into law, a standard is a consensus document, and a recommended practice (RP) records industry practice. In the American Petroleum Institute (API) system none outranks the others. Each becomes mandatory only when a regulation, contract or jurisdiction adopts it, and US rules adopt dated editions.
By Jun Zhong, Editor·Researched and drafted by Beacon's AI newsroom·Checked by Jun Zhong, Editor·Last checked ·Next review
Why does it matter?
Writing a standard into a federal rule does not make every sentence binding. The Occupational Safety and Health Administration (OSHA) adopts only the mandatory provisions, those written with "shall" or similar wording, of the standards it incorporates by reference 5. The US liquid pipeline rule goes further for in-line inspection: operators must meet both the requirements and the recommendations of API Std 1163, ANSI/ASNT ILI-PQ and NACE SP0102 8. Whether a "should" binds you therefore depends on the rule or contract, not on the label on the cover. Federal agencies lean on these private documents by design: the National Technology Transfer and Advancement Act of 1995 tells agencies to use voluntary consensus standards wherever they can instead of writing government-unique ones, as the National Institute of Standards and Technology (NIST) explains 4.
Code vs standard vs recommended practice at a glance
| Code | Standard | Recommended practice (RP) | |
|---|---|---|---|
| What it is | API: a standard intended for adoption by regulators or other authorities having jurisdiction 1 | US federal policy uses "standard" broadly: terms, procedures, dimensions, materials, performance, test methods and more 3; in API's own scheme, a document mixing specification and RP features 1 | API: a document that describes recognized industry practice and may contain both mandatory and optional provisions 1 |
| Binding on its own? | No; it binds where a jurisdiction adopts it 9,11 | No; the American Society of Mechanical Engineers (ASME) calls standards voluntary until written into a contract or a regulation 2 | No; same routes as a standard 1,7 |
| Ranking in API's system | None: API states its labels form no hierarchy for compliance 1 | None 1 | None 1 |
| Oil and gas examples | ASME Boiler and Pressure Vessel Code; the B31 Code for Pressure Piping; API 510 and API 570 inspection codes 8,10 | API Spec 5L line pipe; API Std 650 and Std 653 for tanks; NACE SP0169 on external corrosion of buried piping 7,8,10 | API RP 571 damage mechanisms; RP 580 and RP 581 risk-based inspection; RP 1162 public awareness 7,10 |
| Labels used by other bodies | ASME uses "code" in the titles of its boiler and piping documents 8,11 | The Association for Materials Protection and Performance (AMPP) issues three classes of standard: standard practices (SP), test methods (TM) and material requirements (MR) 12 | AMPP's three classes include no RP; it also issues guides, which may recommend options, and technical reports 12 |
| Upkeep | Reviewed like any API standard: at least every 5 years 1 | Same; AMPP acts on each active standard that is not stabilized at least every 5 years 1,12 | Same as other API standards 1 |
Sources: API Procedures for Standards Development, 2025 1; ASME FAQ 2; OMB Circular A-119, 2016 3; eCFR 49 CFR 192 and 195 7,8; ASME history pages 9,11; API 2025 catalog 10; AMPP operating manual, 2024 12.
Across all three, the verb decides the obligation. In API documents "shall" marks a requirement, "should" a recommendation that is advised but not required, and "may" a permitted option 1.
When is a code used?
- Where a state or city regulates boilers and pressure vessels. Massachusetts passed a boiler inspection law in 1909 after shoe-factory boiler explosions in 1905 and 1906, and ASME issued the first edition of its Boiler and Pressure Vessel Code in 1914, published in 1915 11. In 1916 ASME formed a conference committee made up only of representatives of states and cities that had adopted or would adopt the code, and the National Board of Boiler and Pressure Vessel Inspectors was set up in 1919 to administer and enforce it uniformly 9.
- Where a federal rule names a code edition. OSHA's rules incorporate editions of ASME Section VIII from 1949 to 1968 for specific equipment 5; pipeline closures must comply with the 2007 edition of Section VIII, Division 1 8.
- For equipment already in service. API titles API 510 and API 570 as inspection codes 10, and federal rules send pressurized pipeline breakout tanks to API 510 8.
When is a standard used?
- To buy and build equipment. API specifications set equipment and material requirements in terms buyers and makers share 1; federal pipeline rules incorporate API Spec 5L, 46th edition (April 2018), for line pipe 7,8.
- To design and maintain tanks. Federal rules send breakout tanks built to API Std 650 to API Std 653 for repair and inspection 8.
- To set acceptance criteria. Cathodic protection on liquid pipelines must meet criteria in named paragraphs of NACE SP0169 8. AMPP describes its standard practices as text that can be written into a procurement document 12.
When is a recommended practice used?
- To design an integrity program. API's catalog lists RPs for damage mechanisms (RP 571), risk-based inspection (RP 580 and RP 581) and integrity operating windows (RP 584) 10.
- As good engineering practice under process safety rules. OSHA lets employers choose the recognized and generally accepted good engineering practice (RAGAGEP) they follow; it may be a code, a consensus or non-consensus document, or an internal standard, and OSHA names API 580 among the inspection examples 13.
- When a rule adopts it. Gas pipeline operators must follow the recommendations of API RP 1162 unless they justify an exception 7; tank-bottom cathodic protection is inspected to API RP 651 unless the operator records why it is not needed 8.
A common mix-up: an AMPP "standard practice" is a standard, while an API "recommended practice" is also a standard under API's procedures 1,12. Neither name says how binding the document is.
Where integrity problems show up
| Requirement | What it means for integrity records or work | In the Library |
|---|---|---|
| 29 CFR 1910.6(a)(1)(i) | Only the "shall" provisions of a standard OSHA incorporates become OSHA requirements; to enforce a different edition, OSHA must publish a Federal Register notice 5 | What is RAGAGEP? |
| 29 CFR 1910.119(d)(3)(i)(F) and (ii) | Process safety information must list the design codes and standards used, and the employer must document that equipment complies with RAGAGEP 6 | What is mechanical integrity (MI)? |
| 29 CFR 1910.119, Appendix C (nonmandatory) | OSHA expects the codes and standards relied on, from bodies such as ASME, API, the American National Standards Institute (ANSI), the National Fire Protection Association, ASTM, the National Board and NACE, to be documented, including which ones older equipment was built to 6 | What inspection records do codes require you to keep? |
| 49 CFR 192.616(c) | API RP 1162 recommendations become requirements unless the operator documents why they are not practicable and not needed for safety 7 | What are the PHMSA pipeline safety regulations? |
| 49 CFR 195.591 | In-line inspection must meet the requirements and the recommendations of the three named standards 8 | What is in-line inspection (ILI) and pigging? |
Sources: eCFR 29 CFR 1910.6 and 1910.119 5,6; eCFR 49 CFR 192 and 195 7,8.
Common questions
- Is ASME B31.3 a code or a standard?
- Both words apply. ASME develops its codes and standards through the same accredited consensus process, and calls them voluntary until a contract or regulation adopts them. Federal rules cite ASME B31.4 by its full title, which ends "ASME Code for Pressure Piping, B31". See [What is ASME B31.3 (process piping)?](/library/asme-b31-3/)
- Can a recommended practice be mandatory?
- Yes, when a rule or contract adopts it. Two federal pipeline examples are API RP 1162 for public awareness and API RP 651 for tank-bottom cathodic protection.
- Why do agencies use industry standards at all?
- US law tells federal agencies to use standards from voluntary consensus bodies instead of writing their own, where practical. The Office of Management and Budget's Circular A-119 defines such bodies by openness, balance, due process, an appeals process and consensus.
- Is RAGAGEP a code?
- No. RAGAGEP is a term in OSHA's process safety rule for the practices an employer chooses to follow, which can include codes, standards, RPs and internal standards. See [What is RAGAGEP (recognized and generally accepted good engineering practice)?](/library/ragagep/)
Beacon explains these concepts in its own words for education. It does not reproduce or replace the standards cited, and Winda is not affiliated with or endorsed by the organizations that publish them. Engineering decisions need the current edition of the standard and a qualified engineer.
Sources
- 1.Procedures for Standards Development (8th edition, August 2025 (ANSI approved August 2025)) · American Petroleum Institute (API)
- 2.Standards & Certification FAQ · American Society of Mechanical Engineers (ASME)
- 3.OMB Circular A-119: Federal Participation in the Development and Use of Voluntary Consensus Standards and in Conformity Assessment Activities (revised) · US Office of Management and Budget (OMB), hosted by NIST
- 4.Key Federal Law and Policy Documents: NTTAA & OMB A-119 · US National Institute of Standards and Technology (NIST)
- 5.29 CFR 1910.6, Incorporation by reference · eCFR, US Office of the Federal Register
- 6.29 CFR 1910.119, Process safety management of highly hazardous chemicals (including Appendix C) · eCFR, US Office of the Federal Register
- 7.49 CFR Part 192 (sections 192.7 and 192.616) · eCFR, US Office of the Federal Register
- 8.49 CFR Part 195 (sections 195.3, 195.124, 195.432, 195.571, 195.573, 195.591) · eCFR, US Office of the Federal Register
- 9.ASME Standards and Certification Chronology · American Society of Mechanical Engineers (ASME)
- 10.2025 Publications Catalog (titles and designations as listed in the 2025 catalog) · American Petroleum Institute (API)
- 11.History of ASME Standards · American Society of Mechanical Engineers (ASME)
- 12.AMPP Standards Committees Operating Manual · Association for Materials Protection and Performance (AMPP)
- 13.Process Safety Management for Petroleum Refineries: Lessons Learned from the Petroleum Refinery Process Safety Management National Emphasis Program (OSHA 3918) · US Occupational Safety and Health Administration (OSHA)