How to convert between EDI and JSON?

Article author
  • Updated

With EdiNation, you can translate EDI files to JSON and from JSON back to EDI. Both editors allow you to modify the content. 

To begin, navigate to the EDI Translator page and select the EDI JSON tab.

  1. EDI file to JSON

    Upload an EDI file by selecting a local file. Upon loading, the file will be displayed in the EDI editor on the left. The file is automatically expanded so that each segment is on a new line and is easier to view and edit. To convert the file to JSON hit the JSON button. The converted EDI file is displayed in the JSON editor on the right.


    You can edit the EDI data and convert it to JSON again by clicking on the JSON button as many times as you need to.

  2. JSON to EDI file

    You can generate EDI files by modifying the contents in the JSON editor on the right. The JSON must be one of the supported X12, EDIFACT, HL7, NCPDP, or VDA root resources. The JSON for all EDI transactions must match an existing Transaction Model. When you are ready to generate your EDI file, hit the Update EDI button.



After modification of either the EDI or the JSON, you can re-validate it by clicking on the Validate button.


The settings menu allows you to configure an explicit model.

Each EDI message will be matched automatically to a model. If you want to use a custom model, you need to set it explicitly in the settings.


Configure the EDI delimiters

  • If you need to generate an X12 with non-default separators, set the following items as part of the X12Interchange payload:

    • Segment separator: X12Interchange.SegmentDelimiter
    • Data element separator: X12Interchange.DataElementDelimiter
    • Repetition separator: X12Interchange.ISA.InterchangeControlStandardsIdentifier_11
    • Component data element separator: X12Interchange.ISA.ComponentElementSeparator_16
  • If you need to generate an EDIFACT with non-default separators, add a UNA segment before the UNB.


Switch between ignoring/not ignoring the null values in the JSON data

By default, the JSON representation ignores all null values for better readability and performance. You can, however, configure the settings for the JSON to include all null values, and have visibility of what is missing from the underlying EDI model. 

Share this:

Was this article helpful?



Please sign in to leave a comment.