Convert JSON Lines (JSONL, NDJSON) into a standard JSON array, or turn a JSON array into one JSON object per line. Invalid lines are listed with their line number and the exact problem, and large files are streamed so they convert without freezing the page.
Last updated:
Runs in your browser. Nothing is uploaded.
Reading…
Preview
Advertisement
Advertisement
How to use the JSONL to JSON Converter
Pick the direction: JSONL → JSON or JSON → JSONL.
Paste your data or open a file (.jsonl, .ndjson or .json). You can also drop the file on the input box.
Check the report: the summary shows how many records were converted, and any invalid lines are listed. Click a line to jump to it.
Choose the formatting: indentation for JSON, or which array to export and whether to sort keys for JSONL.
Download or copy the result.
JSONL vs JSON at a glance
JSON Lines (.jsonl, .ndjson)
JSON array (.json)
Structure
One JSON value per line, separated by \n
One value; records sit inside [ … ] separated by commas
Example
{"id":1} {"id":2}
[{"id":1},{"id":2}]
Append a record
Write one more line
Rewrite the closing bracket
Read huge files
Line by line, low memory
Usually needs the whole file in memory
Typical uses
Logs, ML datasets, BigQuery / Elasticsearch bulk loads, API streaming
Config files, API responses, web apps
Common JSONL errors and how to fix them
Trailing comma such as {"a":1,}: JSON does not allow a comma before } or ]. Remove it.
Single quotes such as {'a':1}: keys and strings must use double quotes.
A record split over several lines: in JSONL each value must sit on one line. Pretty-printed objects show up as many invalid lines; convert them with the JSON → JSONL direction instead.
Comma at the end of each line: lines copied out of a JSON array often end with ,. Remove the commas or paste the whole array into JSON → JSONL.
Unescaped line breaks inside strings: a newline inside a value must be written as \n.
Want to inspect the result? Open it in the JSON Viewer, or turn the records into a spreadsheet with JSON to CSV.
Frequently asked questions
What is a JSONL file?
JSONL (JSON Lines), also called NDJSON (newline-delimited JSON), is a text format where every line is one complete JSON value, usually an object. It is popular for logs, data exports, BigQuery and Elasticsearch bulk loads, and machine-learning datasets because files can be read and appended one line at a time.
How do I convert JSONL to a JSON array?
Paste the JSON Lines or open the .jsonl file with JSONL → JSON selected. Each non-blank line is parsed and placed in a JSON array, in the original order. Download the result as a .json file or copy it.
What happens to invalid lines?
With Skip invalid lines ticked (the default), lines that are not valid JSON are left out and listed with their line number, column and the parser's reason, for example a trailing comma or a missing quote. Untick it to stop at the first invalid line instead.
Can it handle very large JSONL files?
Yes. Files over 4 MB are read as a stream, a chunk at a time, so the page stays responsive and shows progress. The converted output is assembled in memory, so files of several hundred MB work on a typical computer.
How do I convert a JSON array to JSONL?
Choose JSON → JSONL and paste the array. Each item becomes one minified line. If the JSON is an object such as {"data": [...]}, the largest array inside it is used automatically, or you can type a path like data.items.
Are blank lines allowed in JSONL?
The JSON Lines format expects one value per line, but blank lines are common in real files. They are ignored and counted separately in the summary, so they never cause an error.
Is my data uploaded?
No. The conversion runs entirely in your browser with JavaScript. Your files and text are never sent to a server.
Are all the tools on FreeToolCabin tested for quality and accuracy?
Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.