NDJSON Converter

What is a NDJSON Converter?

Convert between NDJSON (Newline Delimited JSON / JSON Lines / `.jsonl`) and standard JSON arrays (`[...]`). Formats line-delimited log streams into readable JSON arrays and flattens arrays back into NDJSON streams.

Why Use This Tool?

  • Log File Analysis: Convert server log files (Datadog, Elasticsearch, AWS CloudWatch `.jsonl` logs) into JSON arrays for inspection.
  • AI & Dataset Fine-Tuning: Format OpenAI, Anthropic, or HuggingFace training datasets stored in `.jsonl` format.
  • Big Data Stream Export: Convert large database stream dumps between line-by-line NDJSON and standard JSON.

How to Use

  1. Paste NDJSON / JSON Lines text (one JSON object per line) or JSON Array.
  2. Select Mode: "NDJSON to JSON Array" or "JSON Array to NDJSON".
  3. Copy converted output or download as `.jsonl` / `.json` file.

Real Working Example

Input:

NDJSON Input:
{"id":1,"name":"Alice"}
{"id":2,"name":"Bob"}

Output Result:

JSON Array Result:
[
  {
    "id": 1,
    "name": "Alice"
  },
  {
    "id": 2,
    "name": "Bob"
  }
]

Important Technical Details & Specifications

  • RFC 7464 Line-Delimited Specs: Follows official RFC 7464 and jsonlines.org standards.
  • Streaming Line-by-Line Parsing: Processes large log files line-by-line, skipping empty lines and tracking syntax errors by line number.
  • Client-Side Engine: Fast in-browser line conversion.

Related Data & Format Tools

Frequently Asked Questions

What is NDJSON (JSON Lines)?

NDJSON (Newline Delimited JSON) is a format where each line is a valid individual JSON value separated by a newline character (\n).

Why is NDJSON preferred for large log files and AI training datasets?

NDJSON allows large data streams to be parsed and appended line-by-line without loading the entire JSON array into memory.

What is the file extension for JSON Lines?

Common file extensions are `.jsonl`, `.ndjson`, or `.ldjson`.

Is it free?

Yes, 100% free.

Are my log files uploaded to a server?

No, all NDJSON conversion happens 100% locally in your web browser.

How does it handle invalid JSON syntax on a specific line?

It highlights the exact failing line number and displays line-by-line syntax error messages.