X12 vs EDIFACT: Formats, Delimiters and Use Cases Compared
If you work with EDI for more than a few weeks, you'll eventually run into both major standards. They solve the same problem — machine-readable business documents exchanged between trading partners — but their syntax, terminology, and typical geography are different enough that mixing them up causes real confusion. This guide walks through every meaningful difference.
Two Standards, One Goal
Both ANSI X12 and UN/EDIFACT exist to let one company's system hand a purchase order, invoice, shipping notice, or healthcare claim to another company's system without a human retyping anything. Both organize a document as an "envelope" (who sent it, who it's for, what delimiters are used) wrapping one or more structured documents, each built from a sequence of labeled, delimiter-separated segments. The high-level idea is identical. The details are not.
Origin and Governance
ANSI X12 is developed and maintained by the Accredited Standards Committee (ASC) X12, chartered by the American National Standards Institute in the United States, with its first published standards dating to 1979. It's a domestic-first standard that became the default for North American retail, healthcare (mandated under HIPAA for claims transactions), logistics, and manufacturing.
UN/EDIFACT (United Nations rules for Electronic Data Interchange for Administration, Commerce and Transport) was developed under the UN's auspices starting in the early 1980s specifically to provide a single international standard usable across borders and industries, avoiding a proliferation of incompatible national standards. It's the default across most of Europe, much of Asia, and international ocean/air freight, and is frequently mandated for customs and cross-border trade documentation.
Delimiter Syntax Compared
Both standards use delimiter characters rather than fixed field widths, but they declare and typically use those delimiters differently.
- X12 declares its delimiters positionally inside the very first segment,
ISA. The element separator is the single character immediately after the literal text "ISA", and the segment terminator is the character immediately following the 106th character of that line. A sub-element (component) separator is declared inside the ISA's 16th data element. Common choices are*for elements,~for segments, and:for sub-elements — but any character can legally be used, so a parser has to read the ISA segment itself rather than assume. - EDIFACT optionally declares its delimiters in an explicit six-character
UNAservice string advice segment at the very start of the interchange, in the fixed order: component data element separator, data element separator, decimal notation character, release (escape) character, a reserved placeholder, and segment terminator. A typical UNA readsUNA:+.? '. If the UNA segment is absent, EDIFACT falls back to its documented defaults::component,+element,'segment terminator.
For a deeper breakdown of exactly how each delimiter type works and how to spot them manually, see EDI Delimiters Explained.
Envelope Structure Side-by-Side
Both standards nest an interchange, an optional functional/message group, and one or more individual documents — but the segment names used for each level differ entirely.
| Envelope Level | ANSI X12 | UN/EDIFACT |
|---|---|---|
| Interchange (open/close) | ISA / IEA | UNB / UNZ |
| Functional / message group (optional) | GS / GE | UNG / UNE |
| Individual document | ST / SE | UNH / UNT |
Naming: Transaction Sets vs. Messages
X12 calls its individual documents transaction sets and identifies them with a three-digit number — 850 (Purchase Order), 810 (Invoice), 856 (Advance Ship Notice), 837 (Healthcare Claim), 835 (Remittance Advice), 834 (Benefit Enrollment), and dozens more. EDIFACT calls its documents messages and identifies them with a short alphabetic code — ORDERS (Purchase Order), INVOIC (Invoice), DESADV (Despatch/Dispatch Advice), and so on. There's a rough one-to-one conceptual mapping between many X12 transaction sets and EDIFACT messages, but the segment-level content and codes inside them are not interchangeable.
Geographic and Industry Adoption
In practice, which standard lands in your inbox depends far more on your trading partner's location and industry than on any technical merit. North American healthcare, big-box retail, and domestic trucking/logistics overwhelmingly use X12. European manufacturing, automotive, retail, and virtually all international ocean and air freight overwhelmingly use EDIFACT, and many countries' customs authorities require EDIFACT-formatted declarations for cross-border shipments. Multinational companies frequently run both simultaneously — X12 for US-domestic partners, EDIFACT for European or Asian ones — often through the same translation software or the same universal viewer.
Which One Will You Receive?
You don't need to guess — the file tells you. Open it and look at the very first few characters. If the file starts with the literal text ISA, it's X12. If it starts with UNA or UNB, it's EDIFACT. That single check is enough to know which set of segment definitions applies to everything that follows.
How This Converter Handles Both
Rather than making you pick a standard up front, the free converter inspects the first few characters of your file automatically, detects whether it's X12 or EDIFACT, extracts the correct delimiters from the ISA or UNA/UNB segment, and labels every segment using the matching definition set — all in your browser, with nothing uploaded. Try it directly on the X12 EDI Viewer or the EDIFACT Viewer, or just drop any file into the main converter and let it detect the standard for you.
Try It Yourself
Drop an X12 or EDIFACT file into the free converter — the standard, delimiters, and every segment are detected and labeled automatically, with export to CSV, Excel, or JSON.
Open the Free EDI ConverterFrequently Asked Questions
Can a company use both X12 and EDIFACT?
Yes, this is extremely common for multinational companies — X12 with domestic North American partners, EDIFACT with European or Asian partners, often processed through the same translation platform or universal viewer.
Is one standard technically better than the other?
Not meaningfully — both reliably handle the same class of problem. Which one you use is determined almost entirely by your trading partners' industry and geography, not technical superiority.
Do X12 and EDIFACT segment codes ever overlap or mean the same thing?
A few short segment tags coincidentally look similar, but the two standards maintain entirely separate segment and code-value dictionaries. A segment tag from one standard should never be interpreted using the other's definitions.
Can this tool auto-detect which standard a file uses?
Yes — it checks the opening characters of the file (ISA for X12, UNA/UNB for EDIFACT) and automatically applies the correct delimiter extraction and segment labeling.