JSON Lines to JSON

Collect JSON Lines or NDJSON records into one readable JSON array. Skip blank lines and catch records that do not contain complete JSON values.

Paste one record per line

Each nonblank line must be valid JSON by itself. Objects, arrays and scalar JSON values are accepted.

Avoid pretty-printed records

An object spread over several lines is not a valid single JSON Lines record. Compact those objects before combining them.

Review the collected array

Input records keep their original order. The result uses two-space indentation so nesting is easy to inspect.

Preserve exact identifiers

Represent very large numeric IDs as strings before parsing. Ordinary JavaScript number conversion can otherwise lose precision.

JSON Lines to JSON FAQs

Yes. A backslash-n inside a quoted JSON string is part of that record, rather than a physical record separator.
It returns an empty array because no nonblank JSON records were provided.