All tools

NDJSON to CSV Converter

Data

Convert newline-delimited JSON (one flat object per line) into CSV, inferring the header row from the union of keys across all lines

Paste newline-delimited JSON, one flat object per line, and get back a CSV with a header row built from the union of every key seen across all the records, in the order each key first appears. A record missing a given key just gets an empty cell rather than causing an error, and a field whose value is itself an object or array is embedded as a JSON string instead of being flattened into more columns. This is the conversion step the existing NDJSON Formatter does not cover, since that tool only round-trips NDJSON against a plain JSON array, never against a spreadsheet-friendly format.

ndjsonjson-linescsvconvertexport

How to use NDJSON to CSV Converter

  • 1.Paste NDJSON content, one JSON object per line, into the input box.
  • 2.Review the inferred header row and row count, then copy the generated CSV.
  • 3.Load the CSV into a spreadsheet or any tool that expects comma-separated rows instead of line-delimited JSON.

Frequently asked questions

What happens if different lines have different keys?
The header row is the union of every key seen across all lines, in first-seen order. A line missing a given key gets an empty cell in that column rather than shifting the other columns.
What happens to a nested object or array value?
It is embedded as a JSON string in that cell rather than expanded into further columns, since CSV has no native way to represent nested structure.
Does every line have to be a flat JSON object?
Yes. A line that parses to an array, string, number, or other non-object value returns an error, since there would be no keys to build a header row from.
Is my data sent to a server?
No, the browser tool converts everything locally. The REST API and SDKs process whatever content you send them, same as any other API call.

Use via API, SDK, or MCP

cURL# Free: 1,000 req/day · Pro: 10,000 req/day
curl -X POST https://api.utilix.tech/v1/tools/ndjson-to-csv \
  -H "Authorization: Bearer utx_live_..." \
  -H "Content-Type: application/json" \
  -d '{"input": "{\"id\":1,\"name\":\"Ann\"}\n{\"id\":2,\"city\":\"NYC\"}"}'

Get an API key from your dashboard · Full API docs →