Toolvore

JSONL / NDJSON Converter

Convert JSONL or NDJSON to a JSON array and back, preserving number tokens and finding line errors.

This tool runs entirely in your browser. Your data is never uploaded, never stored, and never leaves your device.

JSONL / NDJSON Converter changes one-JSON-value-per-line text into a JSON array, or an array into JSONL, while preserving numeric tokens and keeping processing local.

How to use it

  1. 1Paste text or load an uncompressed UTF-8 file.
  2. 2Choose JSONL → array or array → JSONL, then convert.
  3. 3Fix any reported line error and copy or download the validated result.

Example

Input
{"id":9007199254740993} null
Output
[ {"id":9007199254740993}, null ]

Unsafe-integer digits remain unchanged; null is a valid JSONL record.

What happens to your data

JSON validation and conversion happen in this browser. Source records and output are not uploaded.

Last updated October 2026

JSONL and NDJSON store one JSON value on each line. A JSON array collects those values inside one pair of square brackets. Use this converter when an API expects an array but a log export supplies newline-delimited records, or when a batch processor needs JSON Lines instead of an array. Paste text or load a UTF-8 file, choose the direction, and download the converted text.

Large numeric IDs are easy to damage in an ordinary JSON.parse and JSON.stringify conversion. This tool works from validated source tokens instead: 9007199254740993, exponent spellings, string escapes, duplicate object keys and property order survive. The conversion changes whitespace and the outer record separators, without converting numbers to JavaScript floating-point values.

How it works

JSONL → array validates each physical line separately and identifies a broken line and column. Objects are common records, but arrays, strings, numbers, booleans and null also work. A blank line is rejected, including extra blank lines after the final record. One final LF or CRLF is accepted. A byte order mark is rejected, and an uploaded file must decode as valid UTF-8. A multi-line object belongs in the JSON array mode, not across several JSONL lines.

Array → JSONL requires a top-level array and emits one compact array item per line, followed by a final newline. An empty array creates an empty file with zero records. That empty file is a legitimate export of an empty collection; the reverse conversion asks for at least one record. Nested arrays remain values rather than being flattened. The converter does not decompress .gz files or follow links.

Both directions run locally with a 2 MiB input cap, 10,000 records, 100,000 total JSON tokens and 100 nesting levels. Changing the text or direction removes the previous result immediately. Source files stay on your device; copy or download the result before leaving the page.

Worked example: Keep a numeric ID beyond JavaScript's safe integer range

Input
{"id":9007199254740993} null
Result
[ {"id":9007199254740993}, null ]

The ID keeps its exact digits, and null is a valid second record.

Common use cases

  • Adapting an NDJSON log export to an API that accepts an array
  • Preparing one-record-per-line input for a batch job
  • Inspecting a failed JSONL import with an exact line location
  • Preserving numeric identifiers while changing the surrounding record format

Frequently asked questions

Are JSONL and NDJSON the same format here?+

This tool treats both as newline-delimited JSON values. Choose JSONL / NDJSON → JSON array for either extension. Every line must independently parse as JSON; an extension alone cannot make an invalid record valid.

Why does a blank JSONL line fail?+

A blank line contains no JSON value. Remove it, or use the literal null if your application intends a null record. The tool accepts one final line terminator without treating it as a blank record.

Can JSONL records be numbers or arrays?+

Yes. Each line can hold any JSON value. Array → JSONL writes each top-level array item as one complete value; it does not flatten a nested array.

Will long integers or duplicate JSON keys change?+

No. Numbers and strings keep their original token spellings, and duplicate keys remain present. A downstream system may still round those numbers or collapse duplicate keys when it imports the result; this converter cannot control that system.

Why does my UTF-16 or compressed file fail?+

Uploads must be uncompressed UTF-8 text and no larger than 2 MiB. Export a UTF-8 .jsonl, .ndjson or .json file first. Invalid UTF-8 is rejected instead of being replaced with different characters.