JSONL Converter
Convert JSON array and JSON Lines
Paste a JSON array or JSONL and convert it with auto-detection first; empty-line and formatting options are available in Advanced mode.
The full guide also includes pitfalls, worked examples, snippets, FAQs, and related tools for checking results or troubleshooting.
About this tool
Convert a pasted JSON array to compact lines or parse line-delimited JSON values into an array. Direction is selected by whether trimmed input starts with [. Choose whether to ignore blank lines and pretty-print the resulting array. The converter is in-memory and does not validate a downstream NDJSON or dataset schema. Input and options are saved locally.
Production Snippets
Blank-line handling changes array contents
text
Input:
1
true
Ignore empty lines on → [1,true]
Ignore empty lines off → [1,null,true]
Outputs are shown compactly; Pretty JSON array changes indentation only.Failure Clinic (Common Pitfalls)
Array-valued JSONL records are mistaken for one array document
Cause: Direction is inferred from the first non-whitespace character. A leading [ selects whole-array parsing even when the author intended one array per line. The tool loads all pasted text and has no manual direction or streaming mode.
Fix: Use a dedicated line-oriented parser when records begin with arrays or the file is too large to hold in memory. Check the downstream importer’s accepted record types and blank-line rules.
Frequently Asked Questions
How is conversion direction selected?
Input whose trimmed text begins with [ is parsed as one JSON array; otherwise each line is parsed as JSON. This means JSONL beginning with an array-valued record can be mistaken for a single array document. There is no manual direction switch.
Must every JSONL record be an object?
No. JSON.parse accepts objects, arrays, strings, numbers, booleans, and null as individual values. The receiving NDJSON or dataset importer may impose stricter rules. A JSON array is serialized into one compact value per line.
What happens to blank or invalid lines?
Blank lines are ignored by default. Turning that option off inserts null for each blank line. An invalid non-empty line rejects the whole conversion; there is no reject-file export. With blank lines ignored, error line numbers refer to the filtered records.
Is this suitable for streaming large files?
The tool processes pasted text and the full result in memory; it does not stream files. Input and options are saved locally in this browser, and conversion does not upload them.
Keep browsing