>_devtools

JSON to NDJSON

Convert a JSON array into NDJSON (JSON Lines) with one compact record per line.

What this does

Converts a JSON array into NDJSON / JSON Lines: every array item is written as compact JSON on its own line. The format is easy to stream, append to, split, and process with line-oriented tools such as grep, head, and jq.

Details

Items can be of any type, not only objects. Because each item is written without extra whitespace, line breaks inside string values appear as \n and never split a record.

The top level must be an array; to convert a single object, wrap it in square brackets. The reverse conversion is NDJSON to JSON.

Example

Input:

[{"id":1,"ok":true},{"id":2,"ok":false}]

Result:

{"id":1,"ok":true}
{"id":2,"ok":false}

Privacy

Everything runs in your browser. Your input is never uploaded, stored, or put in the page URL.