NDJSON Converter

Convert NDJSON (Newline Delimited JSON / JSONL) to a JSON array, or a JSON array back to NDJSON. Free, private, runs entirely in your browser.

Open NDJSON Converter →

What is NDJSON?

NDJSON (Newline Delimited JSON), also called JSONL (JSON Lines), is a text format where each line is a complete, valid JSON object. Unlike a regular JSON array, there is no wrapping [ ] and no commas between records — just one JSON object per line.

NDJSON example:

{"id": 1, "name": "Alice", "role": "admin"}
{"id": 2, "name": "Bob", "role": "user"}
{"id": 3, "name": "Carol", "role": "user"}

Equivalent JSON array:

[
  {"id": 1, "name": "Alice", "role": "admin"},
  {"id": 2, "name": "Bob", "role": "user"},
  {"id": 3, "name": "Carol", "role": "user"}
]

NDJSON vs JSON — When to Use Each

Use Case Best Format Reason
API responsesJSON arrayStandard, easy to parse
Log filesNDJSONAppend one line at a time
BigQuery / data exportsNDJSONRequired format for bulk load
Elasticsearch bulk APINDJSONRequired by the API spec
ML training datasetsNDJSON / JSONLStream line by line, memory efficient
Config filesJSONEasier to read and edit
OpenAI fine-tuningJSONLRequired format for training files

How to Convert NDJSON to JSON

  1. Click "Open NDJSON Converter" above
  2. Paste your NDJSON data (one JSON object per line)
  3. Select "NDJSON → JSON Array" mode
  4. Click Convert — the output is a standard JSON array
  5. Copy or download the result

To go the other direction (JSON array to NDJSON), select "JSON Array → NDJSON" mode and paste your JSON array.

Frequently Asked Questions

What file extension does NDJSON use?

NDJSON files use the .ndjson or .jsonl extension. Both are identical in format. Google BigQuery documentation uses .ndjson, while the JSON Lines specification uses .jsonl. Most tools accept both extensions.

How do I parse NDJSON in Python?

Read the file line by line and parse each line as JSON:

import json
with open('data.ndjson') as f:
    records = [json.loads(line) for line in f if line.strip()]

How do I parse NDJSON in JavaScript / Node.js?

const records = fs.readFileSync('data.ndjson', 'utf8')
  .split('\n')
  .filter(line => line.trim())
  .map(line => JSON.parse(line));

Why does BigQuery require NDJSON instead of JSON?

BigQuery processes data in parallel across many workers. NDJSON allows each worker to read a chunk of lines independently without needing to parse the entire file structure first. A JSON array requires knowing where the array starts and ends, which prevents efficient parallel processing of large files.

Convert your NDJSON now

Free, instant, 100% private. No account needed.

Open NDJSON Converter →

Also useful: JSON Formatter | JSON to CSV | JSON to XML | JSON Diff | JSON Validator