Skip to content
Free developer tool

JSON Lines to JSON converter

This converter switches between JSON Lines, where each line holds one JSON value, and a regular JSON array. Data engineers and developers use it for log files, machine learning datasets, database exports and API batch files.

  • Runs in your browser
  • Free, no account needed
  • Copy or download the result
Private: runs on this device

Input

87 characters

Result

[
  {
    "id": 1,
    "name": "Ada"
  },
  {
    "id": 2,
    "name": "Grace"
  },
  {
    "id": 3,
    "name": "Linus",
    "tags": [
      "kernel"
    ]
  }
]

Example

Input
{"id":1,"name":"Ada"}
{"id":2,"name":"Grace"}
{"id":3,"name":"Linus","tags":["kernel"]}
Result
[
  {
    "id": 1,
    "name": "Ada"
  },
  {
    "id": 2,
    "name": "Grace"
  },
  {
    "id": 3,
    "name": "Linus",
    "tags": [
      "kernel"
    ]
  }
]

How to use the json lines to json converter

  1. Paste JSON Lines or a JSON array into the box.
  2. Choose a Direction: JSON Lines to JSON array, or JSON array to JSON Lines.
  3. Press Run.
  4. Use Copy result or Download to save the output.

How it works

Each nonblank line must be one complete JSON value. Blank lines are skipped, and both LF and CRLF line endings work.

The first invalid line stops the conversion and is reported with its line number and column.

The JSON array is printed with 2-space indentation. In the other direction, each array item is written compactly on its own line.

Numbers keep their exact digits and key order is kept, so large IDs are not rounded.

Everything runs in your browser. Your input is not uploaded or stored.

Questions and answers

What is the difference between JSONL and JSON?

A JSON file holds one value, often an array. JSON Lines holds one value per line, so programs can read or append one record at a time.

Are .jsonl and .ndjson the same?

They are very close. Both put one JSON value on each line, separated by line breaks.

Can a JSON Lines record span several lines?

No. Each record must fit on one line, so line breaks inside strings must be written as \n.

Is my data uploaded?

No. It runs in your browser, and nothing you paste is sent to a server.

All 220 SnowRock tools