JSON Lines to JSON Array
Turn newline-delimited JSON into one JSON array. Blank lines are skipped and a bad line is named by number.
What converting JSON Lines to an array does
Each non-blank line is parsed as one complete JSON value and the values are collected into an array in file order, which is the shape most APIs and spreadsheets expect. Parsing stops at the first bad line and the message names its number, because a partial array from a truncated log is worse than a refusal. Trailing whitespace and a final newline are ignored so a file written on Windows parses the same as one written on Unix.
How to use it
JSON Lines to JSON Array: paste the JSON Lines into the box above, set Indent (default 2), and press Run to get the JSON below.
Worked example
Input:
{"id":1,"name":"Ada"}
{"id":2,"name":"Linus"}
{"id":3,"name":"Grace"}
Output:
[
{
"id": 1,
"name": "Ada"
},
{
"id": 2,
"name": "Linus"
},
{
"id": 3,
"name": "Grace"
}
]
Why it runs in your browser
The conversion happens on this page with JavaScript. Your input is not posted to a server, so it works offline after the page loads and nothing is retained anywhere. The page reads JSON Lines and returns JSON; reloading the page discards both.
Each non-blank line is parsed as one complete JSON value and the values are collected into an array in file order, which is the shape most APIs and spreadsheets expect. Parsing stops at the first bad line and the message names its number, because a partial array from a truncated log is worse than a refusal. Trailing whitespace and a final newline are ignored so a file written on Windows parses the same as one written on Unix.
Turn newline-delimited JSON into one JSON array. Blank lines are skipped and a bad line is named by number.
How to use it
JSON Lines to JSON Array: paste the JSON Lines into the box above, set Indent (default 2), and press Run to get the JSON below.
Why it runs in your browser
The conversion happens on this page with JavaScript. Your input is not posted to a server, so it works offline after the page loads and nothing is retained anywhere. The page reads JSON Lines and returns JSON; reloading the page discards both.
What to Expect
Best for
- Converting JSON Lines to JSON when the data is already on screen.
What this tool keeps
- Your input is not posted to a server, so it works offline after the page loads and nothing is retained anywhere.
Sample input
{"id":1,"name":"Ada"} {"id":2,"name":"Linus"} {"id":3,"name":"Grace"}
Sample output
[ { "id": 1, "name": "Ada" }, { "id": 2, "name": "Linus" }, { "id": 3, "name": "Grace" } ]
Frequently asked questions
How do I use the json lines to json array?
JSON Lines to JSON Array: paste the JSON Lines into the box above, set Indent (default 2), and press Run to get the JSON below.
Is my input uploaded?
No. The text is parsed on this page with JavaScript and is never posted to a server.
Is there a size limit?
Yes: 5 MB per run. Larger input is refused with a message rather than freezing the tab.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.