How to use JSON Lines Formatter
- Paste either a JSON array or JSON Lines content.
- Leave direction on Auto-detect or pick one explicitly.
- Copy or download the converted output.
JSON Lines Formatter features
- Splits a JSON array into one compact JSON document per line
- Joins JSON Lines back into a pretty-printed array
- Auto-detects the direction, or force it explicitly
- Reports the first invalid line with its number when joining
- Skips blank lines safely
- Downloads as .jsonl or .json
JSON Lines Formatter example
Array to JSON Lines
Input:
[{"id":1,"level":"info"},{"id":2,"level":"error"}]Output:
{"id":1,"level":"info"}
{"id":2,"level":"error"}Frequently asked questions about JSON Lines Formatter
What is JSON Lines / NDJSON?
A text format with exactly one JSON value per line, separated by newlines. It streams well and is used by log shippers, BigQuery, Elasticsearch bulk APIs and many data pipelines.
How does auto-detect decide the direction?
If the first lines each parse as standalone JSON values, the input is treated as JSON Lines and joined into an array; otherwise it is parsed as a JSON document and split into lines.
What if my array contains nested arrays or objects?
Each top-level item is written on its own line as compact JSON, regardless of how deeply nested it is.
Are blank lines a problem?
Blank lines are skipped when joining. When splitting, the output never contains blank lines, so it is safe for strict NDJSON consumers.