How to Convert JSON to CSV Without Breaking Columns

Convert a JSON array to CSV or TSV in the browser, flatten nested fields, and protect formula-like cells before download.

By Haivix Team 8 min read
Abstract JSON braces converting into spreadsheet columns on a dark Haivix-style background

API responses and exports often arrive as JSON, while spreadsheets and finance teams want rows and columns. A careless conversion drops nested fields, mis-escapes commas, or turns a leading equals sign into a spreadsheet formula.

The Haivix JSON to CSV Converter parses in the browser with JSON.parse, builds comma CSV, semicolon CSV, or tab TSV, and can flatten nested objects into dotted keys. Nothing is uploaded. It does not produce Excel .xlsx or convert CSV back to JSON.

What shapes of JSON work

Best case: an array of objects, one object per row. A single object is treated as one row. If the root is an object with exactly one array property, that array becomes the row set—handy when an API wraps results in { "items": [...] }.

Primitive or non-object items become a single value column. Empty arrays or payloads with no columns produce an error instead of a blank file.

Flattening, nested arrays, and CSV safety

Turn on flatten nested objects to expand keys like contact.city into columns. Nested arrays are not exploded into extra rows—they are stored as JSON.stringify text in a cell. With flatten off, nested objects and arrays become one stringified cell each.

Fields are escaped with common CSV rules (quote wrap; internal quotes doubled). Optional formula protection prefixes string cells that start with =, +, -, or @ with a leading apostrophe so spreadsheet apps are less likely to treat them as formulas.

Copy, download, and related tools

After conversion you see row and column counts. Copy the output text, or download a UTF-8 file with BOM as converted-data.csv or .tsv. Load example and Clear help you reset the form.

Validate or pretty-print the source first with the JSON Formatter. If the JSON came from an HTTP call, API Request Studio can fetch and inspect the response before you convert.

Checklist before you open the file in Excel

Open the JSON to CSV Converter, paste the payload, set options, then copy or download. Work stays in the current tab.

  • The root shape is an array of objects (or a single wrapping array).
  • Flatten is on only when you want dotted nested keys as columns.
  • Formula protection is on if cells may start with = or +.
  • You chose comma, semicolon, or tab to match your spreadsheet locale.
  • Row/column counts look right before download.
  • Large payloads were tested; the browser can run out of memory.