JSON Lines to JSON

Convert JSON Lines (NDJSON) to a JSON array, or a JSON array back to one JSON value per line, in your browser. Empty lines are skipped.

Last updated: October 2, 2026

Tool

This tool will load here.

What JSON Lines conversion does

JSON Lines (also called NDJSON) is one JSON value per line. A JSON array is one JSON value that contains many items. This converter turns a JSON Lines file into a JSON array, and a JSON array into JSON Lines. It runs in the browser. Nothing is uploaded.

That is a different job from pretty-print. A formatter rewrites whitespace inside one JSON document. JSON Lines is a stream format used in logs, analytics exports, and some APIs. Each line must be a complete JSON value. A pretty-printed object that spans several lines is not JSON Lines.

How to use

  1. Paste JSON Lines or a JSON array.
  2. Choose JSON Lines to JSON, or JSON to JSON Lines. Example loads three objects, one per line.
  3. Copy output writes the result. Clear empties both boxes.

Empty lines are skipped. A broken line names its line number and the parse error. JSON to JSON Lines needs a JSON array; a root object is refused. Each array item is written with JSON.stringify on one line.

Example

{"id":1,"name":"Ada"}
{"id":2,"name":"Tom"}
{"id":3,"name":"Nia"}

JSON Lines to JSON becomes a three-item array. JSON to JSON Lines on that array returns compact lines again. Pretty-print inside a line is not required; the converter always emits compact lines.

When to use it

Use JSON Lines when a log shipper or an OpenSearch-style bulk file gives you one record per line and you want an array for the JSON to CSV tool or for a test fixture. Use the other direction when you have an array and a tool that only reads NDJSON. If you only need to indent one object, use the JSON Formatter.

A line may be any JSON value: object, array, string, number, boolean, or null. Mixing those in one file is legal JSON Lines and becomes a mixed JSON array. That mixed array may then be refused by JSON to CSV, which wants rows. Conversion here still succeeds; the next tool may not.

JSON to JSON Lines always emits compact lines. It does not preserve the original spacing of the array you pasted. Numbers stay numbers. A string that contains a newline is still one JSON Line because JSON.stringify escapes that newline. Do not split those escaped lines by hand.

If line 12 is missing a comma inside an object, only line 12 fails. Earlier lines are not kept as a partial array. Fix the line, or validate a single record by pasting that line into the JSON Validator.

Limits

  • This is not a log parser. Non-JSON prefixes such as timestamps before the brace will fail parse on that line.
  • A pretty-printed JSON object pasted as several lines is not JSON Lines. Convert from a JSON array instead.
  • Values stay JSON types after JSON Lines to JSON. Compact stringify on the way back may change whitespace only.
  • Conversion stops if more than 4000 non-empty lines or array items would be processed. The output is then cleared.

The shape difference is explained in JSON vs JSON Lines.

Privacy

Parse and conversion run in this browser. Log lines are not sent to YallaSolve for this tool.

On this page

Related guides

Related solutions

Need another tool ?

Open the free tools — no signup.

FAQs

newsletter signup

Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Innovative Solutions For Modern Needs
Copyright © 2026 Yallasolve. all rights reserved.