NDJSON ↔ JSONL Converter
NDJSON and JSONL are the same format — one JSON value per line, separated by \n. There is nothing to "convert" at the content level, only to normalize (strip BOM, fix line endings, drop blank lines) and to download with the file extension your downstream tool expects.
100% client-side. Your data never leaves this page — no upload, no server.
Normalize & convert
Normalized output
NDJSON ↔ JSONL Converter
Drop an NDJSON file, normalize it (BOM, line endings, blanks, optional per-record minify), then download with either extension. Use it before feeding the file to a strict ingester or a system that's picky about extensions.
Why this exists
Half of "NDJSON vs JSONL" questions on Stack Overflow are really "my downstream tool only accepts .jsonl, but my upstream emits .ndjson" — or vice versa. There is no content-level conversion needed; just rename. The other half are subtle compatibility issues that look like format mismatches but are actually:
- A UTF-8 BOM prefixed by a Windows tool, breaking the first record.
- CRLF line endings from a Windows machine that some strict parsers don't tolerate.
- Blank lines between records (some loggers add them; strict consumers reject).
- Records that are pretty-printed across multiple lines (which makes the file not NDJSON / JSONL at all).
This tool fixes all four in one pass, then lets you download with either extension.
How to use it
- Paste your NDJSON or JSONL into the input box, or drop a file onto the drop zone.
- Pick which normalizations to apply (all are on by default except minify each record).
- Click Normalize. The cleaned output appears below.
- Click Download .jsonl or Download .ndjson — the content is identical; only the file extension differs.
Options explained
- Strip leading BOM
- Removes the UTF-8 BOM (
EF BB BF) at the very start of the file. The BOM is silently invisible in text editors but breaks many parsers, which treat it as part of the first record. - Normalize CRLF → LF
- Replaces Windows-style
\r\nline breaks with Unix\n. The NDJSON / JSONL spec mandates LF; most parsers tolerate CRLF, but some don't. - Drop blank / whitespace-only lines
- Removes empty lines and lines containing only spaces or tabs. The spec doesn't address them; strict consumers reject them; most ingesters silently skip them. Removing them is the safest.
- Ensure trailing newline
- Appends a final
\nafter the last record if missing. Makeswc -lmatch the record count and avoids the "POSIX text file" warning some tools emit. - Minify each record
- Re-parses each line and emits it as compact JSON (no extra whitespace). Off by default because it changes content — turn it on if you've inherited a file with pretty-ish per-line JSON or you want to shrink the file slightly. Lines that fail to parse are passed through unchanged with a warning.
Example
Input (Windows export with BOM and CRLF, blank line in the middle):
{"id":1,"name":"Ada"}\r\n
{"id":2,"name":"Babbage"}\r\n
\r\n
{"id":3,"name":"Hopper"}\r\n
Output with default options:
{"id":1,"name":"Ada"}
{"id":2,"name":"Babbage"}
{"id":3,"name":"Hopper"}
Related tools
Frequently asked questions
Is renaming .ndjson to .jsonl enough?
In most cases, yes — the file content is identical. Use this tool when you also want to scrub BOM/CRLF/blank lines, or when you want a one-click download with the right extension.
Will minifying break my data?
Only if a line wasn't valid JSON to begin with — those lines are passed through unchanged and flagged. Otherwise minify is round-trip safe.
What MIME type should the file be served with?
application/x-ndjson for both. See the JSONL specification for the MIME type discussion.
Does my data get uploaded?
No — everything runs in your browser. See the privacy policy.