X12 vs. EDIFACT: a Complete Rundown
EDI offers many different document types. The most common are ANSI ASC X12 (X12) and UN/EDIFACT (EDIFACT). The two standards are quite similar, differing primarily in their use cases and terminology. Here are the differences and similarities between these two popular EDI document formats.
Use Cases
The biggest difference between the two standards is how they're used and the geographic location of users. In particular, X12 has made significant inroads into the healthcare market, and is used to create HIPAA-compliant healthcare documents whereas EDIFACT does not offer HIPAA documents. However, both X12 and EDIFACT are largely used in other industries such as supply chain, finance, and government.
X12 is also most commonly used by companies based in the United States, while EDIFACT is the favored EDI standard for international companies in Europe and Asia.
Formatting
Conceptually, EDIFACT and X12 are similar. Both largely use the same message structure but simply different terminology.
As you can see in Figure 1, X12 and EDIFACT messages include the following elements: Transaction Set, Functional Group, Interchange, and (optionally) EDI Document for EDIFACT.
Figure 1: X12 vs. EDIFACT Message Structure
- Transaction Set and Messages: the main body of the message — e.g. the order details in a purchase order. X12 calls it a Transaction Set and EDIFACT names it a Message.
- The Functional Group: the header that specifies where the message will go, e.g. a company department. It can contain multiple Transaction Sets/Messages, for example, two or three invoices or an invoice and a PO. For both standards, the Functional Group has a header segment and a footer segment. X12 uses GS for the header segment and GE for the footer. EDIFACT uses UNG for the header segment, while the footer segment is UNE — and both are optional.
- The Interchange: consists of a header and footer and identifies the company that you're sending the document to. X12 uses ISA for the header and IEA for the footer, while EDIFACT calls its header UNB and the footer UNZ.
- The EDI Document: is an optional control segment only found in EDIFACT, which defines the characters used for terminators and separators in the document. These characters are specified out-of-band in X12 and often in EDIFACT as well.
Commonly Used Terminators/Separators
Figure 2 shows a sample X12 document. Every line in the document is called a Segment. If you drill down into the document, for instance, you can see a BEG Segment and a REF Segment. Each segment is comprised of one or more "elements." Both X12 and EDIFACT have the concept of segments and elements. Simply put, a segment is a collection of elements that have a specific meaning.
Figure 2: A sample EDI Document
Looking closer, the BEG segment is defined as the "Beginning Segment for Purchase Order" and consists of the following elements:
- BEG01 – Transaction Set Purpose Code. In this document, the value is "00," indicating it's the original purchase order for this transaction.
- BEG02 – Purchase Order Type Code. In this example, the type is "DS," short for Dropship.
- BEG03 – Purchase Order Number. The purchase order number for this transaction is 0476696888.
- BEG04 – Release Number. This is left empty in this example, as shown by consecutive ‘*' delimiters.
- BEG05 – Date. The date for this purchase order is March 20th, 2009.
X12 and EDIFACT both use the concept of elements that make up segments, which are strictly defined by the document specifications.
Terminators/Separators
X12 and EDIFACT use special characters to distinguish segments and elements. X12 commonly uses a tilde (~) to separate segments and a star to terminate elements. EDIFACT commonly employs a dot between segments and a plus sign between elements, but either can use different characters depending on the specific implementation.
Composite Elements
Composite Elements, which incorporate two or more elements and are similar to an array, are available in both standards; however, Composite Elements are rare in X12 and common in EDIFACT. X12 separates composite elements with a Greater Than sign (>), while EDIFACT delimits them with a semicolon.
Loops and Groups
EDI lets you list multiple segments of the same type in a row, as shown in Figure 3, a concept called a Loop in X12 and a Group EDIFACT.
Figure 3 — Loops and Groups
Release Indicator
Both of these EDI standards have numerous versions along with major and minor releases. The version of the EDI document in use is called the Release Indicator. EDIFACT names the version within the document, X12 doesn't.
Acknowledgements
Acknowledgements are available for both EDI formats. X12 offers TA1 and 997 acknowledgements. TA1 describes errors at the ISA level; 997 reports errors in the Functional and Transaction Groups. EDIFACT uses CONTRL acknowledgments, similar to the functional 997 acknowledgements in X12. These functional acknowledgments confirm the file was successfully read by the receiving entity's translator and that the contents use valid structure and syntax.
Security Authentication
While security authentication is available for X12 and EDIFACT, they support different standards.
X12 uses ASC X12.58 Security Structures, which incorporate authentication, compression, encryption, and assurance to guarantee the EDI file reaches its destination in its original format and that it hasn't been tampered with, while assuring the recipient it came from the original sender.
EDIFACT follows the following security standards:
- ISO 9735-5 — provides a method to address message/package level, group level and interchange level security for authenticity, integrity, and non-repudiation of origin.
- ISO 9735-6 — defines the secure authentication and acknowledgement message AUTACK.
- ISO 9735-7 — addresses message/package level, group level, and interchange level security for confidentiality.
- ISO 9735-9 — defines the security key and certificate management message KEYMAN.
Different Types of Messages
The following table lists some of the key messages available from each standard.
As you can see, X12 and EDIFACT are very similar. If you know the concepts in one, you'll be able to adopt the other by brushing up on some new terminology.
To get a more comprehensive view of the X12 and EDIFACT document standards, download the X12 and EDIFACT schemas.
EDI Onboarding Challenges: And How to Solve Them
Understanding and implementing EDI standards is one of the critical elements in implementing EDI with your partners. But it's far from the only pitfall. To learn how you can avoid the traps in EDI implementations, solve the biggest challenges you'll face and save months and thousands of dollars in the process, see our EDI Onboarding guide.