JSON Lines to array
Processed in your browser · nothing is uploaded
Turns JSON Lines — one JSON value per line — into a single array. If a line will not parse, it names the line number.
How to use the json lines to array
JSON Lines exists because a large array is awkward to stream: a consumer has to read the whole thing before acting on the first element, and a writer has to know the end before it can close the bracket. One value per line solves both, which is why log pipelines, data exports and machine-learning datasets use it. The format has exactly two rules — one complete JSON value per line, and no line breaks inside a value. The second is what people trip over, because a pretty-printed object spanning several lines is valid JSON and invalid JSON Lines.
Questions
One complete JSON value per line, with no line breaks inside a value. Also called NDJSON.