JSON to CSV Converter

Paste a JSON array of objects and get a CSV in the format Excel, Google Sheets, and every database import tool expects. Columns are auto-detected from the union of all keys across your records. Nested objects and arrays are flattened or JSON-stringified depending on your preference. Everything runs in your browser; nothing is sent to a server.


      

How to Use This Tool

  1. Paste your JSON into the input area — an array of objects is most common (each object becomes a row).
  2. Pick your options — separator (comma, semicolon, tab), how to handle nested objects (flatten or stringify), whether to include the header row.
  3. Read the live preview — the CSV regenerates on every change. Validate that the columns and rows look right before copying.
  4. Copy or download — click Copy for the clipboard, or Download to save as a .csv file ready to open in Excel or Sheets.

About JSON-to-CSV Conversion

CSV (Comma-Separated Values) and JSON are the two text formats most data ever passes through. CSV is the lingua franca of spreadsheets, databases, and BI tools — every system can import it. JSON is the default for APIs, configuration, and modern data pipelines. Converting between them is one of the most common data-engineering tasks: an API returns JSON, but the analytics team wants it in Sheets; a database export is CSV, but the JavaScript frontend needs JSON.

The conversion isn't quite mechanical, because JSON and CSV model data differently. JSON has nested objects, arrays inside values, and explicit types (string, number, boolean, null). CSV is flat — every cell is a string, every row has the same columns. This tool makes the lossy parts explicit: nested objects can flatten to dotted column names or stringify to JSON, arrays in values stringify by default, and types collapse to their string representations. None of this is reversible without a schema, which is why round-tripping JSON → CSV → JSON usually requires hand-tweaking on the way back.

For most everyday data — API responses, log exports, database rows — the conversion is straightforward and lossless enough. The tool follows RFC 4180 quoting rules so the output parses cleanly in Excel, Google Sheets, pandas, and any standards-compliant CSV reader. For data that genuinely needs to preserve nested structure, consider keeping it as JSON and using a tool like jq to query it instead of forcing it into a flat tabular shape.

Frequently Asked Questions

What JSON structure does this tool accept?
The standard input is an array of objects — each object becomes one row, with column headers derived from the union of all keys across the array. The tool also accepts a single object (becomes a one-row CSV), an array of arrays (becomes a CSV with positional columns), and primitives wrapped in an array. For nested objects, you can choose between flattening (nested keys become parent.child column names) or JSON-stringifying (the nested value becomes a JSON string in one column). The tool detects the shape automatically and applies the right strategy.
How are special characters like commas and quotes inside values handled?
Per RFC 4180, any field containing the separator, a quote, or a newline gets wrapped in double quotes, and any double quote inside a quoted field is escaped by doubling it (" becomes ""). So {"name": "O'Reilly, Inc."} renders as "O'Reilly, Inc." in the CSV. You can also choose "quote all fields" if your downstream consumer is strict about quoting. The tool follows RFC 4180 by default, which is what Excel, Google Sheets, and pandas all expect.
What happens to nested objects and arrays in my JSON?
Two strategies, switchable in the options. Flatten: nested keys become dotted column names — {"user": {"name": "Jon"}} produces a column user.name. Best when the nesting is consistent and shallow. JSON-stringify: the nested value becomes a literal JSON string in one column — useful when nesting is irregular or when the downstream consumer can re-parse JSON. Arrays in values always JSON-stringify by default (a column of ["a","b"]) because flattening arrays into multiple columns rarely produces what people want.
Why does the column order in my CSV not match the JSON key order?
When the input is an array of objects, the tool collects keys from every object in order of first appearance — so an object with keys [a, b, c] followed by [b, c, d] produces columns a, b, c, d. If you need a specific column order, restructure the JSON so the first object has every key in the order you want, or post-process the CSV in your spreadsheet. The tool prioritizes "every column present" over "matches the first object exactly" — there's no universally right answer here, and the union approach matches what pandas and most libraries do.
Will the output work with Excel, Google Sheets, and pandas?
Yes — all three follow RFC 4180 with minor variations. The default output (comma separator, quoting only when needed, \r\n line endings) opens cleanly in Excel and Google Sheets and parses correctly with pandas.read_csv(). For European Excel (which uses semicolon as the default separator), switch the separator option. For tab-delimited (.tsv) output, also switch the separator option. Single-line text inside a cell, multi-line text wrapped in quotes, Unicode characters, and emoji all pass through unchanged.