JSON to EDI Converter
Convert JSON payloads and REST transaction models into ANSI X12 or EDIFACT segments with exact counts.
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.
Many modern systems exchange purchase orders, invoices, and ship notices as JSON. Trading partners still require ANSI X12 or UN/EDIFACT. The JSON to EDI Converter accepts a structured JSON representation of the business data and emits correctly delimited, correctly counted EDI.
You supply the transaction content; the converter builds the ISA/GS/ST (or UNB/UNH) envelopes, inserts the data segments in the proper order, calculates segment counts, and closes the trailers. All processing occurs locally.
Expected JSON Shape for X12
The input object contains sender and receiver identifiers, a functional identifier (PO, IN, SH, ...), a version, and an array of transactions. Each transaction contains a transaction-set identifier (850, 810, ...) and an array of segment objects. A segment object has a tag and element values keyed by position (BEG01, BEG03) or by conventional name.
The converter assigns control numbers (or uses those you supply), writes the ISA with the correct fixed-length padding, emits each segment with the chosen delimiters, and writes SE, GE, and IEA with accurate counts.
Expected JSON Shape for EDIFACT
The input contains sender, recipient, syntax identifier, and an array of messages. Each message has a type (ORDERS, INVOIC, ...), version, release, and an array of segments. Composites may be supplied as objects or as pre-formatted strings.
The converter writes UNB, UNH, the data segments, UNT with the correct segment count, and UNZ. Release characters are applied when a value contains a delimiter.
Count Calculation and Delimiters
SE01 (X12) and the UNT count (EDIFACT) are computed from the segments actually written, including the header and trailer of the transaction or message. GE01 and IEA01 (or the UNZ count) are likewise computed from the groups and messages produced. You cannot produce an inconsistent count by accident.
Default X12 delimiters are * element, : sub-element (or > as ISA16), and ~ segment. Default EDIFACT delimiters are + element, : component, and ' segment. You may override them; the ISA or UNA is written accordingly.
When to use this tool
- You have a JSON representation of an order or invoice and must produce X12 or EDIFACT.
- You are prototyping an outbound EDI flow from a REST API.
- You need correctly counted envelopes without manually tracking segment totals.
- You want to generate test documents from structured data.
- You are converting the output of the EDI to JSON tool back into EDI after modification.
How to use the JSON to EDI Converter
- Prepare a JSON object that includes parties, functional or message type, version, and the segment data.
- Paste the JSON into the input area.
- Select X12 or EDIFACT and the desired delimiters.
- Click Convert. The EDI text appears with envelopes and accurate counts.
- Copy or download the result.
- Validate the output with the envelope validator if desired.
- All conversion stays in the browser.
Worked examples
JSON to Minimal X12 850
{"sender":"SENDER","receiver":"RECEIVER","functionalId":"PO","version":"004010","transactions":[{"id":"850","segments":[{"tag":"BEG","BEG01":"00","BEG02":"SA","BEG03":"PO12345","BEG05":"20250101"}]}]}
ISA*00* *00* *ZZ*SENDER *ZZ*RECEIVER *250101*1200*U*00401*000000001*0*P*>~GS*PO*SENDER*RECEIVER*20250101*1200*1*X*004010~ST*850*0001~BEG*00*SA*PO12345**20250101~SE*3*0001~GE*1*1~IEA*1*000000001~
Control numbers are auto-assigned. SE count is 3. IDs are space-padded to 15 characters in the ISA.
JSON to EDIFACT ORDERS
{"sender":"SENDER","receiver":"RECEIVER","messages":[{"type":"ORDERS","version":"D","release":"96A","segments":[{"tag":"BGM","BGM01":"220","BGM02":"PO12345","BGM03":"9"}]}]}
UNB+UNOC:3+SENDER+RECEIVER+240101:1200+1'UNH+1+ORDERS:D:96A:UN'BGM+220+PO12345+9'UNT+3+1'UNZ+1+1'
UNT count is 3 (UNH, BGM, UNT). Interchange control reference is auto-assigned.
Common mistakes and tips
- Supply element values in the order the standard expects; the converter does not reorder elements inside a segment.
- ISA sender and receiver IDs are padded to 15 characters; shorter values are left-justified and space-filled.
- Let the converter calculate counts; manual SE or UNT values in the input are ignored in favor of the computed totals.
- When a data value contains the element separator, the EDIFACT release character is inserted automatically.
- After conversion, run the result through the envelope validator to confirm pairing before transmission.
Frequently asked questions
What JSON structure is required?
A top-level object with sender, receiver, type/version information, and an array of transactions or messages containing segment objects. Position-based or name-based element keys are accepted for common segments.
Can I supply my own control numbers?
Yes. If present in the JSON they are used; otherwise new unique numbers are generated.
Does it support loops?
Yes. Repeating segments or explicit loop arrays in the JSON become repeating segments in the EDI output.
Are implementation-guide mandatory elements enforced?
No. The converter emits the segments and elements you provide and calculates envelope counts. Content validation is separate.
Is the JSON uploaded?
No. Conversion runs entirely in the browser.