---
title: "NDJSON to CSV"
description: "Convert 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."
url: https://findutils.com/convert/ndjson-to-csv/
category: convert
---

# NDJSON to CSV

Convert 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.

**Use this tool:** [NDJSON to CSV](https://findutils.com/convert/ndjson-to-csv/)

## Programmatic access

- REST id `ndjson-to-csv`: POST https://api.findutils.com/api/tools/ndjson-to-csv/execute (reference: https://findutils.com/api/ndjson-to-csv/)
- MCP tool `ndjson_to_csv` on https://mcp.findutils.com (reference: https://findutils.com/mcp/ndjson-to-csv/)

## Why Use Our NDJSON to CSV Converter?

API log dumps, search-index exports, streaming pipelines and fine-tune datasets write one JSON object per line. That format is called JSON Lines, NDJSON or JSONL. A spreadsheet, an upload form and a warehouse want a flat CSV instead, and a JSON array converter cannot read the line form because the whole file is not one JSON document. This page reads each line on its own, builds the header from every key it sees, flattens nested objects to dot paths, and writes RFC 4180 CSV. A line that is not a JSON object is skipped and named by its line number, so one broken record does not stop the export. The conversion runs in your browser; the file never leaves the tab.

## Frequently Asked Questions

### What is NDJSON, and how is it different from JSON?

NDJSON stands for newline-delimited JSON. JSON Lines and JSONL are other names for the same format. A file holds one JSON value per line, usually one object, and the lines are separated by line feeds. The file as a whole is not one JSON document, so a parser that reads the whole text fails after the first line. That is why the JSON to CSV tool cannot read it and this page exists.

### How is the CSV header built?

Every key in every line goes into the header, in the order the keys first appear. If line 1 has id and name and line 2 adds email, the header is id, name, email, and line 1 gets an empty email cell. Nested keys are flattened first, so a user object with a name becomes the column user.name.

### What happens to nested objects and arrays?

With Flatten, the default, nested keys become dot paths: user.name, user.address.city. Array items become indexed keys: tags[0], tags[1]. With JSON cell, a nested object or array is written as JSON text in one cell, for example {"code":"E42"}, and the CSV quoting doubles the inner quotes. An empty object or empty array produces no column under Flatten.

### What happens to a line that is not valid JSON?

It is skipped, counted in the status line, and listed in the notes as Line N: invalid JSON, where N is the line number in the file. A line that is valid JSON but not an object, such as a number or an array, is listed as Line N: expected a JSON object. The other lines still convert. The notes list shows the first twenty.

### Why does the page refuse my file and mention JSON to CSV?

The file starts with [ and parses as one JSON array. That is a JSON document, not JSON Lines, and the JSON to CSV tool reads it. The refusal is deliberate: reading an array as JSON Lines would give one row for the whole file, which is never what you want.

### Are numbers, booleans and null kept?

They are written as text in the CSV: 1.5, true, false. null and a missing key both become an empty cell, because CSV has no null. Your spreadsheet decides the type when it opens the file. If you need the types back, CSV to NDJSON has a Coerce types option that turns them into JSON values again.

### Can I open the CSV in Excel, Google Sheets or Numbers?

Yes. Google Sheets and Numbers read the UTF-8 file as it is. Excel on Windows sometimes shows accented characters wrongly in a plain UTF-8 CSV; turn on Excel BOM before you download and Excel reads it correctly. If your Excel expects semicolons, choose the semicolon separator.

### Is my file uploaded anywhere?

No. The lines are parsed and the CSV is built in your browser, and no request carries the file. You can confirm that in the browser's network panel while converting. An API log holds request paths, user ids and sometimes tokens, and it stays on your machine.

### How large a file can I convert?

The input cap is 10 MB of text. The conversion runs in the tab, so a file near the cap can keep the browser busy for a moment. For a large output, use Download rather than Copy; a very long text in the clipboard is slow to paste. For a batch or a script, the same converter is on the FindUtils API as ndjson_to_csv.

### How do I go the other way, from CSV to NDJSON?

Use the CSV to NDJSON tool, or flip the direction toggle on this page. It reads the header as keys, writes one JSON object per line, and can turn true, false, null and plain numbers back into JSON values with Coerce types. It does not rebuild nested objects from dotted column names.

## Related Tools

- [CSV to NDJSON](https://findutils.com/convert/csv-to-ndjson/)
- [JSON to CSV](https://findutils.com/convert/json-to-csv/)
- [JSON to SQL](https://findutils.com/convert/json-to-sql/)
- [CSV Viewer](https://findutils.com/convert/csv-viewer/)
- [CSV to Excel](https://findutils.com/convert/csv-to-excel/)
- [TSV to CSV](https://findutils.com/convert/tsv-to-csv/)
- [JSON Formatter](https://findutils.com/developers/json-formatter/)
