Code Beautify / MULTIVERTO

JSON Lines to array

Combine one JSON value per line into a JSON array.

Live converterYour input stays in this browser. No text is uploaded for conversion.

The file stays in your browser.
Chain tools

Apply each text tool to the previous result. Text workflows ↗

Only the recipe name and tool order are saved in this browser. Your input and results are never saved.

01 / Example

Example

Your input{"name":"Hello","message":"Welcome"} {"name":"Welcome"}
Result[ { "name": "Hello", "message": "Welcome" }, { "name": "Welcome" } ]

02 / Guide

JSON Lines to array — How it works

What the conversion does

Combine one JSON value per line into a JSON array. Parse each line independently and write one readable array.

Worked example

The sample input is {"name":"Hello","message":"Welcome"} {"name":"Welcome"}; its converted form is [ { "name": "Hello", "message": "Welcome" }, { "name": "Welcome" } ].

Format rules and limits

JSON Lines stores one complete JSON value on each line, making records easy to stream or inspect. Each line is parsed independently; a blank line in the middle is rejected because it is not a JSON value. A final line ending is allowed. The reverse tool accepts a JSON array and writes one compact JSON value for each member. Collect independent JSON records into one array for an API that expects a single JSON document. Each physical line must contain one complete JSON value, so a pretty-printed multi-line object cannot be pasted as one record. Windows and older Mac line endings are normalized before parsing. One final newline is permitted; an empty line between records is an error. The resulting JSON array has ordinary brackets and commas and can be parsed as one document. If a stream consumer requires an object on every line, validate that contract separately because this parser also accepts numbers, strings and null.

Check the result

Test a final newline and a string containing an escaped newline. A blank line in the middle is invalid; it must not become a null array item. Count source records by complete physical lines, then compare that count with the array elements after parsing. A pretty-printed object spread over lines is not one valid JSON Lines record here; each line needs a complete JSON value. An empty line between records is an input error, while a final line ending is acceptable. The result is one JSON document that may be larger to load at once than the original stream. If the next consumer requires objects only, validate element types separately because this operation also accepts other JSON values. Begin with records whose line boundaries you trust, then read each line as one complete JSON value. A text field may contain an escaped newline, but a physical newline divides records. After conversion, inspect the array length and the first and last elements; a single malformed line should be investigated at its original location. The array wrapper is useful for an API that expects one JSON document, yet it also means the entire result must be parsed together. Keep the line-oriented source for streaming workflows and preserve order when comparing records.

How this conversion transforms the input
JSON Lines — Input
Read and transform structure
JSON — Result

Explore guides

Conversion guides

Explore guides