NDJSON to JSON Converter
Convert newline-delimited JSON (NDJSON / JSONL) to a standard JSON array in your browser. Nothing uploaded.
Pure browser JavaScript (uses the built-in JSON parser).
How to use this tool
- Paste NDJSON — one JSON object per line.
- Click Convert to JSON Array.
- Copy or download the resulting JSON.
Convert newline-delimited JSON (NDJSON / JSONL) to a standard JSON array in your browser. Nothing uploaded.
How it works
NDJSON (Newline-Delimited JSON), also called JSONL, is a format where each line of a file is a separate, complete JSON object. It is popular for streaming data, log files, and large dataset exports because each record can be read independently without loading the entire file.
This converter reads your NDJSON input line by line, parses each line as a JSON object, and wraps all of them into a standard JSON array. The result can be used with tools and libraries that expect a single JSON array rather than a stream of individual records.
Blank lines and lines that fail to parse are skipped with a warning, so partial or truncated exports still produce a usable output. The conversion runs entirely in your browser — nothing is sent to a server.
Typical use cases include converting log exports from Elasticsearch or MongoDB, transforming data pipeline outputs, and preparing JSONL files for import into tools that only accept standard JSON arrays.
Worked example
Convert a MongoDB export to a JSON array
- Run mongoexport --collection=orders --out=orders.jsonl to get an NDJSON file.
- Open orders.jsonl in a text editor and copy its contents.
- Paste into the NDJSON to JSON converter.
- Click Convert.
- Copy the resulting JSON array and import it into your target tool.
A single valid JSON array containing all MongoDB documents, ready for tools that do not support NDJSON.
Common mistakes to avoid
- Pasting a standard JSON array (starting with [) instead of NDJSON — the converter expects one JSON object per line, not a single wrapped array.
- Including a header comment line at the top of the file; this is not valid NDJSON and will cause that line to be skipped.
- Assuming the output preserves the insertion order of keys within each object — JSON parsers are not required to maintain key order.
Key terms
- NDJSON / JSONL
- Newline-Delimited JSON — a file format where each line is a self-contained JSON object, making it suitable for streaming and large datasets.
- JSON array
- A JSON value that is an ordered list of items enclosed in square brackets, e.g. [{...}, {...}].
Frequently asked questions
- What is NDJSON?
- Newline-Delimited JSON (NDJSON / JSONL) stores one JSON object per line, common in log files and streaming APIs.