All guides
Home / Guides / X12 vs EDIFACT

X12 vs EDIFACT: A Detailed Comparison

EdiPeek · Updated June 2026 · 8 min read

There is no single global EDI standard. Two dominate the world, and which one you encounter depends mostly on geography. ANSI X12 rules North America. UN/EDIFACT rules Europe and most of the rest of the world. They do the same job - moving orders, invoices, shipping notices, and payments between companies - but they look quite different on the wire, and understanding both is valuable for anyone working in global trade.

The quick comparison

ANSI X12UN/EDIFACT
RegionNorth AmericaInternational (Europe, Asia, global)
NamingNumbers (850, 810, 856)Names (ORDERS, INVOIC, DESADV)
Governing bodyASC X12UN/CEFACT
Element separator*+
Segment terminator~'
Component separator::
EnvelopeISA / GS / STUNB / UNG / UNH

Syntax differences

The most immediately visible difference is the delimiters - the characters that separate the pieces of the file.

X12 syntax

ST*850*0001~
BEG*00*SA*PO-99831**20240115~

Segments end with a tilde ~, elements are separated by an asterisk *, and sub-elements (components) by a colon :. The delimiters are declared implicitly by their position in the opening ISA segment, which is fixed-width.

EDIFACT syntax

UNH+1+ORDERS:D:96A:UN'
BGM+220+PO-55012+9'

Segments end with an apostrophe ', elements with a plus +, and components with a colon :. EDIFACT can also use an optional UNA service string at the very start of the interchange to explicitly declare its delimiters, and it supports a release (escape) character - by default ? - so that a delimiter character can appear literally inside a data value.

That release character is a subtle but important difference. In EDIFACT, ?+ means a literal plus sign rather than an element separator. X12 has no equivalent escape mechanism, which is one reason X12 data tends to avoid the delimiter characters entirely.

Ad slot - insert AdSense unit here

Structure and envelope differences

Both standards wrap their content in nested envelopes, but the envelope segments are named and built differently.

X12 uses a three-level envelope: ISA/IEA for the interchange, GS/GE for the functional group, and ST/SE for each transaction set. The ISA is a fixed-length, 106-character segment, which makes it unusually rigid compared to the rest of X12.

EDIFACT uses UNB/UNZ for the interchange, an optional UNG/UNE for the functional group, and UNH/UNT for each message. EDIFACT envelopes are variable length and rely on delimiters rather than fixed positions.

In both standards, the innermost header - ST in X12, UNH in EDIFACT - is what tells you which document type you are looking at. In EDIFACT the UNH also carries the message version, like D:96A:UN, which identifies the directory, release, and controlling agency so the receiver knows which dictionary of segments to apply.

How transactions map between the two

The same business document exists in both standards under different labels. If you know one, you can usually find its counterpart:

X12EDIFACTDocument
850ORDERSPurchase order
855ORDRSPOrder response / acknowledgment
860ORDCHGPurchase order change
856DESADVAdvance ship notice / despatch advice
810INVOICInvoice
820REMADVPayment / remittance advice
846INVRPTInventory report
832PRICATPrice / sales catalogue
997CONTRLFunctional acknowledgment

The mapping is rarely perfect - the standards model some details differently - but at the document level the correspondence is reliable.

Which one will you deal with?

If you trade primarily with United States or Canadian partners, you will mostly see X12. If you trade with European, Middle Eastern, or Asian partners, expect EDIFACT. Many companies that operate internationally have to support both, and EDI translation software often converts between them so internal systems only deal with one format.

There are also industry-specific subsets. Automotive uses EDIFACT subsets like ODETTE and VDA in Europe. Retail uses both. Healthcare in the United States is almost entirely X12, mandated by HIPAA. Knowing the industry usually tells you the standard.

Practical tips for reading either one

Try both

EdiPeek reads both standards. Paste an X12 or an EDIFACT message and get a plain-English breakdown, in your browser, with nothing uploaded.

X12 viewer   EDIFACT viewer

Frequently asked questions

Is one standard better than the other?
Neither is objectively better; they are regional conventions. X12 is more rigid in its envelope, EDIFACT is more flexible with delimiters and escaping. The right one is whichever your trading partner uses.
Can I convert X12 to EDIFACT?
Yes. EDI translation software maps one to the other. Because the underlying business documents are the same, an 850 can be converted to an ORDERS, though implementation-specific details require careful mapping.
Why does EDIFACT put a version in the UNH?
Because EDIFACT messages evolve through directory releases (like D96A or D01B). The version tells the receiver which dictionary of segments and codes to use when interpreting the message.
What is the UNA segment?
An optional service string at the start of an EDIFACT interchange that declares the delimiter characters explicitly, in case they differ from the defaults.