CodeMash

JSON to CSV Converter Online — Free

Convert JSON arrays or objects to CSV format for spreadsheets and data analysis.

Ad Space

Frequently Asked Questions

How do I convert JSON to CSV online?

Paste your JSON array into the input box. Our converter automatically detects columns from object keys and generates CSV output with headers.

Does this handle nested JSON objects?

Yes, nested objects are automatically flattened using dot notation (e.g., address.city) so they fit into CSV columns.

Can I open the CSV in Excel or Google Sheets?

Absolutely. Copy the output and paste it into a .csv file, or directly into Excel or Google Sheets. The format is fully compatible.

What about JSON with mixed keys?

The converter handles arrays where objects have different keys by creating a superset of all columns, leaving cells empty where data is missing.

Privacy First: All processing happens directly in your browser. Your data never leaves your device.

About JSON → CSV

CSV is a flat grid and JSON is a tree, so every conversion has to answer one question: what happens to nested data? Understanding the flattening rules up front saves you from spreadsheets full of unusable object placeholders.

How nesting is flattened

Nested objects are flattened into dotted column names, so that structure survives as a naming convention rather than being discarded. An array of user objects, each with an address, produces columns like address.city and address.zip rather than a single unusable address column.

Nested JSON flattened to columns
[
  { "id": 1, "name": "Alice", "address": { "city": "Berlin", "zip": "10115" } },
  { "id": 2, "name": "Bob",   "address": { "city": "Lisbon", "zip": "1100" } }
]

id,name,address.city,address.zip
1,Alice,Berlin,10115
2,Bob,Lisbon,1100

Quoting and escaping

A CSV field is quoted when it contains a comma, a double quote, or a line break — otherwise the delimiter structure breaks. Embedded double quotes are escaped by doubling them, per RFC 4180.

This is where hand-rolled CSV export usually fails. A naive join on commas produces a file that opens in a spreadsheet with columns silently shifted from the first row containing a comma onward — data loss that looks like valid output.

Before you open it in Excel

  • Long numeric IDs are reformatted into scientific notation by Excel on import. Import the file rather than double-clicking it, and mark such columns as Text.
  • Leading zeros on postal codes and account numbers are stripped by the same mechanism.
  • Values beginning with an equals sign, plus, minus or at sign are interpreted as formulas. This is a genuine security consideration when the file will be opened by someone else — the CSV injection class of attack.
  • A ragged array, where objects have different keys, produces a header from the union of all keys with empty cells where a record lacked a field.