EDI Hierarchical Schema Viewer & Element Lookup
Explore ANSI X12 loops, segment structures, element positions (BEG01, PO102), and standard code dictionaries with synchronized raw text highlighting.
Client-Side Execution & Privacy Guarantee
This utility executes 100% locally in your web browser. Your inputs, tokens, queries, and data payloads are never transmitted to any external server or backend.
ANSI X12 EDI documents are hierarchical. An interchange starts with a fixed-length ISA segment that declares delimiters and parties, contains one or more functional groups opened by GS and closed by GE, and each group holds one or more transaction sets opened by ST and closed by SE. Inside a transaction set, segments form loops that repeat for parties, line items, or shipments. Element positions such as BEG01 or PO102 have fixed meanings defined by the X12 standard and the version (for example 004010 or 005010).
The EDI Hierarchical Schema Viewer loads the standard structure for a chosen transaction set and version, then overlays the segments and loops from your pasted document. Selecting an element in the tree highlights the matching raw text, and selecting text in the raw pane jumps to the corresponding position. Code dictionaries show the allowed values for coded elements such as BEG01 (transaction set purpose code) or N101 (entity identifier code). Everything runs locally in the browser; the document never leaves your machine.
Envelope Layers and Control Numbers
The outer ISA/IEA pair identifies the sender (ISA06) and receiver (ISA08) with qualifiers (ISA05, ISA07), a unique interchange control number (ISA13), and the element, sub-element, and segment separators. ISA is always 106 characters in length when using the common asterisk element separator. GS/GE pairs group transaction sets of the same type; GS01 holds the functional identifier (PO for purchase orders, IN for invoices, SH for ship notices) and GS06 is the group control number that must match GE02. ST/SE pairs bound a single document; ST01 is the three-digit transaction set identifier and ST02 is the control number that must match SE02.
Control numbers must be unique within their scope and must pair correctly. The schema viewer displays these pairings and flags mismatches when the loaded structure is compared against the pasted text. Version is carried in ISA12 and GS08; implementation guides often constrain which loops and elements are required beyond the base standard.
Loops, Segments, and Element Positions
Loops are named groups of segments that may repeat. In an 850 purchase order the N1 loop (party) can appear for BY (buyer), ST (ship-to), and BT (bill-to), each optionally followed by N3 and N4. The PO1 loop (baseline item data) repeats once per line item and may contain PID, PO4, or SDQ. Element positions are numbered from 01; BEG01 is the transaction set purpose code (00 = original, 01 = cancellation), BEG03 is the purchase order number, and PO102 is the quantity ordered.
The viewer presents the hierarchy as a collapsible tree. Expanding a loop shows its maximum repeat count from the standard, the segments that may appear, and the usage (mandatory, optional, or conditional). Clicking an element shows its data type, minimum and maximum length, and the code list when the element is coded.
Code Dictionaries and Synchronized Highlighting
Coded elements reference published code lists. BEG01 values include 00 (original), 01 (cancellation), and 05 (replace). N101 values include BY, ST, BT, and VN. The viewer embeds the most common lists so you can look up a value without leaving the page. Selecting a code in the dictionary filters the raw text to occurrences of that value.
Raw text highlighting is bidirectional. Selecting BEG03 in the tree selects the corresponding characters in the document pane and shows the surrounding segment. Selecting a token in the raw pane expands the tree to that position and displays the element definition. This makes it practical to map a trading partner's sample file to the official structure.
When to use this tool
- You need to confirm which loops and elements are allowed for a specific X12 version and transaction set.
- A trading partner sent a sample and you must map element positions to their meanings.
- You are debugging a rejected document and want to verify required segments and code values.
- You are writing or reviewing an implementation guide and need a visual hierarchy.
- You want to look up a code value (for example the meaning of N101 = ST) without opening a separate reference.
How to use the EDI Hierarchical Schema Viewer & Element Lookup
- Paste or drop a raw X12 document into the input area. The tool detects the version from ISA12 and GS08 when present.
- Select the transaction set (850, 810, 856, etc.) if it is not auto-detected from ST01.
- Expand the tree to navigate ISA, GS, ST, loops, and segments. Click any element to see its definition and code list.
- Use the raw text pane to click a segment or element; the tree and definition panel update to match.
- Search the code dictionary for a value or description to highlight matching positions in the document.
- Export the expanded hierarchy or copy a specific element path for use in mapping documentation.
Worked examples
Minimal 850 Purchase Order Envelope
ISA*00* *00* *ZZ*SENDER *ZZ*RECEIVER *250101*1200*U*00401*000000001*0*P*>~GS*PO*SENDER*RECEIVER*20250101*1200*1*X*004010~ST*850*0001~BEG*00*SA*PO12345**20250101~SE*3*0001~GE*1*1~IEA*1*000000001~
Tree shows ISA (ISA06=SENDER, ISA08=RECEIVER, ISA13=000000001), GS (GS01=PO, GS06=1, GS08=004010), ST (ST01=850, ST02=0001), BEG (BEG01=00 original, BEG03=PO12345), SE, GE, IEA. Selecting BEG01 displays code list entry 00 = Original.
Control numbers match. Segment count in SE is 3 (ST, BEG, SE). All data stays in the browser.
N1 Party Loop Lookup
N1*ST*ACME WAREHOUSE*92*123456789~N3*100 MAIN ST~N4*ANYTOWN*CA*90210~
Schema shows N1 loop with N101 entity identifier code (ST = Ship To), N102 name, N103 identification code qualifier (92 = Assigned by Buyer), N104 identification code. N3 and N4 appear as optional child segments.
Clicking N101 in the tree highlights ST in the raw text and shows the entity identifier code list.
Common mistakes and tips
- Always verify the version in GS08; element definitions and required loops differ between 004010 and 005010.
- ISA is fixed-length; count characters carefully when the element separator is not the default asterisk.
- Control number mismatches between header and trailer are a common rejection reason; the viewer surfaces them immediately.
- Implementation guides frequently make optional standard elements mandatory; cross-check the partner's guide after using the base schema.
- Use the synchronized highlight to confirm that a data element landed in the expected position rather than shifting due to a missing separator.
Frequently asked questions
Does the viewer support both X12 and EDIFACT?
The hierarchical schema and code dictionaries are built for ANSI X12. EDIFACT messages use different segment tags and a different envelope structure (UNB/UNZ, UNH/UNT); use the segment viewer for raw EDIFACT inspection.
Are the code lists complete?
The embedded lists cover the most frequently used codes for common transaction sets (850, 810, 856, 855, 997). Rare or industry-specific codes may require the official X12 code source manual for that version.
Does the tool validate the document?
It shows structural compliance against the base standard and highlights control-number pairing. Full syntax and implementation-guide validation is performed by the separate EDI Syntax & Envelope Validator.
Can I load a custom implementation guide?
The viewer uses the published X12 standard structure. Custom guides that restrict or extend the standard must be consulted separately; the tool does not import partner-specific rules.
Is any data uploaded?
No. Parsing, tree construction, and highlighting all occur in the browser. The document remains on your device.