Tools
JSON & CSV

JSON Lines / NDJSON Formatter

Paste a JSON Lines (NDJSON) document — one JSON object per line — and this tool validates every entry and pretty-prints it. Errors are reported per line, so you instantly find the broken record in large files. Great for logs, event streams, and ndjson exports.

100% Client-Side — Your Data Never Leaves Your Browser

What is JSON Lines / NDJSON Formatter?

Pretty-print and validate NDJSON/JSON Lines data line by line. Paste a JSON Lines (NDJSON) document — one JSON object per line — and this tool validates every entry and pretty-prints it. Errors are reported per line, so you instantly find the broken record in large files. Great for logs, event streams, and ndjson exports. The tool runs 100% in your browser — nothing is uploaded to a server, so your data stays private, and it is free to use with no signup required.

Quick Answers

What is JSON Lines (NDJSON)?
JSON Lines is a format where each line is a self-contained, valid JSON value, separated by a newline. It is ideal for streaming and large logs because records can be processed one at a time.
What happens when one line is invalid?
The tool reports the exact line number and character position of the first invalid record, along with the failing line, so you can fix the export quickly.
Can I turn a pretty JSON file into JSON Lines?
Use the related formatter tools here to compact the data first, then split so each object sits on its own line.
0 chars
0 chars

How to use JSON Lines / NDJSON Formatter

  1. Paste your JSON Lines / NDJSON data, one object per line.
  2. Each valid line is validated and pretty-printed; the first invalid line is flagged by number.
  3. Copy the formatted output or download it as a file.

Why use our json lines / ndjson formatter?

JSON Lines (also called NDJSON or newline-delimited JSON) is the format used by log exporters, event pipelines, Elasticsearch bulk APIs and BigQuery export files. Working with it is harder than single-document JSON because one bad record can stop an entire import. This formatter splits your document into individual lines, parses each one, reports the exact line number of the first invalid entry, and pretty-prints every valid record with two-space indentation. The summary header shows how many lines were valid. All processing stays in your browser.

Single-document JSON vs JSON Lines (NDJSON)

JSON Lines stores one JSON value per line instead of one big tree. Understanding the difference explains why NDJSON 'fails line by line' and why the formatter reports by line number.

AspectSingle JSON documentJSON Lines (NDJSON)
StructureOne hierarchical tree in one blockMany independent values, one per line
StreamingWhole document must be parsedRecords can be processed one by one
Failure modeOne error invalidates the whole fileBad records isolated to their own line
Typical useAPI payloads, config filesLogs, event streams, BigQuery/Elasticsearch
Human diffingWhole-tree diffLine-based diffs work naturally

Repairing a BigQuery or log export with one bad record

JSON Lines files from logs, BigQuery exports and event pipelines fail completely when a single line is malformed. This formatter flags the offending line number so you can repair that one record.

JSON Lines input

{"event":"click","user":"alice","ts":1770000000000}
{"event":"view","user":"bob","ts":1770000000001}
{"event":"purchase","user":"alice","ts":1770000000002,}
{"event":"signup","user":"carol","ts":1770000000003}

Validator report

2 of 4 lines are valid JSON before the error on line 3.

Invalid JSON on line 3: Unexpected token }, ... (at character 58)

Line content:
{"event":"purchase","user":"alice","ts":1770000000002,}

Remove the trailing comma on line 3 and re-run to see all four records pretty-printed.

Paste a JSONL/NDJSON export from a log pipeline, BigQuery, or Elasticsearch bulk file — find and fix the single broken record instead of hunting through thousands of lines.

Frequently Asked Questions