NDJSON / JSON Lines Converter
Convert JSON arrays to NDJSON (JSONL) and back, with line-by-line validation.
About this tool
Paste data or open a .json, .jsonl or .ndjson file. The direction is detected automatically, or you can pick it. Converting to NDJSON writes one compact record per line. Converting back builds a pretty or compact array, and any invalid lines are listed with their line numbers and the error, with an option to skip them. Copy or download the result.
What NDJSON and JSON Lines are for
NDJSON (newline-delimited JSON) and JSON Lines (.jsonl) are the same simple idea: one complete JSON value per line, with no surrounding array and no commas between records. Because every line stands on its own, a program can stream a huge file one record at a time, append new records without rewriting the file, and skip a corrupt line without losing the rest. That's why it's used for application logs, BigQuery and Snowflake loads, Elasticsearch and OpenSearch bulk APIs, MongoDB exports, OpenAI fine-tuning and batch files, and many data pipelines. Converting a JSON array to NDJSON writes each element compactly on its own line. If the JSON is an object holding a single array, such as {"items": [โฆ]}, that array is used. Converting back parses each line separately, so a syntax error affects only its own line. You'll see its line number and the error message, and blank lines are ignored. A record can't contain a raw line break, so pretty-printed objects spread over several lines aren't valid NDJSON, and that's the most common mistake. Honest limits: a browser tab can handle tens of megabytes comfortably, but very large files are better split or converted with command-line tools such as jq. The JSON formatter, CSV to JSON and JSON to CSV are related, and What JSON is, and where it trips people up covers JSON itself.
Frequently asked questions
What is the difference between NDJSON and JSON Lines?
Practically none. Both put one JSON value per line, separated by newlines. The .jsonl extension is common for JSON Lines, and application/x-ndjson is the media type for NDJSON.
How do I convert JSONL to a JSON array?
Paste the lines here and choose NDJSON โ JSON array. Each line is parsed and collected into one array.
Why is my JSONL file invalid?
Usually because a record spans several lines or a line has a trailing comma. The validator lists each bad line with its number.
Is my file uploaded?
No. Files are read and converted on your device and never uploaded.