JSON to NDJSON Converter Online

Paste a JSON array and emit newline-delimited JSON — one object per line — for streaming pipelines, BigQuery batch loads, and Elasticsearch _bulk. 100% in your browser.

What is a JSON to NDJSON converter?

A JSON to NDJSON converter takes a JSON array and re-emits it as newline-delimited JSON: one complete JSON object per line, no surrounding brackets, no commas. Each line is independently parseable — perfect for streaming consumers, append-only logs, and bulk-load APIs that read one record at a time.

NDJSON (also known as JSON Lines or JSONL) is the format of choice for modern data pipelines: BigQuery batch loads, Elasticsearch _bulk, Loki, Vector, Logstash, and almost every observability tool ingests NDJSON. Converting an array-shaped JSON document into NDJSON is the prep step before you stream it anywhere.

How to convert JSON to NDJSON — 4 steps

  1. Paste a JSON array. Drop the array into the input — exported from a database, Postman, or any API response.
  2. Click Convert. The tool validates that the top-level value is an array, then serialises each item as compact JSON on its own line.
  3. Verify the line count. Confirm the line count matches the original array length — useful for catching missed records.
  4. Copy or pipe. Copy the NDJSON into a file or paste it into bq load, curl --data-binary, or your ingestion script.

Sample input and output

// Input JSON array
[
  { "id": 1, "name": "Alice" },
  { "id": 2, "name": "Bob" },
  { "id": 3, "name": "Carol" }
]
// Output NDJSON
{"id":1,"name":"Alice"}
{"id":2,"name":"Bob"}
{"id":3,"name":"Carol"}

Array Validation

The converter rejects non-array inputs with a clear error so you never accidentally produce single-line garbage.

Line Count Reporting

Every successful conversion shows how many lines were produced — a quick sanity check before piping into ingestion.

Pipeline Ready

Output works directly with BigQuery NEWLINE_DELIMITED_JSON, Elasticsearch _bulk, Loki, Vector, and any tail-able log file.

Common use cases

  • check_circlePreparing data for BigQuery batch loads (sourceFormat NEWLINE_DELIMITED_JSON)
  • check_circleBuilding Elasticsearch _bulk request bodies — though _bulk also needs action lines
  • check_circleStreaming exports into Loki, Vector, Filebeat, or Logstash pipelines
  • check_circleGenerating sample log files for testing observability tooling
  • check_circleSplitting a large JSON dump into per-record lines for parallel processing
  • check_circleConverting database query results for line-oriented Spark or Flink ingestion
  • check_circleProducing fixtures for data science notebooks that read line-delimited records
  • check_circleSerialising telemetry events that downstream collectors consume one at a time

JSON arrays vs NDJSON

A regular JSON array is a single self-describing document — you parse it once and have every record. NDJSON trades that compactness for streamability: each line is a complete record, so a consumer can read constant memory regardless of total size, and a producer can append without rewriting the file. For datasets that fit in memory and travel as a single payload, JSON arrays are simpler. For logs, events, and append-only pipelines, NDJSON is the right choice.

Round-trip and explore NDJSON

Need to go the other way, view records as a tree, or validate before ingesting? Use the rest of the toolkit.

Frequently Asked Questions

What is NDJSON?

NDJSON (newline-delimited JSON), also called JSON Lines or JSONL, is a format where each line is a complete, independent JSON value — usually an object. There are no surrounding brackets or commas. It is the de facto standard for log files, streaming pipelines, and bulk-load APIs because each line can be parsed independently without holding the whole document in memory.

When should I use NDJSON over a JSON array?

Use NDJSON when records arrive over time (logs, events, telemetry), when you need to append without rewriting the whole file, when downstream consumers stream rather than load, or when a tool explicitly requires it (BigQuery batch loads, Elasticsearch _bulk, Loki, Vector). Use a regular JSON array when you want a single self-describing payload that fits in memory.

What are the streaming benefits?

NDJSON is line-oriented, so a parser only needs one line at a time — constant memory regardless of total file size. Producers can flush each record immediately without waiting for the array to close. Consumers can resume from any line after a failure. Compression ratios are usually similar to a regular JSON array because the redundant structure is identical.

Is JSON Lines the same as NDJSON?

Effectively yes. JSON Lines (jsonlines.org) and NDJSON (ndjson.org) define the same format: UTF-8 encoded, one JSON value per line, terminated by \n. The .jsonl and .ndjson extensions are interchangeable in practice. Some specs mandate that lines must be objects; others allow any JSON value — but most real-world usage assumes objects.

How does BigQuery use NDJSON?

BigQuery batch loads accept NDJSON natively (sourceFormat NEWLINE_DELIMITED_JSON). Each line is parsed as one row, with field names mapped to the table schema. This is faster and cheaper than uploading a single huge JSON array — and it is required for streaming inserts.

How does Elasticsearch use NDJSON?

The Elasticsearch _bulk API expects NDJSON: alternating action lines and document lines, separated by newlines. Logstash, Filebeat, and Vector also write NDJSON to disk before forwarding, because it is append-friendly and easy to tail.

Are there any downsides to NDJSON?

NDJSON cannot represent a single top-level non-object value (like an array of arrays) cleanly, and it is unfriendly to humans browsing in a text editor — every record is on a single long line. Regular JSON with indentation is more readable for small documents.

Is my JSON sent to your servers?

No. Conversion runs in JavaScript inside your browser. Open DevTools and check the Network tab when you click Convert — no requests are made. Logs and exports often contain user data; this tool keeps them on your device.

JSON to NDJSON Converter Online — Free Newline-Delimited JSON