JSON Lines converter
Convert JSON arrays to JSONL or NDJSON and back with an individual record preview and clear line errors.
How it works & useful details
How it works
Convert a JSON array to one compact JSON value per line, or collect JSON Lines into an array. Every line may contain any JSON value, including null or a nested array. Output uses LF newlines and a final newline when records exist. One final newline is accepted on input. Blank lines are rejected unless you explicitly skip them. An empty stream represents an empty array. Up to 10,000 records and 50,000 combined values.
Limits & privacy
Up to 1,000,000 characters, 50,000 values and 64 levels. Live previews pause above 40,000 characters; run the tool to process the full supported input. Imported files must be UTF-8 and under 1 MB. Your data stays on this device.
Numbers use JavaScript decimal precision. Unsupported large integers are rejected; quote identifiers to keep all digits. Duplicate object names keep their last value. Transforms preserve data, not source whitespace or number spelling.
Paths use JSON Pointer: an empty path selects the root, ~0 escapes a tilde, and ~1 escapes a slash.
About this tool
JSON Lines converter turns a JSON array into JSONL or NDJSON, and back again. These formats store one JSON value per line, which is what log pipelines and streaming imports expect.
The converter previews individual records and reports the exact line where parsing failed, which is far more useful than a single generic error. Conversion is local and no data is uploaded.
How to use it
- Choose the conversion direction.
- Paste either a JSON array or line-delimited JSON.
- Check the record preview and any line-specific errors.
- Copy or download the converted output.
Worked example
The JSON array
[{"id":1,"ok":true},{"id":2,"tags":["a","b"]},null]becomes three lines of JSON Lines:
{"id":1,"ok":true}
{"id":2,"tags":["a","b"]}
nullEach line is a complete, compact JSON value. Converting in the other direction collects the lines back into an array.
When JSON Lines is the better format
JSON Lines (also called JSONL or NDJSON) suits streams and large datasets. Each record can be written, read, or processed on its own without loading the whole file. Log pipelines, BigQuery and other data warehouse imports, the OpenAI and Anthropic batch APIs, and machine-learning datasets commonly use it. Appending a record is just writing one more line.
A regular JSON array is better for small documents, configuration, and API responses that a client reads in one piece. Blank lines are rejected by default, because they usually mean a record went missing. Enable "skip blank lines" only when you know the source pads its output.
Frequently asked questions
What is the difference between JSONL and NDJSON?
The two names describe the same layout: one JSON value per line. Some tools use one name and some the other.
Why does a line fail to parse?
Each line must be a complete JSON value. Pretty-printed JSON spanning multiple lines is not valid JSONL and is reported by line number.
What is the limit?
Up to 1,000,000 characters of input.
Can a record span several lines?
No. In JSON Lines each record must be on a single line, so pretty-printed objects are invalid. Convert them into an array first, then back to JSON Lines.
