CalculatorsConvertersDeveloperTextAll toolsDirectory
Submit your tool Sign in
Theme
Home/Answers/Data
How-to

How do I convert NDJSON to a normal JSON array?

Short answer

NDJSON puts one complete JSON object on each line with no commas or surrounding brackets, so to get a normal array you parse each line and collect the objects into [ ... ] form. A browser-based NDJSON converter does this on your own device, reporting any line that fails to parse, and the reverse tool turns a JSON array back into newline-delimited records.

Why NDJSON exists

Newline-delimited JSON, also called JSON Lines, is the natural format for logs, exports and streaming pipelines: each record is complete on its own line, so producers can append and consumers can process line by line without loading everything. But most APIs, fixtures and tools expect a standard JSON array, so converting between the two is routine data plumbing.

Converting safely

The converter parses every line as its own JSON document and assembles the results into one array, and when a line is malformed, a truncated final record is the classic case, it tells you which line failed rather than silently dropping data. The reverse direction takes a JSON array and emits one compact record per line, ready for log tooling or line-oriented processing.

Exports can be sensitive

NDJSON files are often database or analytics exports full of real records. The conversion runs entirely in your browser, so the data never leaves your device.

Step by step

  1. Paste the NDJSON. Open the converter and paste the newline-delimited records.
  2. Convert. Each line is parsed and collected into a single JSON array, with bad lines reported by position.
  3. Copy the array. Copy or download the array for the API, fixture or tool that needs standard JSON.

Frequently asked questions

What is the difference between NDJSON and a JSON array?

NDJSON has one standalone JSON object per line with no commas or brackets, while an array wraps comma-separated objects in square brackets as one document.

What happens if one line is invalid?

The converter reports which line failed to parse instead of silently skipping it.

Can I go the other way?

Yes. A companion tool converts a JSON array into one compact NDJSON record per line.

Related answers