Convert JSON to NDJSON
Write a JSON array as newline-delimited JSON with one compact record per line, saved as a .ndjson file. It runs in your browser, so your records never leave your device.
- Free to use
- Local processing
- Saves as .ndjson
- One record per line
- Runs on your device. Files are never uploaded.
- Free and unlimited. No sign-up, no watermark.
JSON to NDJSON in three steps
No account, no email, no waiting for an upload.
- STEP 01
Paste or open your JSON
Provide an array of records, or a single object.
- STEP 02
Convert
Each array item is written as compact JSON on its own line. There are no options to set.
- STEP 03
Copy or download the .ndjson file
The note shows how many lines were written.
What JSON to NDJSON does, and what it doesn't
We'd rather tell you up front than surprise you after the download.
What you get
- Extension that matchesThe download is named with .ndjson, which some tools and upload forms require.
- Compact recordsWhitespace between tokens is removed so each record sits on a single line.
- Any array itemObjects are typical, but strings, numbers and nested lists are also written as lines.
- Single objects tooAn object that is not inside a list becomes a file with one line.
- Instant line countCheck the count against your source so you know nothing was dropped.
Good to know
- Input must be one valid JSON documentIf the file already has one record per line, go back with NDJSON to JSON.
- Bulk APIs may need extra linesSome bulk endpoints, such as Elasticsearch, expect an action line before each record. Add those lines yourself.
- Very large inputsSize is limited by your device's memory. Split giant arrays first.
Your data never leave your device
The tool runs inside your browser instead of on our servers, so there is nothing to upload, store or delete afterwards.
Typical online tool upload
Your file travels over the internet, sits on someone else's computer for a while, and you wait for the upload and the download.
Mediaextractr no upload
The tool loads into your browser once, then works on your file locally. Nothing is sent, so nothing can leak.
When people use JSON to NDJSON
Prepare a bulk import
Many search and analytics systems ingest NDJSON.
Create streaming fixtures
Test a line-by-line reader with realistic data.
Export logs in a friendly shape
Append-only files are easy to grow and split.
Hand data to a pipeline
Tools like jq, Unix utilities and data frames read it line by line.
Mediaextractr vs typical upload tools
| MediaextractrPrivate | Typical upload tools | |
|---|---|---|
| Your file is uploaded | Never | Yes |
| Sign-up needed | No | Often, after a few files |
| Daily file limit | None | Often 1–2 free files |
| Watermark | Never | Sometimes |
| Wait for upload & download | No | Yes |
| Speed on very large files | Depends on your device | Depends on their servers |
What NDJSON is
NDJSON stands for newline-delimited JSON. Each line holds one complete JSON value, and lines are separated by a line feed. There is no outer array and no commas between records.
The idea is simple but useful. A program can read, process and discard one line at a time, so it never needs the whole file in memory.
NDJSON, JSONL and JSON Lines
These names describe the same layout. The differences are mostly the file extension and the spec page a project links to. This page writes .ndjson. If a tool expects .jsonl, use JSON to JSON Lines.
- Check the output with the JSON validator by pasting one line.
- Convert the lines into a table with JSON to CSV.
- Return to a single array any time with NDJSON to JSON.
Using NDJSON in practice
Most readers expect a final line feed and UTF-8 text without a byte order mark. For Elasticsearch bulk requests, add an action line such as an index instruction before each record. For streaming parsers, check that no record contains raw line breaks inside strings, which this converter always escapes.
Questions, answered
How do I convert a JSON array to NDJSON?
Paste the array. Each item is written as one compact line, and you can copy or download the .ndjson file.
Is NDJSON the same as JSONL?
They describe the same line-per-record format. Only the file extension and naming differ.
Are my records uploaded while converting to NDJSON?
No. Every line is written by script in your own browser tab.
Can I use the file for Elasticsearch bulk?
The records are ready, but its bulk API also needs an action line before each record, which you must add.
What if my input is not a list?
A single object or value becomes one line.
Does it work in an Android or iOS browser?
Yes, in current Chrome and Safari, with the usual memory limits for very large input.