JSON format mismatch
Convert NDJSON to a JSON Array or CSV
Recognize newline-delimited JSON, avoid the extra-data parse error, and convert one-object-per-line data correctly.
Use the matching tool
NDJSON to CSV
What the error actually means
NDJSON contains one complete JSON value per line. A standard JSON parser reads the first object successfully, then reports extra data when it encounters the next object. The file is not necessarily corrupted; it is a different serialization format.
Likely causes
- A logging or streaming system exported JSON Lines.
- A .json extension was used for an NDJSON file.
- Multiple API responses were appended without surrounding array brackets.
- A converter expects an array of objects but received independent records.
Record framing
Problem
{"id":1}
{"id":2}Correct pattern
[{"id":1},{"id":2}]A safe repair workflow
- 1Confirm that each non-empty line is valid JSON on its own.
- 2Use the NDJSON converter rather than wrapping raw text with brackets manually.
- 3Choose CSV when the records have a reasonably consistent object shape.
- 4Review how nested objects and arrays were represented in the output.
How to verify the result
A file that downloads successfully is not automatically a correct file. Check the result at both the structural and business-data levels:
- The output record count equals the number of valid input lines.
- No first or final record is missing.
- Nested values use an intentional flattening strategy.
- Invalid lines are reported rather than silently skipped.
Read the deeper guides
Convert CSV to NDJSON (JSON Lines) Without Losing Record BoundariesTurn CSV rows into newline-delimited JSON, understand type and null handling, and validate the result before using it in an API or data pipeline.Convert JSON to CSV (Developer's Guide)Convert JSON records to CSV while making deliberate choices about nested objects, arrays, missing keys, and column structure.