JSONL Validator
Validate JSON Lines (JSONL/NDJSON) format line by line. Convert valid records to a clean JSON array.
What is JSONL (JSON Lines)?
JSONL is a text sequence of JSON values separated by newlines. Each line must parse on its own. That makes append, stream, and line-oriented Unix tools straightforward: you never have to close a top-level array. NDJSON is the same idea under another name. See the JSON Lines specification.
JSON Lines (JSONL), also called NDJSON, is a file where every non-empty line is a complete JSON value — usually an object — with no wrapping [ ] and no commas between rows. This validator splits on newline, runs JSON.parse on each line, and marks it valid or invalid. Empty lines are allowed and skipped; they do not count as errors and they are omitted from the JSON array. Invalid lines stay visible with an error badge so you can fix the exact row. The lower pane copies only the successfully parsed values as a pretty-printed JSON array, in original order, dropping the bad lines. Types are preserved: numbers stay numbers, true stays boolean, unlike CSV converters that emit only strings. Nothing is uploaded. After you have an array, JSON Formatter can minify or inspect it. JSONL is specified at jsonlines.org and is common for logs, ETL dumps, and streaming APIs.
When to use this tool
- Log and event files — Structured logs often write one JSON object per line. Paste a slice and see which row broke the pipeline.
- Streaming and ETL extracts — Export formats that cannot fit a giant JSON array still work line by line. Validate before a bulk import.
- Machine-learning datasets — Many training files are JSONL. This tool checks syntax only — it does not apply a JSON Schema.
- Turn valid rows into an array — Copy the JSON array of good lines into JSON Formatter or a test fixture, leaving broken rows behind. JSON Formatter
How to use the JSONL Validator
Paste JSONL
One JSON value per line. Sample includes four valid objects and one invalid line so you can see both states at once.
Read the line list
Each row shows a line number, a check or cross, and the raw text. Empty lines are dimmed and skipped. Invalid lines show an error label; the tooltip holds the JSON.parse message.
Copy the valid array
The lower textarea is JSON.stringify of parsed objects from valid, non-empty lines, indented with two spaces. Copy places that array on the clipboard.
Fix and re-paste
Edit the broken line in the input — for example add quotes around keys — and the status updates immediately. There is no separate Validate button.
Worked examples
Valid lines plus one invalid line
{"id":1,"name":"Alice","role":"admin"}
{"id":2,"name":"Bob","role":"user"}
{invalid json line here}
{"id":5,"name":"Eve","active":true}[
{
"id": 1,
"name": "Alice",
"role": "admin"
},
{
"id": 2,
"name": "Bob",
"role": "user"
},
{
"id": 5,
"name": "Eve",
"active": true
}
]Line 3 is invalid and is omitted from the array. id values stay numbers; active stays boolean.
Empty lines are skipped, not errors
{"ok":true}
{"ok":false}[
{
"ok": true
},
{
"ok": false
}
]Tips
- Do not wrap the whole paste in [ ] and do not put commas between lines — that is a JSON array, not JSONL.
- Unix newlines (\n) are recommended. A trailing newline does not add an extra record.
- A JSONL file of arrays or strings is valid; each line still has to parse on its own.
- Use JSON Formatter on the copied array when you want sorted keys or minified output.
Frequently Asked Questions
What is JSONL / NDJSON?
A text format where each non-empty line is one JSON value. There is no surrounding array and no comma after each line. JSONL and NDJSON refer to this layout.
Are empty lines allowed?
Yes. Blank lines parse as skipped. They are counted in the line list but they are not errors and they are not added to the JSON array.
Does the array include invalid lines?
No. Only lines that JSON.parse successfully and that are not empty are included, in file order. Fix or delete the others if you need a lossless conversion.
Is this a JSON Schema validator?
No. It only checks that each line is syntactically valid JSON. It will not verify required properties or types beyond what JSON.parse already distinguishes.
Is the file uploaded?
No. Splitting and JSON.parse run in the browser. Log files with customer data stay on the device.