How does EDI parsing detect ANSI X12 and UN/EDIFACT delimiters?
The browser-based parser strips any leading UTF-8 BOM, then checks opening interchange markers (ISA, UNA, or UNB) inside a local Comlink Web Worker. Trading partners read vendor EDI files without uploading orders or pricing to remote servers, decoding ansi x12 and edifact structures strictly in memory.
Under the X12 EDI standards and control segments directory, every ANSI X12 interchange starts with a fixed 106-byte ISA header. The parser reads the element separator at byte index 3, the component separator at index 104, and the segment terminator at index 105, falling back to line-delimited splitting when newline characters occupy position 105.
For UN/EDIFACT payloads, opening bytes inspect the optional 9-character UNA service string advice (UNA:+.? '). Positions 3, 4, 5, 6, and 8 define component, element, decimal, release escape, and segment characters respectively, honoring ? escapes inside data strings. Using an offline EDI viewer avoids custom ERP mapping setups when teams just need to audit partner messages or create PDF purchase orders manually for smaller accounts.
Inspect ANSI X12 850, 810, 856 and EDIFACT message segments
After delimiter detection, the EDI segment parser groups interchange, functional group, header, trading partner, and line-item segments across common X12 850, 810, 856, and 997 messages as well as UN/EDIFACT ORDERS, INVOIC, DESADV, and CONTRL payloads built under UNECE UN/EDIFACT ISO 9735 directories. Unrecognized transaction codes still populate the annotated segment list with raw element tags.
| Transaction pairing | Header tag | Party and line tags | Extracted fields |
|---|---|---|---|
| X12 850 / EDIFACT ORDERS | BEG / BGM |
N1, NAD, PO1, LIN |
PO number, order date, SKUs, quantities |
| X12 856 / EDIFACT DESADV | BSN / BGM |
N1, NAD, PID, QTY |
Shipment ID, carrier locations, carton GTINs |
| X12 810 / EDIFACT INVOIC | BIG / BGM |
CUR, TDS, MOA, IT1 |
Invoice total (2 decimal places), tax currency |
| X12 997 / EDIFACT CONTRL | AK1 / UCI |
AK2, AK5, IK3, UCM |
Functional acknowledgement accept or reject |
| X12 820, 940, 945 / REMADV | BPR / W05 |
N1, LX, W01, MOA |
Remittance totals and warehouse ship advice |
Parsing PO, ASN, and invoice tags in the EDI segment parser
Header extraction maps document numbers and dates from BEG03, BIG02, BSN02, BGM02, and DTM+137 while reading currency codes from CUR or CUX. Because ANSI X12 omits decimal points in TDS summary totals, integer cents divide by 100 to display clean currency totals, whereas EDIFACT MOA lines check qualifiers 79, 86, 9, and 203.
Trading party cards translate 10 partner role qualifiers (BY, SE, ST, SF, BT, RE, SU, VN, IV, DP) alongside address fields from N3/N4 or NAD.
Line extraction pairs PO1/IT1 and LIN/PIA/IMD/QTY/PRI qualifiers (VP, SK, IN, BP for SKU; UP, EN, UI for GTIN) so ops teams can reconcile ASN cartons with a carton barcode and SSCC-18 label scanner on loading docks.
How EDI diagnostics verify SE01 and UNT segment counts
Operations teams inspecting ANSI X12 and EDIFACT segments rely on trailer parity to catch truncated EDI transmissions before ERP import. The parser counts segments from ST through SE in X12 and UNH through UNT in EDIFACT, comparing actual totals against SE01 and UNT01 declared values.
Any mismatch or missing envelope trailer (SE, GE, IEA, UNT, UNZ) triggers a warning inside Structural diagnostics without hiding decoded segments. Below the diagnostic panel, typing inside Filter by tag (PO1, LIN, NAD, N1…) isolates matching tags across large payloads in real time.
Export EDI to Excel, clean CSV spreadsheets, or JSON locally
Once parsed, teams use this EDI to CSV converter to extract clean flat tables for finance, warehouse auditing, and onboarding reviews without writing custom Python scripts. Three download actions save output straight from browser memory: Export CSV, Export Excel (.xlsx), and Export JSON.
- RFC 4180 CSV tables: Clicking Export CSV saves
edi-lines.csvwhenever line items exist or falls back toedi-segments.csv, prepending a UTF-8 byte order mark (\uFEFF) with Windows CRLF line breaks conforming to the IETF RFC 4180 CSV specification and formula-injection sanitization across every cell. - Multi-sheet Excel workbooks: Clicking Export Excel (.xlsx) builds
edi-export.xlsxwith a dedicated Line Items worksheet followed by a complete Segments worksheet (index,tag,label,raw_segment) when structured lines are present. - Full structured JSON: Clicking Export JSON exports
edi-parsed.jsoncontaining detected delimiters (segment,element,component), summary header fields, resolved party objects, line items, warnings, and annotated segment arrays. - Warehouse label alignment: Operations coordinators who pull GTINs, SKUs, and quantities from spreadsheets can immediately generate compliant GS1-128 and DataMatrix shipping labels before dispatching pallets.
Implementation note: Always cross-check parsed EDI line counts, unit prices, and qualifier meanings against your trading partner’s specific Implementation Guide (IG) before booking accounting entries or customs filings.
When do partner AS2 payloads require extra validation checks?
Standard EDI envelopes validate only flat-file syntax and segment counts, whereas live trading networks wrap payloads inside signed MIME containers and encrypted sessions. Reviewing transport headers, decimal scaling, and implementation guides catches trading partner discrepancies before automated ERP queues reject batches.
Validating trading partner AS2 transport certificates
In production B2B exchanges following the IETF RFC 4130 AS2 EDIINT protocol, interchanges travel inside HTTP POST payloads secured by S/MIME digital signatures and X.509 encryption certificates before returning signed MDN receipts. When an AS2 gateway decrypts an unreadable batch or rejects a signature thumbprint, performing AS2 partner X.509 certificate checks before deployment confirms expiry dates, key usages, and SHA fingerprints offline.
Checking sample interchanges and unknown transaction sets
Before loading sensitive production batches, click Load X12 850 sample (17 segments, version 004010, order PO-2026-8841) or Load EDIFACT INVOIC sample (18 segments, INVOIC:D:96A:UN, total EUR 980.00) to inspect how segment tags, party addresses, and line tables map inside the EDI viewer. Click Clear anytime to reset all state, or paste non-standard regional EDI transaction sets (860, 852, ORDRSP) to decode every individual tag and raw segment cleanly.