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"
firstName | lastName | dob | yearsOfExperience | smoker |
---|---|---|---|---|
John | Doe | 31/1/1992 | 3 | true |
Marry | Poppins | 13/12/1991 | 5 | false |
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 .