Code Formatting

JSON Lines Validator

Validate and normalize JSONL/NDJSON line by line or convert it to a JSON array.

JSON Lines / NDJSON
Each non-empty line must contain one complete JSON value.
0Non-empty lines
0Valid lines
0Invalid lines
0Input characters
Validation and output
Output will appear here after validation.

JSON Lines Validation

JSONL, also called NDJSON, stores one complete JSON value per non-empty line. This tool reports line-level errors and produces normalized JSONL or a regular JSON array.

Boundaries

  • Blank lines are ignored
  • A single JSON value cannot span multiple lines
  • Object keys can be sorted recursively without reordering arrays

Frequently Asked Questions

JSON Lines vs a plain JSON array — what is the difference?
Each JSONL line is a complete, independent JSON value that can be parsed in a stream — the standard for logs, LLM training corpora, and batch exports. A JSON array must be fully loaded before parsing. JSONL also supports appending: add a line without rewriting the file.
Line N failed validation — how do I see why?
The tool parses line by line and reports the line number and cause (usual suspects: trailing commas, unescaped newlines inside strings, multiple objects on one line). Note a JSONL value cannot span lines — pretty-printed objects must be minified to a single line first.
How do I convert a JSON array to JSONL?
This tool converts both ways: each array element becomes one line. Many stream-processing tools (Spark, pandas streaming readers) only accept JSONL, so the conversion is a staple of data pipelines.