JSON Lines Converter

Convert JSON arrays to JSON Lines (JSONL/NDJSON) and back with line-specific errors

Use the interactive tool with JavaScript enabled.

How to use it

  1. Choose JSON array to JSON Lines, or JSON Lines to JSON array.
  2. Paste input or open a local .json, .jsonl, or .ndjson file up to 10 MB.
  3. Convert, check any reported line error, then copy or download the result.

Example

Input

{"id":1}
{"id":2}

Output

[
  {
    "id": 1
  },
  {
    "id": 2
  }
]

Behavior and limits

The importer skips blank lines and removes a leading byte-order mark as conveniences. It is not a strict JSON Lines conformance checker. Numbers use JavaScript JSON precision; files must fit in browser memory.

About this tool

Use JSON Lines to prepare newline-delimited records for logs, data exports, and processing pipelines. Each JSON array item becomes a compact JSON value on its own line. The reverse conversion skips blank lines and reports the source line when JSON is invalid. Conversion uses the browser’s native JSON parser, including JavaScript number precision limits.

Questions and answers

Does each line have to contain a JSON object?
No. Each nonblank line can contain any valid JSON value, including an object, array, string, number, boolean, or null.

Related tools

  • JSON Formatter — Format, validate, minify and sort JSON with tree view
  • JSON Compare — Diff two JSON documents side by side
  • CSV ↔ JSON — Convert between CSV and JSON with type detection

Sources and specifications

Tool processing runs in your browser. Privacy policy and cookie preferences.

Read this guide as Markdown