Toolstia / JSON Lines converter

JSON Lines converter

JSON Lines, also known as NDJSON, writes one complete JSON value on each line. It is used for logs, exports and training data because files can be read one line at a time. Paste a JSON array to get lines, or paste lines to get an array.

JSON Lines, also called NDJSON, stores one complete JSON value on each line. It is common for logs, data exports and machine learning data sets. Blank lines are skipped.

How it works

  1. Choose the direction.
  2. Paste your JSON array or your JSON Lines.
  3. Copy the result. Errors point to the exact line that is not valid.

Array to lines

Each item of the array is written in compact form on its own line. The array itself must be the top level of the text.

Lines to array

Each line is read as JSON and the values are collected into one array. Blank lines are skipped. You can pretty print the array.

Why use JSON Lines

Big files can be streamed and appended to without loading everything, and one bad line does not spoil the rest.

Any JSON value

Lines may hold objects, arrays, strings, numbers, true, false or null.

Questions

Is my data uploaded?

Everything happens in your browser, and nothing you enter is sent anywhere.

What if one line is not valid JSON?

The tool tells you the line number so you can fix it. Nothing is converted until every line is valid.

Is JSON Lines the same as NDJSON?

Yes. They are two names for the same format.