X12 Viewer
Paste an X12 file into the editor and its elements show up here, one row each.
Or drop an .x12 or .edi file on this box, , or .
An X12 viewer that shows the structure and checks the envelope
X12 files are hard for people to read for the same reason they are easy for machines: one long run of asterisks and tildes, with the separators hidden in a fixed-width header. This X12 EDI viewer splits the file for you. Paste an interchange and you get the envelope first (ISA, then GS, then ST), then one row per element with its position, such as BEG-03, and the value exactly as written, grouped by segment and line number.
The separators come from the ISA segment, which is always 106 characters long: the element separator is the character right after ISA, the component separator is character 105 and the segment terminator follows it. From version 00402 on, ISA-11 holds a repetition separator, and the viewer uses it. Segments can sit on one line or one per line, and a file wrapped at a fixed width is joined back up. The control numbers are checked too: IEA-02 against ISA-13, GE-02 against GS-06 and SE-02 against ST-02, plus the segment count in SE-01 and the counts in GE-01 and IEA-01. If you are new to the format, the ASC X12 article on Wikipedia gives the background.
What you won't find here are element names or code descriptions. ASC X12 owns those and doesn't allow them to be published without a licence, so the table shows positions and values only. The one exception is the short public name of common transaction sets, such as 850 Purchase Order. For what BEG-02 or N1-01 means, use your partner's implementation guide or the transaction set documentation from ASC X12. The file is read in your browser and not uploaded, and the table is the same one our JSON parser uses.
How to read an X12 file with this viewer
Paste or drop the file
Paste the file into the editor on the left, or drop an .x12, .edi or .txt file onto the tool. It should start with ISA. Sample loads a fictional 850 in version 004010: an office supplier ordering Lenovo and Dell laptops.
Read the status block
At the top you get the version from GS-08, the transaction set, the number of segments, the separators the ISA declares, and the envelope as one line (interchange, group, transaction sets with their segment counts). Below that, every control number and count check is listed as OK or Warning, with the line it refers to.
Expand components and empty positions
A composite value such as HC>99213 is shown as written. Expand components splits it into SV1-01.1 and SV1-01.2, and repeated values sit side by side. Positions matter in X12, so Show empty elements is worth a press: in PID*F****Lenovo ThinkPad the text is in PID-05, with three empty positions before it.
Filter, export or copy as JSON
Type a segment ID such as PO1 in the Position filter to see only those rows. Excel downloads the table as shown, and Copy as JSON gives the interchange as nested JSON (interchange, groups, transaction sets, segments) with position keys like "BEG-03".
When an X12 viewer helps
A partner sent back a 997 or 999
Acknowledgments point at a transaction set by control number and at a segment by its position in the set. Paste your original file, find the ST with that control number, and count down the segment headings; the line numbers take you straight to the spot in your own file.
Control numbers that don't match
Files built by a script or edited by hand often get the trailers wrong: SE-01 not updated after a line was added, GE-01 still saying one set after a second was appended, or IEA-02 written with different zero padding than ISA-13. The checks list says which one and on which line.
Looking at a new partner's file before mapping it
See which positions they fill, how long their values are, whether they send several transaction sets per group, and which separators they use. That is often enough to spot a version mismatch before anyone writes a map.
A file that arrived damaged
Some systems wrap X12 at 80 characters or trim the trailing spaces from the ISA. The viewer joins wrapped lines and warns when the ISA is not 106 characters or a fixed-width value has the wrong length, which is a common reason a translator refuses a file. For the wider picture of how these exchanges work, see electronic data interchange.
Frequently Asked Questions
Why doesn't the viewer show element names?
The names, descriptions and code lists of X12 elements belong to ASC X12, and publishing them needs a licence (see their licensing program). So this page sticks to what any parser can see: segment IDs, positions, values, the envelope and the control numbers. Your partner's implementation guide fills in the meaning.
Which X12 versions does it read?
Any version, including 003040, 004010 and 005010. The viewer reads structure, not the dictionary of a particular version, so the only version difference it cares about is the repetition separator: from 00402 on, ISA-11 is a symbol such as ^ and is used to split repeated values; in older versions ISA-11 holds a letter and nothing is split.
Can it read files with several interchanges or transaction sets?
Yes. Each ISA starts a new interchange with its own separators, each GS a new group and each ST a new transaction set, and the counts are checked at every level. The status block shows the envelope as a tree, for example interchange, then group, then two 856 Ship Notice/Manifest sets with their segment counts.
What if my file has no ISA segment?
If it starts with GS or ST, the viewer guesses the element separator from the second character and treats ~ (or a line break) as the segment terminator. Components are not split in that case, because only the ISA says which character separates them, and a warning says so.
Is my file uploaded?
No. It is parsed in your browser and the page makes no request with it. That matters for health care files such as 837 claims, but follow your organization's rules about where such data may be pasted all the same.
I need EDIFACT, not X12. Is there a viewer for that?
Yes, the EDIFACT viewer reads UN/EDIFACT interchanges with UNA separators and release characters, shows short element names and checks the UNT and UNZ counts.
Related tools
Read the other common EDI format, or work with the JSON you copied.