Codepackr / edi / EDI Segment Viewer

EDI Segment Viewer

Inspect EDI segments, drill down into element positions (ISA01-16), and search data.

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.

Every EDI document is a sequence of segments. In ANSI X12 a segment begins with a two- or three-character identifier (ISA, GS, ST, BEG, PO1, N1) followed by elements separated by the delimiter declared in the ISA (commonly *). The segment ends with the segment terminator (commonly ~). EDIFACT uses a three-character tag, a plus-sign element separator, a colon component separator, and an apostrophe terminator. The Segment Viewer parses the raw text into an ordered list of segments and exposes each element by position.

You can expand any segment to see ISA01 through ISA16, BEG01 through BEG05, or the corresponding EDIFACT composites. A search box filters segments or element values in real time. Because processing is local, large files stay on your machine and no credentials or documents are transmitted.

X12 Segment and Element Positions

X12 element positions are numbered starting at 01. ISA01 is the authorization information qualifier (usually 00), ISA02 the authorization information (usually spaces), ISA05 the sender ID qualifier, ISA06 the sender ID (15 characters, padded), ISA13 the interchange control number, and ISA16 the sub-element separator. GS01 is the functional identifier code, GS06 the group control number, GS08 the version. ST01 is the transaction set identifier and ST02 the control number.

The viewer lists every segment in document order and expands it into a table of position, value, and (when known) the standard name. Empty elements are shown so you can see whether a trailing delimiter was present. This is useful when a missing separator has shifted subsequent values.

EDIFACT Segment Structure

EDIFACT segments begin with a three-character tag. UNB is the interchange header; its first composite is the syntax identifier (UNOA:2 or UNOC:3), followed by sender, recipient, date/time, and interchange control reference. UNH is the message header and carries the message reference number and the message identifier composite (ORDERS:D:96A:UN). Data elements are separated by + and components by :. The segment terminator is '.

The viewer splits composites so you can inspect each component. Searching for a GLN or a message type (ORDERS, INVOIC, DESADV) jumps directly to the matching segments.

Search and Navigation

The search field matches segment tags, element values, or free text. Results are highlighted and the list scrolls to the first match. You can also jump to a specific segment by its sequence number or by its tag and occurrence (the second N1, the third PO1).

Copying a segment or a single element value places the exact raw text on the clipboard, preserving original spacing and delimiters. This is convenient when you need to paste a corrected segment back into a test file.

When to use this tool

  • You need to examine the exact contents of ISA01–ISA16 or GS01–GS08 without writing a parser.
  • A document was rejected and you want to verify element positions and delimiter usage.
  • You are comparing two similar segments (two N1 loops or two LIN lines) side by side.
  • You need to extract a specific value (purchase order number, GLN, control number) quickly.
  • You are learning the difference between X12 and EDIFACT segment syntax.

How to use the EDI Segment Viewer

  1. Paste the raw EDI text into the input area. The tool auto-detects X12 (ISA) or EDIFACT (UNB or UNA).
  2. The segment list appears immediately. Click any segment to expand its elements by position.
  3. Use the search box to filter by tag, value, or partial string. Matches are highlighted.
  4. Click an element value to copy it, or use the copy-segment button to copy the entire raw segment.
  5. For X12, note the delimiters declared in ISA16 (sub-element) and the segment terminator after ISA.
  6. For EDIFACT, expand composites to see component values separated by the colon.
  7. Clear the input or load a new document at any time; nothing is stored.

Worked examples

X12 ISA and GS Inspection

Input
ISA*00*          *00*          *ZZ*SENDER         *ZZ*RECEIVER       *250101*1200*U*00401*000000001*0*P*>~GS*PO*SENDER*RECEIVER*20250101*1200*1*X*004010~
Output
ISA expands to ISA01=00, ISA02=(spaces), ISA05=ZZ, ISA06=SENDER (padded), ISA07=ZZ, ISA08=RECEIVER (padded), ISA09=250101, ISA10=1200, ISA12=00401, ISA13=000000001, ISA15=P, ISA16=>. GS expands to GS01=PO, GS02=SENDER, GS03=RECEIVER, GS06=1, GS08=004010.

ISA length is fixed; the viewer preserves padding so you can verify ID field widths.

EDIFACT UNB and UNH

Input
UNB+UNOC:3+5412345678908:14+8798765432106:14+240315:1430+IC20240315001'UNH+1+ORDERS:D:96A:UN'
Output
UNB expands to syntax UNOC:3, sender 5412345678908 qualifier 14, recipient 8798765432106 qualifier 14, date 240315 time 1430, control reference IC20240315001. UNH expands to message reference 1, message identifier ORDERS:D:96A:UN.

Composites are split on the colon so each component is visible.

Common mistakes and tips

  • Confirm the segment terminator before counting elements; a missing terminator merges two segments.
  • X12 IDs in ISA06 and ISA08 are left-justified and space-padded to 15 characters; the viewer shows the padding.
  • EDIFACT release character (?) must be handled when a data value contains a delimiter; the viewer displays the raw characters.
  • Use search for control numbers when reconciling an interchange against a 997 or CONTRL.
  • Empty trailing elements are significant; they indicate that the sender included the separators.

Frequently asked questions

Does the viewer understand both X12 and EDIFACT?

Yes. It detects the format from the first segment (ISA versus UNB/UNA) and applies the corresponding delimiter rules.

Can it handle very large files?

Parsing is performed in the browser. Files of several megabytes are practical on modern hardware; extremely large interchanges may benefit from splitting first with the batch splitter.

Are element names shown?

Common envelope and transaction-set elements display their standard names. Less common segments show position and raw value.

Does it validate syntax?

It parses and displays. Structural and envelope validation is available in the dedicated EDI Syntax & Envelope Validator.

Is data uploaded to a server?

No. All parsing and search happen locally in your browser.