JSON Lines to JSON Converter

Combine a JSON Lines or NDJSON file into one formatted JSON array, and find out exactly which line is broken if one is.

JSON Lines
JSON array
Runs locally in your browser

About the JSON Lines to JSON Converter

Log exports, database dumps and API batch outputs often arrive as JSON Lines: one JSON object per line with no enclosing array. Most tools that expect JSON want an array. This converter parses each line separately, collects the values and pretty-prints them as a single array with your chosen indent.

Blank lines are skipped. Because every line is parsed on its own, an error tells you the line number and the problem within that line, which is far easier to act on than an error position in a 50,000-line file. The output preserves record order.

After conversion you can use any of the array-based tools, such as JSON to CSV for a spreadsheet or the JSON Viewer to browse records.

How to use

  1. Paste or upload the JSON Lines file on the left.
  2. Check the right pane for the array, or the amber message for a failing line number.
  3. Copy or download the result.

Common questions

What happens with a blank line?
It is ignored. Only lines with content are parsed.
Can a line contain a pretty-printed object?
No. Each JSON value must be on one line; that is the definition of the format. Use the JSON Fixer if you have concatenated objects across multiple lines.
How big a file can it handle?
Tens of thousands of lines are fine. The limit is browser memory for the resulting array.