ANSI X12 and UN/EDIFACT

EDI File Viewer

Paste or open an X12 or EDIFACT file to see its envelopes, transactions and loops with plain-language names, check control numbers and segment counts, and export JSON or line-item CSV.

EDI input

Drop an EDI file

.edi, .x12, .txt up to 25.0 MB; separators are read from the file

Open a file, paste text, or load an example. Nothing leaves the browser.

EDI File Viewer

Operator: Abdulla Al Fahad. How tools are built and checked

A raw EDI interchange is one long line of segments such as PO1*1*48*EA*3.75, and nothing in it says what the third element means. This viewer reads an ANSI X12 or UN/EDIFACT file, splits it into envelopes, transactions and loops, and puts a plain name beside every segment and element it knows.

It also does what a trading partner's rejection message cannot: it recomputes the control numbers and segment counts and lists every place they disagree.

Key features

  • Auto-detects delimiters from the fixed-width ISA header (X12) or the UNA service string (EDIFACT), including the release character ?
  • Tree of interchange, functional group or message group, transaction, loops and segments, expandable one segment at a time
  • Plain-language names for common segments, elements and qualifier codes, with a note when a tag is outside the dictionary
  • Checks ISA13 against IEA02, GS06 against GE02, ST02 against SE02, and the segment counts in SE01, GE01, IEA01 and UNT
  • Exports JSON, one segment per line, and a line-item CSV for 850 and 810 data

How delimiters, loops and control numbers are read

An X12 file starts with an ISA segment exactly 106 characters long. The element separator is the character after ISA, the sub-element separator is in ISA16 and the segment terminator follows it, so the three are read rather than assumed. EDIFACT may open with UNA, which lists the component, element and decimal characters, the release character and the terminator; without it the defaults + : . ? and ' apply.

The tree knows loops for X12 850, 810, 855, 856 and 997, with basic 837 and 835 coverage, and for EDIFACT ORDERS, INVOIC and DESADV. Other transaction sets still open as a flat list of segments with whatever names the dictionary has. Files are limited to 25 MB and 400,000 segments.

A segment tag outside the dictionary is shown without element names rather than with guessed ones. Qualifier meanings, such as BY for buying party or ST for ship to, come from a dictionary written for this page and cover the common cases, not the whole standard.

When this helps

  • A buyer's ERP rejects an 850 from a new trading partner. The tree shows 14 PO1 lines while the CTT segment says 13 line items, so the fault is in the partner's mapping and the buyer can quote the exact segment when they write back.
  • A supplier receives an EDIFACT invoice and needs it in a spreadsheet. The CSV gives one row per LIN line with quantity, unit and price, so the line totals can be summed in the spreadsheet and compared with the monetary total in the summary section.
  • A support analyst compares a partner's sample with their own output and uses one-segment-per-line export to diff the two in a text editor.

Opening a file

  1. Paste text or open a file, or choose an example for X12 or EDIFACT.
  2. Expand the transaction on the Tree tab and click segments to see element names and meanings.
  3. Open Issues to read control-number and count problems.
  4. Export JSON, pretty EDI or the line-item CSV.

Example

The X12 850 example, with IEA changed to IEA*2*000000906 and SE to SE*99*0002

ISA13 = 000000905, GS06 = 905, ST02 = 0001
IEA*2*000000906~
SE*99*0002~

Issues listed

ISA13 is "000000905" but IEA02 is "000000906".
IEA01 says 2 but the interchange holds 1 functional group(s).
ST02 0001 does not match SE02 "0002".
SE01 says 99 segments but 0001 has 15 counting ST and SE.

Limits

A passing check means the counts and control numbers agree. It does not mean the transaction meets a partner's implementation guide, whose mandatory elements differ from the base standard.

Only text is read. Interchanges wrapped in AS2 envelopes, signed S/MIME or compressed must be unwrapped first.

A file that mixes several interchanges is listed interchange by interchange; the CSV export covers every transaction it can read.

  • The line-item CSV has 16 columns, including buyer part, vendor part and UPC or EAN, so a row can be matched back to a catalog without opening the tree.
  • Pretty EDI keeps the original separators; only line breaks are added after each terminator.

Common errors and how to fix them

"This does not look like EDI: an X12 file starts with ISA and an EDIFACT file starts with UNA or UNB"
The text does not begin with ISA, UNA or UNB. A byte-order mark in front, or a web page saved as .txt, is the usual cause.
"The ISA segment is shorter than the fixed 106 characters"
Some systems trim the padding spaces in ISA. Restore the fixed widths, because separators are located by position.

Best practices

  • Compare the control numbers you send with the ones in the partner's 997 acknowledgment before suspecting the content.
  • Read ISA06 and ISA08 literally: they are fixed at 15 characters and padded with spaces, so a partner ID that was trimmed or padded differently is a classic reason for a rejected interchange.
  • Send partners the Issues list together with the file when you ask them to retest.

Line-item CSV columns

The columns are Interchange control, Transaction control, Transaction, Document number, Document date, Buyer, Ship to, Line, Quantity, Unit of measure, Unit price, Buyer part, Vendor part, UPC / EAN, Other IDs and Description. For X12 850 the part numbers come from the BP, VP and UP qualifiers in PO1; for EDIFACT invoices the GTIN is read from LIN and the buyer part from PIA.

Reading EDIFACT release characters

A question mark makes the next character literal, so It?'s a test?+with escapes holds an apostrophe and a plus sign inside one element. The viewer unescapes values for display and splits only on separators that are not escaped.

Frequently asked questions

Can it validate against my partner's implementation guide?

No. It checks the envelope arithmetic and the mandatory elements of segments it knows, not partner-specific rules or code lists.

Where do I find which interchange a 997 acknowledges?

A 997 acknowledges functional groups, not interchanges. Its AK1 segment gives the group code and the group control number of the acknowledged group; find the file you sent whose GS06 equals that number, and the ISA13 in that file is the interchange. An interchange-level acknowledgment is a separate TA1 segment, which carries the ISA13 itself.

Is there a tool for turning the CSV back into EDI?

No. This page reads and exports; generating an interchange needs a mapping to a partner's guide, which is outside what it does.