JSON Lines checker and converter
Check JSON Lines (NDJSON) line by line, see its columns, and convert it to CSV, TSV, Markdown, or a JSON list, or back again.
JSON Lines
One value per line
JSON Lines stores a stream of records as plain text, one complete JSON value per line. The line break is the only separator, so a value cannot continue onto the next line. A pretty-printed object spread across five lines is valid JSON but not valid JSON Lines, because each line is read on its own.
Lines are parsed one at a time. An error on line 40 says nothing about lines 1 to 39, so checking line by line narrows down a large export that fails somewhere in the middle.
Lines that break the format
- A trailing comma after the last member of an object is invalid JSON.
- Strings need double quotes. Single quotes fail the parser.
- NaN and Infinity are not JSON values, so neither can appear on any line.
- A line holding an array is one record. Its elements are not separate records.
Records as table rows
Converting to CSV or a table treats each record as a row. Column names come from member names, so a second record that adds a field creates a column the first record has no value for. Tables need one cell per column, which means that absent field appears as an empty cell in the first row.
More JSON tools
All JSON toolsWas this tool useful?