Dev Converters
JSON & YAML

JSON to CSV Converter

Convert a JSON array of objects to CSV online. Auto-detects columns, escapes quotes, supports nested fields via dot notation.

How it works

CSV (Comma-Separated Values) is the lingua franca of tabular data — spreadsheets, BI tools, and data pipelines all consume it. JSON, by contrast, is tree-structured. Converting from JSON to CSV requires picking a "flat" shape: typically an array of objects where each object becomes one row and each key becomes one column.

This converter uses PapaParse to perform the CSV serialisation. It inspects every object in your array to build the union of all keys, so rows with missing fields produce empty cells instead of misaligning columns. RFC 4280 escaping is applied automatically: values with commas, quotes, or newlines get wrapped in double quotes.

If your JSON has nested objects or arrays, the default behaviour is to embed them as JSON strings in a single cell. Most spreadsheet tools import these cleanly, but if you need flat columns you should flatten the structure first — for example, by mapping `user.name` to a top-level `user_name` key. Empty arrays or objects at the top level produce an empty CSV with just a header line, or nothing at all.

Frequently asked questions

Does the JSON have to be an array?
Yes — CSV is tabular, so the input must be an array of objects. A single object is treated as a one-row CSV.
What happens with nested objects?
Nested values are JSON-stringified into a single column. If you need flat columns, flatten the data before converting.
Are commas and quotes inside strings escaped?
Yes. Values containing commas, quotes, or newlines are wrapped in double quotes, and inner quotes are doubled per RFC 4180.

Related tools