ToolHarbor

NDJSON Converter

Convert between JSON arrays and NDJSON (Newline Delimited JSON). Transform JSON Lines data instantly.

Features

  • Convert JSON arrays to NDJSON (one object per line)
  • Convert NDJSON back to JSON arrays
  • Validates each line independently with line-specific errors
  • Swap between modes instantly
  • Works entirely offline — your data never leaves your browser
  • Copy result with one click

How to Use

  1. 1Choose "JSON → NDJSON" or "NDJSON → JSON" mode
  2. 2Paste your data into the input field
  3. 3Click "Convert" to transform the data
  4. 4Use the swap button to reverse input and output
  5. 5Copy the result with the Copy button

Examples

JSON array to NDJSON

Input

[{"name":"Alice","age":30},{"name":"Bob","age":25}]

Output

{"name":"Alice","age":30}
{"name":"Bob","age":25}
NDJSON to JSON array

Input

{"id":1,"status":"active"}
{"id":2,"status":"inactive"}

Output

[
  {"id":1,"status":"active"},
  {"id":2,"status":"inactive"}
]

What Is NDJSON?

NDJSON (Newline Delimited JSON), also known as JSON Lines or JSONL, is a format where each line is a valid JSON value, typically a JSON object. Unlike a JSON array, NDJSON does not wrap items in brackets or separate them with commas — each line stands alone as independent JSON. This makes it ideal for streaming, logging, and processing large datasets line by line.

The key advantage of NDJSON over JSON arrays is that it can be processed incrementally. You can read, write, or stream one record at a time without loading the entire file into memory. This makes NDJSON the standard format for log files, data pipelines (like BigQuery, Elasticsearch bulk API), machine learning datasets, and any system that handles millions of records.

Converting from a JSON array to NDJSON is straightforward: take each element of the array and serialize it on its own line. Converting from NDJSON to a JSON array collects all the lines and wraps them in an array. This tool validates each line independently, so if one line contains invalid JSON, it reports the exact line number.

Common file extensions for NDJSON include .ndjson, .jsonl, and .jl. Many tools support this format natively: jq, pandas (read_json with lines=True), Node.js streams, and most data engineering platforms. If your tool expects a JSON array but your data is in NDJSON (or vice versa), this converter handles the transformation instantly.

All processing happens in your browser. Your data — log entries, API records, or dataset rows — is never uploaded to any server. Paste, convert, and copy.

Frequently Asked Questions

Related Tools