JSON to NDJSON
Converter
The most complete free JSON ↔ NDJSON converter. Convert any JSON array or object into Newline Delimited JSON instantly — with syntax highlighting, live stats, advanced options, line inspector, and one-click download.
Each line is a valid, standalone JSON object
| Property | Value |
|---|---|
| MIME type | application/x-ndjson |
| Extensions | .ndjson .jsonl .ldjson |
| Delimiter | Newline \n (LF, 0x0A) |
| Each line | Valid, complete JSON value |
| Blank lines | Allowed and ignored by parsers |
| Encoding | UTF-8 (required per RFC 8259) |
| Streamable | Yes — process one line at a time |
| Appendable | Yes — just write a new line to the file |
| System | Why NDJSON / JSONL |
|---|---|
| Elasticsearch | Bulk API requires NDJSON format |
| Google BigQuery | JSONL streaming inserts & exports |
| Apache Kafka | Compact, streaming-friendly records |
| MongoDB | mongoimport uses JSONL natively |
| AWS Kinesis | JSON-per-record data streams |
| Apache Spark | Built-in JSONL reader/writer |
| jq / grep / awk | Process each record independently |
| Log pipelines | Append one line per log event |
| Tool | JSON → NDJSON command | Notes |
|---|---|---|
| jq | jq -c '.[]' input.json > out.ndjson | Compact (-c) each array element |
| Python | python3 -c "import sys,json;[print(json.dumps(r)) for r in json.load(sys.stdin)]" < in.json | Works on any OS |
| Node.js | node -e "JSON.parse(require('fs').readFileSync('/dev/stdin','utf8')).forEach(r=>console.log(JSON.stringify(r)))" | Stream-friendly |
| PHP 8+ | array_map(fn($r)=>print(json_encode($r)."\n"), json_decode(file_get_contents('in.json'),true)); | One-liner CLI |
| NDJSON→JSON | jq -s '.' input.ndjson > output.json | Slurp all lines into array |
| Elasticsearch | curl -X POST "es:9200/_bulk" -H 'Content-Type: application/x-ndjson' --data-binary @data.ndjson | Bulk ingest API |
What Is NDJSON and Why Does It Matter?
NDJSON — Newline Delimited JSON — is a text format where every line is a standalone, valid JSON value. Unlike standard JSON arrays that must be fully downloaded and parsed before any record is accessible, NDJSON allows you to process data line by line, enabling true streaming, constant-memory processing, and effortless file appending.
NDJSON vs Standard JSON: Key Differences
Standard JSON stores records inside a single top-level array, requiring the entire document to be loaded into memory at once. NDJSON gives each record its own line, so systems can begin processing the first record while the rest of the file is still being downloaded or generated.
- Streaming: Read and process records one line at a time — no full file load required.
- Appending: Adding new records is as simple as writing a new line — no restructuring needed.
- Partial reads: grep, awk, and jq can filter specific records without reading the whole file.
- Compression: NDJSON gzips extremely well due to repeated key patterns across lines.
- Error isolation: A corrupted line affects only that record, not the entire dataset.
NDJSON vs JSONL vs LDJSON
All three names refer to the exact same format: one complete JSON value per line. .ndjson is common in Node.js and Elasticsearch communities. .jsonl (JSON Lines) is preferred by Google BigQuery, Python's jsonlines library, and Apache Spark. .ldjson (Line Delimited JSON) appears in some older data pipelines. Choose the extension your target system expects — the content is identical.
When Should You Convert JSON to NDJSON?
- Preparing data for Elasticsearch Bulk API indexing
- Uploading records to Google BigQuery via streaming inserts or batch JSONL load jobs
- Feeding records into Apache Kafka or AWS Kinesis topics
- Importing data into MongoDB using
mongoimport --type json - Processing large datasets with jq, Python, or Apache Spark
- Building log ingestion pipelines where each event is appended as a new line
Is This Tool Private and Free?
Yes — completely. All JSON to NDJSON conversion logic runs entirely in your browser using JavaScript. No data is ever sent to any server. You can safely convert confidential payloads, API responses, and production data without any privacy concern. The tool also works offline once the page is loaded.
Frequently Asked Questions
jq -s '.' file.ndjsonMore Free Online Tools
Simple tools. Surgical fixes. Zero friction.
Amazon Connect CCP Log Parser
Parse Amazon Connect CCP logs into structured, searchable diagnostics.
OpenAmazon Connect Agent Workstation Validator
Pre-flight check for Amazon Connect softphone agents.
OpenAmazon Connect Pricing Calculator
Instantly estimate monthly AWS Connect costs — voice, chat, email, campaigns, telephony & more.
OpenConnect CloudWatch Log Analyzer
Drop any Amazon Connect CloudWatch log and get a rich visual breakdown.
Open