Ready to convert
Paste NDJSON and click Convert// wrap newline-delimited json into a standard array
Convert newline-delimited JSON (NDJSON/JSONL) into a standard JSON array instantly. Validate, wrap, and format your records with one click.
Ready to convert
Paste NDJSON and click ConvertPaste your newline-delimited JSON data into the input box — one record per line.
Toggle pretty-print to format the output, or keep it compact for production.
Click Convert, then copy or download your standard JSON array.
NDJSON (Newline Delimited JSON) and JSONL are formats where each line is a self-contained JSON record. This tool wraps all records into a standard [] JSON array — the format expected by most REST APIs, JavaScript parsers, and data tools.
NDJSON (Newline Delimited JSON) is a format for storing structured data where each line is a valid, independent JSON object. It's commonly used for log files, streaming APIs, and large dataset exports because each record can be processed independently without loading the entire file.
NDJSON and JSONL (JSON Lines) are effectively the same format — both store one JSON object per line separated by newline characters. JSONL is the more commonly used term in AI/ML workflows, while NDJSON is used in log processing and streaming contexts. This tool handles both identically.
This tool runs entirely in your browser, so performance depends on your device. For very large files (hundreds of MB), a command-line tool like jq will be faster. For typical datasets up to a few MB, the browser conversion is instant and reliable.
The converter validates every line. If a line contains malformed JSON, you'll see an error message specifying which line number caused the problem, along with the exact parse error. This lets you quickly identify and fix issues before converting.
No. All conversion happens entirely in your browser using JavaScript. Your NDJSON data never leaves your machine. The tool also works offline once loaded.
Pretty print formats the output JSON array with 2-space indentation and newlines, making it human-readable. Disabling it produces a compact, single-line JSON array — smaller in size and better for programmatic use or API payloads.
Converting newline-delimited JSON (NDJSON or JSONL) to a standard JSON array is one of the most common data transformation tasks in modern development. Whether you're processing log exports, preparing AI training data, or handling streaming API responses, this free browser-based tool makes the conversion instant and error-free.
💡 Looking for premium web development assets? MonsterONE offers unlimited downloads of templates, UI kits, and developer tools — worth checking out.
Newline-Delimited JSON (NDJSON) is a text format for storing structured data where each line is a complete, valid JSON value — typically an object or array. Unlike standard JSON, NDJSON doesn't wrap all records in a top-level container, which makes it ideal for streaming, log processing, and incremental file reading.
The format is also known as JSONL (JSON Lines), and you'll encounter it in many real-world systems:
mongoexport outputs NDJSON by defaultWhile NDJSON is efficient for streaming and storage, most REST APIs, frontend libraries, and data processing tools expect a standard JSON array [{...}, {...}, {...}]. Converting NDJSON to a JSON array lets you:
JSON.parse() directlyjq, Python's json module, or any JSON schema validatorThe conversion is conceptually simple: split the input on newlines, parse each line as JSON, collect the results into an array, then serialize the array back to a string. In JavaScript:
const lines = ndjson.trim().split('\n').filter(Boolean);
const array = lines.map(line => JSON.parse(line));
const output = JSON.stringify(array, null, 2);
Our online tool does exactly this, with the added benefits of per-line error reporting, pretty-print toggle, and a download button — all without sending your data anywhere.
Yes, for most practical purposes. NDJSON and JSONL refer to the same underlying format: one JSON value per line, separated by \n. The NDJSON specification (ndjson.org) formally defines the format, while JSON Lines (jsonlines.org) is a community specification with essentially identical rules. The file extensions .ndjson and .jsonl are interchangeable, and this converter handles both.
One of the most valuable features of this converter is per-line JSON validation. A common source of bugs in NDJSON pipelines is a single malformed line — perhaps a truncated record from a crashed writer, or an escaped quote issue in a string field. This tool validates each line independently and reports exactly which line number failed and why, so you can fix the source data before it propagates errors downstream.
The pretty-print option controls indentation in the output JSON array. When enabled, the output uses 2-space indentation, making it easy to read and debug. When disabled, the output is a compact single-line (or minimally spaced) JSON string — smaller in bytes and faster to parse programmatically. For API payloads and production use, compact output is generally preferred. For debugging and documentation, pretty print is the better choice.
For large files or automated pipelines, the jq command-line tool provides a powerful alternative. To convert NDJSON to a JSON array using jq:
jq -s '.' input.ndjson > output.json
The -s (slurp) flag reads all input records and collects them into a single JSON array. For compact output, add -c. Our online tool is ideal for quick, one-off conversions — for batch processing or CI/CD pipelines, jq or Python scripts will scale better.