.ndjson

NDJSON test files

One JSON record per line, for log shippers, data loaders and streaming parsers. Add a malformed line to test error handling.

Or start from a preset

What is a NDJSON file?

Short answer

NDJSON (newline-delimited JSON, also called JSON Lines) puts one complete JSON value on each line. A reader can process the file line by line without loading it all, which is why logs and data exports use it.

Each line must be valid JSON on its own and must not contain a raw line break. Tools differ on blank lines, CRLF endings and a missing final newline, so those are the cases worth testing.

Anatomy of a NDJSON file

  • {"id":1,…}One JSON value per line, usually an object
  • \nThe record separator; no commas between records
  • .jsonl / .ndjsonCommon file extensions

What you can generate

  • One malformed line among valid ones
  • Blank lines between records
  • CRLF line endings
  • No newline after the last record
  • nulls, Unicode, escapes and big numbers inside records

How to make one

  1. Open the NDJSON generator, or start from a preset above.
  2. Set the size and switch on the edge cases you need; the preview and size estimate follow every change.
  3. Generate, then download. The file is made in your browser, and the same preset and seed always give you the same file.

Questions

Practically yes. Both put one JSON value per line, separated by \n, and use UTF-8.

No. A pretty-printed object would break the format, so every record is written on one line.

Pick One malformed line: line 3 is cut off, and every other line stays valid.

Related formats