Skip to content

Free EDI to JSON Converter

Convert X12, EDIFACT or TRADACOMS into structured JSON for your code: envelope, parties, line items and validation issues, with element positions kept.

Runs in your browser. Nothing you enter or paste is sent to OrderSync.

Try a sample:

X12, EDIFACT or TRADACOMS, up to 2 MB. Pasting reads it straight away; or choose a file.

X12 to JSON Field Mapping

X12 is positional and JSON is named, so the converter decides what each position becomes. The output mirrors the envelope rather than flattening it, because flattening loses the grouping that tells you which line an address belongs to.

X12JSONNotes
ISA / IEAinterchangeSender and receiver IDs with qualifiers, date as YYYY-MM-DD, time as HH:MM, control number, test or production
GS / GEfunctionalGroups[]Functional ID (PO, IN, SH), sender, receiver, date as YYYY-MM-DD, time, control number
ST / SEtransactions[]type, typeName and controlNumber
850 BEG / 810 BIGpurchaseOrder / invoiceNumber, purpose, type and dates as YYYY-MM-DD
DTMdates[]qualifier, meaning (002 is Delivery requested) and date as YYYY-MM-DD. A DTM inside a line goes on that line
REFreferences[]qualifier, meaning (DP is Department number) and value. A REF inside an N1 loop goes on that party
ITDterms[]Terms type, basis date, discount percent and days, net days, as numbers
N1 loops (N1, N2, N3, N4, PER)parties.shipTo, parties.billTo, ...Every N1 loop, with its ID qualifier spelled out (UL is GLN). A second party of the same type becomes shipTo_2
PO1 / IT1 with PIDlineItems[]quantity and unitPrice as numbers, unit with unitName (CA is case), every qualifier/ID pair in productIds[], PID text as description
850 TD5carrierTransport mode, carrier code and routing
CTTtotalslineItemCount and hashTotal as numbers
810 TDStotalAmount, totalAmountAsSentTDS01 has two implied decimals: 33500 becomes totalAmount 335 and totalAmountAsSent "33500"
Any other segmentsegments[] with elements[]Each element keeps its position, empty ones included. Segments inside a line loop (PO4, SAC, SDQ) go in that line's segments[]

Empty elements are kept on purpose. If a converter silently dropped them, PO107 would shift into PO106 and every downstream mapping would be off by one.

EDIFACT and TRADACOMS to JSON

Paste a UN/EDIFACT or TRADACOMS file and the converter switches to the EDIFACT reader. Each message comes back with a business summary (document number, dates, parties with GLNs, lines with GTINs, quantities and prices, totals) followed by every segment by tag, with composite elements as arrays. The EDIFACT viewer shows the same parse segment by segment.

For People, Not Code?

If you want to read a document rather than process it, the EDI translator writes it out in plain English, and the EDI viewer and validator checks it the way a trading partner's translator would. To build an 850 from a spreadsheet, use CSV to EDI, and to map an XML order onto an 850, see XML to EDI. Segment meanings for every transaction set are in the EDI transaction guides.

Frequently Asked Questions

How do I convert an EDI file to JSON?

Paste the file or choose it, and the JSON appears below. Copy it or download a .json file. X12, EDIFACT and TRADACOMS are all detected automatically; nothing is uploaded.

What does the JSON look like?

An interchange object (sender, receiver, date, control number, test flag), then functional groups, then transactions. 850s, 810s, 856s and 997s get named fields such as purchaseOrder, dates, references, terms, parties.shipTo and lineItems with numeric quantities, prices, descriptions and every product ID pair. Any segment without a named field is kept in segments[], so nothing in the file is left out. Other transaction sets keep each segment with its elements by position, empty positions included, so element numbers still match the spec.

Does it convert EDIFACT and TRADACOMS to JSON?

Yes. An EDIFACT or TRADACOMS file produces the interchange header, each message with its parties, dates, references, lines and totals, every segment by tag, and any validation issues.

Can it convert JSON or CSV back to EDI?

For purchase orders, yes: the CSV to EDI converter builds a valid X12 850 from a spreadsheet of order lines. General JSON to X12 is not offered here, because a valid outbound file depends on your trading partner's implementation guide.

Is there an API?

The same parsers power OrderSync's MCP server at ordersync.io/mcp, which AI assistants can call to validate and explain EDI. For document extraction from PDFs and email, see the extraction API.