Why combine NDJSON into a single JSON array?
Many tools, libraries, and humans expect a single, self-describing JSON document. Once you have a finite NDJSON file you want to inspect in a JSON viewer, paste into a UI, send as a request body, or load in a notebook with json.load, the array form is much more convenient. NDJSON is a streaming format — JSON arrays are the in-memory destination.
What about performance?
For files that fit in memory, performance is excellent — the converter parses each line independently and pushes into an array. Conversion is roughly linear in input size. For multi-gigabyte NDJSON files, do not paste them into a browser tool; use a streaming converter like jq -s or a small Node.js script that reads line by line.
What if a line has invalid JSON?
The converter aborts and reports the exact line number that failed. Common causes: a trailing comma left over from a JSON array, an unescaped newline inside a string, or accidentally pasted whitespace. Empty lines are tolerated and skipped automatically.
Does it preserve record order?
Yes. The output array contains the records in the same order they appear in the NDJSON input — line 1 becomes index 0, line 2 becomes index 1, and so on. This matters for time-ordered logs and event streams where ordering carries meaning.
Compact vs pretty output — which should I pick?
Use compact when you are about to send the JSON over the wire or commit it as a fixture — every byte counts. Use pretty (2-space indent) when you want to read or diff the output in a code review or share it with humans. Both produce identical structure; only the whitespace differs.
What if the NDJSON has trailing commas or commented lines?
NDJSON specifies that each line must be valid JSON, which forbids trailing commas and comments. If your input has either, run it through a pre-processor first or hand-clean it — the strict parser will surface the offending line so you can fix it.
Can I paste a mix of objects and arrays?
Yes. Each line is parsed independently as any JSON value, so you can mix objects, arrays, numbers, strings, and booleans line by line. The output array preserves the exact value of each line. Most real NDJSON contains only objects.
Is my NDJSON sent to your servers?
No. Parsing and array assembly run in JavaScript inside your browser. Open DevTools and check the Network tab when you click Convert — no requests are made. Logs and event exports often contain user data; this tool keeps them on your device.