How to convert between EDI and JSON?

Article author
  • Updated

With Web EDI Analyzer, you can translate EDI files to JSON and from JSON back to EDI. Both editors allow you to modify the contents. To begin, navigate to the Convert EDI to JSON page.

  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. 


    The contents of the EDI file are converted to JSON automatically and are displayed in the JSON editor on the right.

    You can edit the EDI data and convert it to JSON again by clicking on the arrow button pointing toward the JSON editor.



    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.


  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 either X12Interchange or EdifactInterchange. The JSON for all EDI transactions must match an existing Transaction Model.


    When you are ready to generate your EDI file, hit the arrow button pointing towards the EDI editor.

    The resulting EDI will be expanded with each segment on a new line. You can copy and save it to a file and then edit it to remove all carriage returns and line feeds if needed.


    View and download EDI message specifications

    To view and download all JSON modes use the "JSON Models" dropdown. It displays all internal JSON types required by the API for this operation.



    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, select 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.