JSON Input Editor

Last updated on 9 Sep 2025

Overview

This input editor accepts a valid JSON object and is a component in both the JSONata Studio Playground, JSONata Studio Book and JSONata AST Explorer.

It has several useful features allowing you to:

  • convert Excel to JSON
  • convert JavaScript object to JSON
  • format JSON
  • copy JSON to the clipboard

Excel to JSON conversion

To import an Excel spreadsheet as JSON, press the icon button and select an .xlsx file to upload.

The information in each sheet will be stored in a separate object under a key named as the sheet, and the cell data on the first row of each sheet will become the property keys of the respective object.

Cell data containing a date will be converted to an ISO 8601 date string.

For example, an Excel file with one sheet named "Sheet1"

firstNamelastNamedobyearsOfExperiencesmoker
JohnDoe31/1/19923true
MarryPoppins13/12/19915false

will be converted to

{
  "Sheet1": [
    {
      "firstName": "John",
      "lastName": "Doe",
      "dob": "1992-01-31T00:00:00.000Z",
      "yearsOfExperience": 3,
      "smoker": true
    },
    {
      "firstName": "Marry",
      "lastName": "Poppins",
      "dob": "1992-12-13T00:00:00.000Z",
      "yearsOfExperience": 5,
      "smoker": false
    }
  ]
}

JavaScript object to JSON conversion

At times, you may need to copy a JavaScript object from a code editor or terminal output to use as JSON input, such as this object:

{
  x: 1,
  y: "hello"
}

This will error because the JSON input editor expects a valid JSON object. Otherwise, the JSONata expression will fail to evaluate.

To stringify the JavaScript object, press the icon button {""} and the input will become:

{
  "x": 1,
  "y": "hello"
}

Format

To give the JSON input a consistent look, press the icon button .

This will add line breaks after each [ and {, and a consistent indentation of 2 spaces.

For example, the input:

{ "x": 1, "y": "hello", "z": true }

will become:

{
  "x": 1,
  "y": "hello",
  "z": true
}

Copy

To copy the JSON input including its formatting to the clipboard, press the icon button .