Toolphy

JSON to CSV Converter

Paste a JSON array of objects and get a spreadsheet-ready CSV with every column detected automatically, ready to copy or download.

0
Rows
0
Columns

How to Convert JSON to CSV

Converting structured JSON into a spreadsheet-friendly CSV file usually means writing a script or fighting with a library. This tool does the work in your browser in a few seconds.

  1. Paste your JSON. Copy a JSON array of objects — the shape returned by most REST APIs — and paste it into the input box. Each object becomes one CSV row and its keys become the columns.

    Example: [{"name":"Ada","age":36},{"name":"Linus","age":54}] becomes the header name,age followed by the rows Ada,36 and Linus,54.

  2. Choose your delimiter. Keep the comma for standard CSV, switch to a semicolon if your locale uses the comma as a decimal separator, or pick the tab to paste straight into Excel or Google Sheets.

  3. Decide on the header row. It is enabled by default and lists every detected column. Turn it off when an importing system expects data only.

  4. Press Convert, then copy or download. The tool builds the CSV, shows the row and column count, and lets you copy it to the clipboard or save a .csv file with one click.

What Is JSON to CSV Conversion?

JSON (JavaScript Object Notation) is a hierarchical, self-describing format built around objects and arrays. CSV (comma-separated values) is a flat table where every record occupies one line and every field is separated by a delimiter. Converting between them is essentially flattening: a tree of nested values is reduced to a rectangular grid. The main challenge is that JSON objects may have different keys. A strict converter that reads only the first record will silently drop columns. This tool instead scans every object in the array and builds the union of all keys, so a field that appears in even one row still gets its own column. Missing values are left empty. Values that are not simple strings or numbers — nested objects, arrays, booleans and null — are serialised with JSON.stringify so no information is lost. Finally, CSV follows the RFC 4180 convention: any field containing a quote, the delimiter or a line break is wrapped in double quotes, and internal quotes are doubled. That is what keeps a value like He said "hello", loudly from breaking the file.

Common Applications

1. Turning an API response into a report: export users, orders or events from a JSON endpoint and open the result in Excel or Google Sheets for analysis.

2. Database and CMS migrations: prepare flat files for tools that only accept CSV imports, such as CRMs, mailing platforms and analytics suites.

3. Data science notebooks: move a small JSON dataset into pandas or R without writing a custom parser.

4. Configuration reviews: flatten a list of feature flags, products or locales into a table that non-developers can read and edit.

5. Quick sharing: send a colleague a spreadsheet instead of a raw JSON payload they cannot open.

Handling Nested Objects and Arrays

CSV has no concept of depth, so nested structures must be represented as text. When a value is an object or an array, the converter calls JSON.stringify on it and writes the resulting string into a single cell. For example, a tags array like ["new","sale"] is stored as the literal text ["new","sale"], and an address object becomes {"city":"Paris","zip":"75001"}.

This approach is lossless — you can parse the cell back into real JSON later — but it is not the same as flattening keys into dotted columns. If you need address.city as its own column, transform your data upstream or use a dedicated flattening step. For most exports, keeping the sub-structure intact in one cell is the safest default.

Guides

Frequently Asked Questions - FAQ

Is my data sent to a server?

No. The entire conversion happens locally in your browser using native JavaScript. Your JSON is never uploaded, logged or stored anywhere.

What happens if the objects have different keys?

The tool scans every object and uses the union of all keys as the columns. A key that appears in only one row still gets its own column, and rows that are missing it are simply left blank.

How are nested objects and arrays handled?

Nested values are serialised with JSON.stringify and placed inside a single CSV cell, then escaped normally. This keeps the data lossless even though CSV has no native notion of nesting.

Is the output compliant with RFC 4180?

Yes. Fields containing a quote, the chosen delimiter or a line break are enclosed in double quotes, and any internal double quote is doubled. Rows are separated by CRLF line endings.

Which delimiters can I use?

You can output comma-separated, semicolon-separated or tab-separated values. Semicolons suit locales where the comma is the decimal separator, and tabs paste cleanly into spreadsheet software.

Last updated: