JSON Lines to JSON
Turn JSON Lines (JSONL or NDJSON) into one JSON array, or a JSON array back into lines.
Add data and click Convert to see the result here.
How JSON Lines to JSON works
Converts JSON Lines (also called JSONL or NDJSON) into one JSON array. JSON Lines has one JSON value on each line. It is common for logs, data exports and machine learning datasets.
It also works the other way. Pick JSON to JSON Lines in the Convert list to turn JSON array into lines.
Input to JSON Lines to JSON
- Paste your data into the input box, or upload a .jsonl, .ndjson, .json or .txt file. Then click Convert.
- JSON Lines to JSON: each line must be valid JSON. Empty lines are skipped. If a line is wrong, you see its line number and column.
- JSON to JSON Lines: input must be a JSON array, like [{...}, {...}].
Output from JSON Lines to JSON
- JSON Lines to JSON gives one array indented with 4 spaces, and a message with the number of lines read.
- JSON to JSON Lines puts each array item on its own line, with no extra spaces.
- Copy it, or download it as output.json or output.jsonl.