X12 and EDIFACT do the same job with different grammar. A purchase order is a purchase order whether it arrives as an X12 850 or an EDIFACT ORDERS message. What changes is the envelope around it, the separators between fields, how versions are named, which acknowledgment comes back and which part of the world your trading partner sits in.
If you sell to US retailers, you will almost certainly trade X12. The moment you add a European retailer, a UK grocer, an ocean carrier or a global automotive customer, EDIFACT shows up. This guide puts the two side by side: a comparison table, an envelope map, a document crosswalk that links to our guide for each set and message, and one order written in both syntaxes so you can see the difference line by line.
What Is the Difference Between X12 and EDIFACT?
X12 is the EDI standard developed by the Accredited Standards Committee X12, which has been accredited by the American National Standards Institute (ANSI) since 1979. That is why you still hear "ANSI X12". Documents are called transaction sets and are named with three digits: 850, 856, 810, 997. X12 publishes the full list of transaction sets, grouped into releases such as 004010 and 005010.
UN/EDIFACT (United Nations rules for Electronic Data Interchange for Administration, Commerce and Transport) is maintained by UN/CEFACT, part of the United Nations Economic Commission for Europe (UNECE). Its syntax is the international standard ISO 9735. Documents are called messages and are named with six capital letters: ORDERS, DESADV, INVOIC, CONTRL. The messages are published in the UN Trade Data Interchange Directory (UNTDID), one directory per release such as D.96A or D.01B.
Both are delimited text formats: a file is a sequence of segments, each segment is a tag followed by data elements, and an envelope wraps the documents so the receiver knows who sent them and how many to expect. If you can read one, you can learn the other in an afternoon. The differences that cause real problems are covered below.
X12 vs EDIFACT at a Glance
| X12 | EDIFACT | |
|---|---|---|
| Maintained by | ASC X12 (ANSI accredited) | UN/CEFACT, under UNECE |
| Syntax standard | X12.5 and X12.6 control structures | ISO 9735 |
| Main regions | United States, Canada, Mexico | Europe, UK, Asia, Middle East, Latin America, global shipping and customs |
| Document name | Transaction set, three digits (850) | Message, six letters (ORDERS) |
| Version naming | Version/release: 004010, 005010, 008010 | Directory: D.96A, D.01B, D.21A |
| Industry subsets | VICS and UCS (retail and grocery), HIPAA (healthcare), AIAG (automotive) | EANCOM (retail, GS1), ODETTE (European automotive), EDIFICE (electronics), IATA (air cargo) |
| Interchange envelope | ISA / IEA | UNB / UNZ (UNA optional in front) |
| Group envelope | GS / GE, mandatory | UNG / UNE, optional and rarely used |
| Document envelope | ST / SE | UNH / UNT |
| Typical separators | * element, > or : component, ~ segment, ^ repetition | + element, : component, ' segment |
| Where separators are set | Fixed positions inside the ISA segment | UNA service string advice, or defaults |
| Release (escape) character | None, so data cannot contain a separator | ? by default, so O?'BRIEN is legal |
| Character set | Basic and extended sets defined by the standard, not declared | Declared in UNB, e.g. UNOA, UNOB, UNOC |
| Segment style | Purpose-built segments: BEG, PO1, N1 | Generic segments with qualifiers: BGM, LIN, NAD+BY |
| Syntax acknowledgment | 997, or 999 in HIPAA and newer releases | CONTRL |
| Interchange acknowledgment | TA1 | CONTRL at interchange level |
| Business-level error report | 824 Application Advice | APERAK |
| Party identifiers in retail | Partner codes, DUNS, increasingly GLN | GLN (via EANCOM) |
The short version: X12 is more compact and more tightly defined per document, while EDIFACT is more generic and leans on qualifiers. An X12 PO1 line packs quantity, unit, price and product IDs into one segment. EDIFACT spreads the same line across LIN, PIA, QTY and PRI, which makes EDIFACT files longer but makes each segment reusable across many message types.
Envelopes Compared
Both standards nest documents inside envelopes. The levels map cleanly:
| Level | X12 | EDIFACT |
|---|---|---|
| Separator definition | Inside ISA (characters 4, 83, 105 and 106 of the segment) | UNA (optional) |
| Interchange header | ISA | UNB |
| Functional group header | GS (mandatory) | UNG (optional) |
| Document header | ST | UNH |
| Document trailer | SE | UNT |
| Functional group trailer | GE | UNE |
| Interchange trailer | IEA | UNZ |
Two differences catch people out. First, the X12 ISA is fixed width: every element is padded to an exact length and the segment is always 106 characters including its terminator. EDIFACT's UNB is variable length like every other segment. Second, X12 requires the GS functional group, and the GS08 version code tells the receiver which release to validate against. EDIFACT puts the version inside each UNH instead (ORDERS:D:96A:UN:EAN008), so one interchange can mix directory versions.
Our ISA, GS and ST envelope guide walks through every ISA element, and the EDIFACT explainer covers UNA, UNB and UNH in the same depth.
X12 to EDIFACT Crosswalk: Which Document Is Which
The crosswalk below matches each common X12 transaction set to its EDIFACT counterpart. The match is at document level. Field-level mapping is never one-to-one, and partners using EANCOM often require data, such as GLNs on every party, that a typical US X12 spec does not.
| Business purpose | X12 | EDIFACT |
|---|---|---|
| Purchase order | 850 Purchase Order | ORDERS |
| Order acknowledgment | 855 PO Acknowledgment | ORDRSP |
| Order change from the buyer | 860 PO Change | ORDCHG |
| Ship notice / despatch advice | 856 Ship Notice | DESADV |
| Receiving advice | 861 Receiving Advice | RECADV |
| Invoice and credit note | 810 Invoice | INVOIC |
| Remittance advice | 820 Payment Order/Remittance Advice | REMADV |
| Inventory report | 846 Inventory Inquiry/Advice | INVRPT |
| Sales report | 852 Product Activity Data | SLSRPT |
| Price and product catalog | 832 Price/Sales Catalog | PRICAT |
| Party master data | 816 Organizational Relationships | PARTIN |
| Forecast / planning schedule | 830 Planning Schedule | DELFOR |
| Just-in-time delivery schedule | 862 Shipping Schedule | DELJIT |
| Transport instruction / load tender | 204 Motor Carrier Load Tender | IFTMIN |
| Shipment status | 214 Shipment Status | IFTSTA |
| Syntax acknowledgment | 997 Functional Acknowledgment | CONTRL |
| Application error report | 824 Application Advice | APERAK |
A few pairs need a caveat:
- 204 and IFTMIN. A 204 is a carrier load tender, and the carrier answers with a 990. IFTMIN is a broader transport instruction; bookings in ocean freight usually go through IFTMBF and IFTMBC instead.
- 810 and INVOIC. EDIFACT uses the same INVOIC message for invoices and credit notes (
BGM+380vsBGM+381). In X12 a credit is either an 810 with a credit indicator or a separate 812 Credit/Debit Adjustment. - 997 and CONTRL. Both report syntax results, but CONTRL can acknowledge a whole interchange, a group or a single message, which X12 splits between the TA1 and the 997.
- 860 and ORDCHG. The supplier reply is an 865 in X12 and usually an ORDRSP in EDIFACT.
For the full list of EDIFACT messages, see every EDIFACT message type. For the X12 side, the EDI document types reference lists every transaction set we cover.
One Order in Both Syntaxes
Here is the same purchase order: a retailer orders 48 cases of one item for delivery to its distribution center on December 10.
The X12 850
ISA*00* *00* *ZZ*5012345000008 *ZZ*5098765000002 *261202*0930*^*00501*000004127*0*P*>~
GS*PO*5012345000008*5098765000002*20261202*0930*4127*X*005010~
ST*850*0001~
BEG*00*SA*PO-771204**20261202~
DTM*002*20261210~
N1*BY*BIGBOX RETAIL*UL*5012345000008~
N1*ST*BIGBOX DC 6094*UL*5012345060941~
PO1*1*48*CA*21.50**UP*012345678905~
CTT*1~
SE*8*0001~
GE*1*4127~
IEA*1*000004127~
The EDIFACT ORDERS (EANCOM D.96A)
UNA:+.? '
UNB+UNOC:3+5012345000008:14+5098765000002:14+261202:0930+4127'
UNH+1+ORDERS:D:96A:UN:EAN008'
BGM+220+PO-771204+9'
DTM+137:20261202:102'
DTM+2:20261210:102'
NAD+BY+5012345000008::9'
NAD+ST+5012345060941::9'
LIN+1++00012345678905:SRV'
QTY+21:48'
PRI+AAA:21.50'
UNS+S'
CNT+2:1'
UNT+12+1'
UNZ+1+4127'
Reading them side by side
| Data | X12 | EDIFACT |
|---|---|---|
| Separators | Set by ISA: *, >, ~, ^ | Set by UNA: :, +, ., ?, ' |
| Sender and receiver | ISA06 / ISA08, here with qualifier ZZ (mutually defined) | UNB with qualifier 14 (GS1 GLN) |
| Version | ISA12 00501, GS08 005010 | UNH D:96A:UN:EAN008 |
| Document type and number | BEG*00*SA*PO-771204 (original, stand-alone order) | BGM+220+PO-771204+9 (order, original) |
| Order date | BEG05 | DTM+137 with format 102 (CCYYMMDD) |
| Delivery date | DTM*002 | DTM+2 |
| Buyer and ship-to | N1*BY, N1*ST with UL (GLN) | NAD+BY, NAD+ST with code list 9 (GS1) |
| Line | One PO1 with quantity, unit, price and UPC | LIN (GTIN), QTY+21 (ordered quantity), PRI+AAA (net price) |
| Line count | CTT*1 | CNT+2:1 |
| Document trailer | SE*8*0001 counts 8 segments, ST to SE | UNT+12+1 counts 12 segments, UNH to UNT |
The X12 file has 8 segments inside its transaction set; the EDIFACT message has 12. That ratio is typical. Note also that EDIFACT has an explicit section separator (UNS+S) between detail and summary, while X12 relies on the position of CTT.
Paste the X12 version into the free EDI Inspector and the EDIFACT version into the free EDIFACT inspector to see each segment explained.
Which Standard Should You Use?
You rarely get to choose. The standard is set by the trading partner who sends the first document, usually the buyer. In practice:
- US and Canadian retail, grocery, distribution and 3PLs: X12, typically 004010 or 005010 with the retailer's own implementation guide.
- US healthcare: X12 only. HIPAA mandates the 005010 versions of the 837, 835, 270/271 and the rest.
- European and UK retail: EDIFACT, almost always the EANCOM subset, with some UK grocers still on TRADACOMS.
- European automotive: EDIFACT under ODETTE, or the German VDA formats, with DELFOR and DELJIT driving production schedules.
- Ocean shipping, ports and customs worldwide: EDIFACT (IFTMIN, IFTSTA, BAPLIE, COPARN, CUSCAR), even for US-based carriers' global networks.
- A multinational buyer: often both, with X12 for its US operation and EDIFACT for Europe.
If you are setting up your first partner, follow their implementation guide exactly and ignore the standard you would have preferred. If you are choosing for a new network you control, pick the one your largest partners already use.
Can One EDI System Handle Both?
Yes. Any modern EDI translator or integration platform reads both, because the core work is identical: parse the envelope, split documents, validate against a spec and map fields to your ERP. The extra work for EDIFACT is mostly reference data: GLN-based party lookups, the release character, character-set handling for accented names and a separate CONTRL or APERAK response path.
Where companies get stuck is maintaining two separate maps per document, one for the 850 and one for ORDERS, each feeding the ERP differently. The cleaner pattern is to translate both into one internal order model, validate once, and generate the outbound document (855 or ORDRSP, 856 or DESADV, 810 or INVOIC) from that model per partner.
Common Mistakes When Trading Both
- Assuming ORDERS maps field for field to the 850. Qualifiers matter:
DTM+2is the delivery date,DTM+137is the document date, andDTM+64/DTM+63are earliest and latest delivery. - Ignoring the release character. An EDIFACT name like
O?'BRIENis valid. A parser that splits on'without checking for?will break the segment. - Hard-coding X12 separators. Separators are whatever the ISA declares.
*and~are common, not guaranteed. - Sending a 997 where a CONTRL is expected (or the reverse). Acknowledgments follow the standard of the document being acknowledged.
- Treating UNG as mandatory. Most EDIFACT interchanges go straight from UNB to UNH. Do not reject a file because UNG is missing.
- Date formats. X12 dates are fixed per element (CCYYMMDD in GS04 and most DTM segments, YYMMDD in ISA09). EDIFACT dates carry a format code, so
DTM+137:2612020930:203is a valid date and time.
Where OrderSync Fits
OrderSync reads X12, EDIFACT (including EANCOM) and TRADACOMS orders through the same pipeline as PDF, email and spreadsheet orders. Each order is matched to your customers, items, units and prices, exceptions are flagged for review, and clean orders go to your ERP. Outbound acknowledgments, ship notices and invoices are generated in the standard each partner expects, so a US retailer gets an 855 and a European one gets an ORDRSP from the same order record.
Frequently Asked Questions
What is the difference between X12 and EDIFACT?
X12 is the North American EDI standard maintained by ASC X12, with numbered transaction sets like the 850 and an ISA/GS/ST envelope. EDIFACT is the international standard maintained by UN/CEFACT, with six-letter messages like ORDERS and a UNB/UNH envelope. They cover the same business documents with different syntax, separators, versioning and acknowledgments.
Is EDIFACT used in the US?
Yes, but mostly outside domestic retail. US companies meet EDIFACT when they trade with European or Asian customers, with ocean carriers and ports, with global automotive manufacturers, or with the international divisions of multinational retailers. Domestic US retail, grocery, 3PL and healthcare EDI runs on X12.
Which is better, X12 or EDIFACT?
Neither is better in general. X12 files are more compact and each transaction set is tightly defined; EDIFACT is more flexible, handles international character sets and is the global default outside North America. The right one is the one your trading partner requires.
What is the EDIFACT equivalent of the EDI 850?
The EDIFACT ORDERS message. The 855 maps to ORDRSP, the 856 to DESADV, the 810 to INVOIC and the 997 to CONTRL. The crosswalk table above lists the rest.
What does ANSI X12 mean?
ANSI X12 is the older name for the X12 standard. ASC X12 is accredited by the American National Standards Institute, so people often say "ANSI X12" or "ANSI EDI". It is the same standard.
What is EANCOM, and is it different from EDIFACT?
EANCOM is a GS1 subset of EDIFACT for retail and consumer goods. It uses EDIFACT syntax and messages but restricts which segments and codes you may use, and requires GLNs for parties and GTINs for items. An EANCOM file is a valid EDIFACT file.
Can I convert X12 to EDIFACT?
Yes, with a map per document pair (850 to ORDERS, for example). Because EDIFACT messages often require data that X12 files leave out, such as GLNs for every party, conversion usually needs a lookup table as well as a field map.
Are X12 and EDIFACT acknowledgments the same?
No. X12 uses the TA1 for the interchange, the 997 or 999 for syntax and the 824 for business errors. EDIFACT uses CONTRL for syntax at any level and APERAK for application errors.
Related Guides
- EDIFACT explained: format, envelope and X12 mapping
- EDI ISA segment and the X12 envelope
- Every EDIFACT message type
- EDI document types and transaction codes
- TRADACOMS, the UK retail standard
Sources
- X12 transaction sets, ASC X12
- ASC X12, Accredited Standards Committee X12
- UN/EDIFACT D.01B ORDERS message, UNECE UNTDID
- UN/EDIFACT D.96A ORDERS message, UNECE UNTDID