JSONL Formatter
Format, validate, and inspect JSON Lines (JSONL / NDJSON). One JSON object per line.
Drop a .jsonl / .ndjson file or click to browse
JSONL / NDJSON Formatter and Validator
JSON Lines (JSONL) and NDJSON (Newline Delimited JSON) are formats where each line is a valid JSON value. They are common in log files, data pipelines, and streaming APIs. Paste text or drop a .jsonl/.ndjson file, then validate each line independently, pretty-print records, minify for compact storage, convert the whole stream to a JSON array, or extract a specific key across all records (like a simple jq, with nested.key and items.0 array indexing). Copy or download the result. Everything runs locally in your browser.
Built and maintained by Meet Shah · Last updated
What this tool is used for
- Finding which line in a large export fails to parse, when the loader only reports a record count.
- Pretty-printing one record out of a log file to read it properly.
- Extracting a single key across every record to scan for an outlier.
- Confirming a file is line-delimited JSON rather than a JSON array before feeding it to a tool.
- Checking that no record spans more than one line, which is the format's whole contract.
Frequently Asked Questions
- What is JSONL and why use it?
- One complete JSON value per line, newline-delimited. It streams: a reader can process a 50 GB file line by line without holding it in memory, and a writer can append a record without rewriting the file — neither of which a single JSON array allows.
- Can a record span multiple lines?
- No, and that is the one rule. Each line must be a self-contained JSON value with no embedded raw newlines — inside a string they must be escaped as `\n`. A pretty-printed object breaks the format immediately.
- Is it the same as NDJSON?
- Effectively yes — JSON Lines, NDJSON and "JSON stream" all describe the same shape, with minor disagreements about trailing newlines and the media type. Anything that reads one reads the others.
- Where will I run into it?
- Log pipelines, BigQuery and Snowflake bulk loads, machine-learning training sets, OpenAI fine-tuning files, and `docker logs`. Anywhere records arrive continuously and nobody wants to close an array bracket.
- How do I inspect a huge JSONL file?
- Line tools work directly: `head -n 5 file.jsonl` shows the first records, `wc -l` counts them, and `jq -c` keeps output one-per-line. That compatibility with ordinary Unix tooling is most of why the format exists.
- Which encoding and line ending should a JSONL file use?
- UTF-8 with `\n`. The format assumes one record per newline, so a `\r` left on the end of each line becomes trailing whitespace after the closing brace — tolerated by many parsers, rejected by strict ones.
Common errors and gotchas
- Wrapping the records in an array. That makes it JSON, not JSONL, and streaming consumers will reject it.
- Pretty-printing the whole file, which puts newlines inside records and breaks the format entirely.
- Leaving a trailing blank line that a strict parser reads as an empty record.
- Assuming every record has the same keys. The format allows heterogeneous objects and often carries them.
- Adding commas between lines, which is the single most common conversion mistake from JSON.
Related Formatters & Validators tools
JSON Formatter
Format, validate, and beautify JSON payloads.
Text Diff / Compare
Side-by-side or unified line/character diff comparison tool.
XML Formatter
Beautify and indent XML strings.
Minifier Suite
Minify HTML, CSS, and JS by stripping comments and whitespace.
Markdown Converter
Convert Markdown to HTML with live preview.
CSS Formatter
Beautify and indent minified or messy CSS.
HTML Formatter
Beautify and indent raw HTML markup.
SQL Formatter
Format SQL queries with keyword casing and indentation.