NDJSON to CSV
BetaConvert newline-delimited JSON (.ndjson, .jsonl) into a flat CSV in your browser. Nested keys become dot paths, the columns are the union of every row, a bad line is skipped and counted, and nothing is uploaded.
- Free, no sign-up
- REST + MCP
- Updated
- Reviewed by Olgun Ozoktas
Parsed in your browser. We do not upload the file. One JSON object per line. Flatten writes nested keys as dot paths; null and a missing key both become an empty cell. A huge file is limited by tab memory, so use Download, not Copy, for a big output.
The flat CSV will appear here..
Why Use Our NDJSON to CSV Converter?
JSON Lines is a text format with one JSON value per line, separated by line feeds. Log shippers, streaming exports and machine-learning datasets use it because a writer can append one record at a time and a reader can process one line at a time without loading the whole file. The trade-off is that the file as a whole is not valid JSON, so a converter that calls JSON.parse on the text fails on the second line. This page parses each line on its own.
The output is one CSV row per JSON object. The header is built from every key in every row, in first-seen order, so a key that appears only on line 900 still gets a column and earlier rows get an empty cell there. With Flatten, the default, a nested object becomes dot paths such as user.name and user.city, and an array becomes indexed keys such as tags[0] and tags[1], recursively. With JSON cell, a nested object or array is written as JSON text in one cell, quoted as CSV requires. null and a missing key both write an empty cell; numbers and booleans are written as text.
A line that is not valid JSON, or that is JSON but not an object, is skipped, counted, and listed as Line N with its file line number. The other lines still convert. A leading byte order mark is dropped, CRLF line ends are accepted, and blank lines are ignored. Quoting follows RFC 4180: a cell is quoted only when it holds the separator, a quote or a line break. The input cap is 10 MB. Nothing is uploaded; the file is parsed in your browser.
How it compares
A jq or Python one-liner does the same job on a workstation with those tools installed and a few minutes to write the flatten step. Online converters that upload the file hand a log of your users' requests to a server for a format change. This page reads the format with its line rule, builds a stable header from every row, names the lines it skipped, and keeps the file in the tab.
NDJSON to CSV Tips
- The header is the union of every key across every line, in the order the keys first appear. A key that a row does not have is an empty cell, and so is null.
- Under Flatten, an array becomes indexed columns: tags[0], tags[1]. A row with five tags creates five columns. Use JSON cell when you want the whole array in one cell.
- An empty object or an empty array produces no column under Flatten. If a field is empty on every row, it does not appear.
- Numbers and booleans are written as text, so 1.5 and true look the same in the CSV as in the JSON. The spreadsheet decides the type when it opens the file.
- A file that starts with [ is a JSON array, not JSON Lines. The page refuses it and links to the JSON to CSV tool, which reads arrays.