๐Ÿฑ Lunchbox Hands

JSON โ†’ CSV Converter

Convert a JSON array of objects into CSV

Paste a JSON array of objects and get a clean, properly-quoted CSV in seconds. The tool automatically detects all columns across every object, handles nested data with dot-notation flattening, and supports comma, semicolon, or tab delimiters. Everything runs locally in your browser โ€” your data never leaves your machine.

Delimiter
Array of objects
CSV output will appear here...

Why JSON-to-CSV is trickier than it looks

At first glance, converting JSON to CSV seems trivial: just write out the keys as headers and the values as rows. In practice there are several rough edges that a naive implementation gets wrong. This tool handles them all.

Column unions across heterogeneous objects. Real-world API responses rarely have perfectly uniform objects. One record might include an optional phone field while another omits it entirely. A correct CSV must still have a phone column, with an empty cell for rows that lack it. This tool computes the full union of keys across every object in the array, preserving the order each key is first encountered, so no data is silently dropped.

Proper CSV quoting and escaping. CSV is deceptively fragile. Values that contain the delimiter, double-quote characters, or newlines must be wrapped in quotes, and any embedded quotes must themselves be doubled. Getting this wrong produces files that silently corrupt data when opened in a spreadsheet. This tool delegates serialization to PapaParse, a battle-tested library used by thousands of production apps, so quoting is always RFC 4180-compliant.

Nested JSON flattening. JSON objects can be deeply nested, but CSV is flat. The "Flatten nested" option (on by default) expands nested objects into dot-notation columns โ€” address.city, address.zip โ€” and arrays into indexed columns โ€” tags.0, tags.1. When you turn flattening off, nested values are JSON.stringified into a single cell, which is useful when you want to preserve the structure for later re-parsing.

Choosing the right delimiter

The default comma delimiter works for Google Sheets, Apple Numbers, and English-locale Excel. If you are in a European locale where Excel uses commas as decimal separators, switch to semicolon โ€” Excel in those regions expects semicolons as the column separator. The Tab option produces TSV (Tab-Separated Values), which is sometimes cleaner for data that contains commas in cell values (address fields, descriptions, etc.) since tab characters are rare in text content.

How to use this tool

  1. Paste a JSON array of objects into the left panel. The conversion is live.
  2. Select your preferred delimiter (comma, semicolon, or tab).
  3. Enable or disable nested flattening depending on your data shape.
  4. Toggle the header row on or off to match your import requirements.
  5. Download the .csv file or copy the output directly.

Related tools

  • Already have a CSV and need JSON instead? Use the bidirectional CSV โ†” JSON Converter.
  • Want to validate or format your JSON before converting? Run it through the JSON Formatter first to catch any syntax errors.

Frequently asked questions

How is nested JSON handled?

When the "Flatten nested" option is on (the default), nested objects and arrays are expanded into dot-notation columns. For example, { "address": { "city": "LA" } } becomes a column named address.city, and an array field tags: ["a","b"] becomes tags.0 and tags.1. If you turn flattening off, the nested value is JSON.stringified into a single cell โ€” useful when the column count matters more than readability.

What if my objects have different keys?

The tool performs a full union of all keys across every object in the array, preserving the order in which each key is first seen. Rows that are missing a key get an empty cell in that column. This matches how spreadsheet tools expect imported CSV: every row has the same number of columns, even if some cells are blank.

Does my data get uploaded to a server?

No. All processing runs directly in your browser using JavaScript. Your JSON never leaves your machine โ€” there are no API calls, no server logs, and no data stored anywhere. This makes the tool safe to use with sensitive or proprietary datasets.

Can I open the resulting CSV in Excel or Google Sheets?

Yes. Use the comma delimiter for Google Sheets and most modern Excel versions. If you are working with a locale that uses commas as decimal separators (common in Europe), switch to the semicolon delimiter before downloading โ€” Excel in those locales expects semicolons. For the cleanest import, download the .csv file rather than copy-pasting, since spreadsheet auto-detect works better with a real file.

What JSON shapes are supported?

The primary input is a JSON array of objects โ€” the most common shape from APIs, database exports, and report tools. A single JSON object is also accepted (it produces one data row). An array of primitive values (strings, numbers, booleans) is supported too: it produces a single column named "value". Anything else โ€” a bare string, a number at the top level, mixed arrays โ€” raises a clear error message.

Get weekly dev tools and tips