Codepackr / edi / EDI to CSV & CSV to EDI Converter

EDI to CSV & CSV to EDI Converter

Convert ANSI X12 and EDIFACT messages into flattened CSV or Excel spreadsheets, or generate compliant EDI 850/810 documents directly from spreadsheet tables.

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.

The EDI to CSV & CSV to EDI Converter turns hierarchical ANSI X12 and UN/EDIFACT documents into flat tabular data that spreadsheets and databases can consume, and it reverses the process by building valid transaction sets from column-oriented tables. Everything executes locally in the browser; the file never leaves your machine.

Typical use cases include extracting line-item details from purchase orders for inventory systems, converting invoices into accounting imports, and producing outbound 850 or 810 documents from ERP exports without a dedicated EDI translator.

Hierarchical to Tabular Flattening

X12 and EDIFACT organize data in nested loops: a header level, repeating line-item loops, and sometimes subordinate detail loops. The converter walks each loop and emits one CSV row per line item (or per the chosen grain), repeating parent values so every row is self-contained. Qualifiers that distinguish multiple occurrences of the same segment (for example REF or DTM) become distinct columns.

Delimiters are detected automatically from the ISA or UNA segment. Optional columns that never appear in a given message are omitted, keeping the result compact while still preserving every populated element.

Generating Compliant EDI from Tables

When the direction is reversed, the tool expects a table whose columns map to known segment elements. It groups rows that share the same transaction identifier into one ST/SE (or UNH/UNT) set, then builds the required envelopes. Control numbers, segment counts, and functional-group counts are calculated automatically so the resulting interchange is syntactically valid.

Supported generation targets include the common purchase-order (850 / ORDERS) and invoice (810 / INVOIC) transaction sets. Custom mappings for other sets can be supplied via a simple column-to-element dictionary.

Envelope and Control Handling

ISA/IEA and GS/GE (or UNB/UNZ) wrappers are either stripped on the way to CSV or generated on the way back to EDI. When generating, the tool populates ISA13/IEA02, GS06/GE02, and ST02/SE02 with sequential values and recalculates SE01 and GE01 so the counts match the content.

Test/production flags, version identifiers, and partner IDs are taken from user-supplied defaults or from the first row of the source table, ensuring the envelopes satisfy the trading partner’s implementation guide without manual editing.

When to use this tool

  • Extract line items from an inbound 850 or ORDERS for loading into an ERP or warehouse system.
  • Turn a spreadsheet of open orders into a batch of outbound 850 documents.
  • Flatten 810 invoices so accounting software can import totals and line details.
  • Inspect or archive the business content of EDI files without an EDI parser library.
  • Prepare test data by converting a CSV of sample orders into properly enveloped EDI.

How to use the EDI to CSV & CSV to EDI Converter

  1. Paste or drop an X12 or EDIFACT file, or a CSV/Excel table.
  2. Choose the conversion direction (EDI to CSV or CSV to EDI).
  3. If converting to EDI, select the target transaction set (850, 810, ORDERS, or INVOIC) and supply partner IDs.
  4. Optionally map additional columns to specific elements or choose the flatten grain (one row per line item, or one row per transaction).
  5. Click Convert; the result appears immediately for download as CSV, XLSX, or raw EDI.
  6. Verify control numbers and segment counts on generated EDI before transmission.

Worked examples

Minimal X12 850 to CSV

Input
ISA*00*          *00*          *ZZ*BUYER        *ZZ*SUPPLIER     *240315*1200*U*00401*000000001*0*P*>~
GS*PO*BUYER*SUPPLIER*20240315*1200*1*X*004010~
ST*850*0001~
BEG*00*SA*PO123**20240315~
PO1*1*10*EA*5.00**VP*WIDGET-A~
PO1*2*5*EA*12.50**VP*WIDGET-B~
CTT*2~
SE*6*0001~
GE*1*1~
IEA*1*000000001~
Output
PO_Number,PO_Date,Line,Qty,UOM,Unit_Price,Part_Number
PO123,20240315,1,10,EA,5.00,WIDGET-A
PO123,20240315,2,5,EA,12.50,WIDGET-B

Header values are repeated on every line-item row; envelopes are omitted.

CSV to X12 850

Input
PO_Number,PO_Date,Line,Qty,UOM,Unit_Price,Part_Number
PO456,20240320,1,100,EA,2.25,PART-X
Output
ISA*00*          *00*          *ZZ*SENDER       *ZZ*RECEIVER     *240320*0000*U*00401*000000001*0*P*>~
GS*PO*SENDER*RECEIVER*20240320*0000*1*X*004010~
ST*850*0001~
BEG*00*SA*PO456**20240320~
PO1*1*100*EA*2.25**VP*PART-X~
CTT*1~
SE*4*0001~
GE*1*1~
IEA*1*000000001~

Envelopes and control numbers are generated; SE01 reflects the actual segment count.

Common mistakes and tips

  • Always confirm the detected delimiters match your trading partner’s agreement; rare non-standard characters can be overridden.
  • When generating EDI, supply a unique interchange control number or let the tool increment one to avoid duplicate-control-number rejections.
  • Flattened CSVs repeat parent data; use a pivot or group-by in your spreadsheet if you need unique header records.
  • For HIPAA or other regulated transactions, strip or mask sensitive elements before sharing the CSV.
  • Large multi-thousand-line files process quickly in the browser, but very wide mappings may require explicit column selection to keep memory modest.

Frequently asked questions

Does the converter support both X12 and EDIFACT?

Yes. It auto-detects the standard from the ISA or UNB segment and applies the corresponding loop and element rules.

Can I generate documents other than 850 and 810?

The built-in templates cover 850/ORDERS and 810/INVOIC. Other transaction sets can be produced by supplying a column-to-element mapping.

Are the generated EDI files guaranteed to pass partner validation?

They are syntactically valid with correct control counts. Semantic compliance still depends on the data you supply matching the partner’s implementation guide.

What happens to optional segments that are absent?

They are simply omitted from the CSV columns or from the generated EDI, so the output stays minimal.

Is any data sent to a server?

No. Parsing, flattening, and generation all occur inside the browser; the file never leaves the client.