Development and data

How to check NDJSON line by line

In NDJSON, each nonempty line contains a complete JSON value. This makes a sequence of fictional records easier to review.

Before you start

Text is processed in the browser. Consider the content before using it and read the privacy policy.

Privacy

How to use it

  1. Enter {"id":1} on the first line and {"id":2} on the second.

  2. Validate the lines, then convert to an array.

  3. Replace the second line with {"id":} and validate again to locate the error on line 2.

NDJSON Validator

Worked example

The two valid lines form separate objects; conversion collects both into an array. The error reports the physical line number.

Converted result: [{"id":1},{"id":2}].

NDJSON specification

Limits and checks

Blank lines are ignored and input is limited to 500,000 UTF-16 code units. Validation checks syntax per line, not schema or numeric precision; on conversion, unsafe integers and non-finite numbers are rejected and other decimals may be rounded.

Next step

To check a single JSON document, use JSON Formatter.

How to format and check JSON before sharing it
Back to the blog