Home/Dev Tools/JSON to CSV Converter

JSON to CSV Converter

Convert

Convert JSON arrays to CSV. Choose delimiter, flatten nested objects, download.

Delimiter
Options
Input
Loading editor…
Output
Loading editor…
✨ AI Code Explanation
Mode

What Is JSON to CSV Conversion?

JSON (JavaScript Object Notation) is the standard format for APIs and web services, while CSV (Comma-Separated Values) is the universal format for spreadsheets, databases, and data analysis tools like Excel, Google Sheets, and Pandas. Converting JSON to CSV lets you open API response data directly in a spreadsheet, import it into a database, or feed it into a data pipeline — without writing any code.

How to Convert JSON to CSV

  1. Paste a JSON array of objects into the Input pane on the left, or click Upload to load a .json file.
  2. Click Convert — the CSV output appears instantly in the right pane.
  3. Choose a Delimiter: comma (default, most compatible), semicolon (European Excel), tab (TSV), or pipe.
  4. Toggle Headers off if you need a headerless CSV for direct database import.
  5. Toggle Flatten to expand nested objects into parent.child dot-notation columns.
  6. Toggle Excel BOM to prepend a UTF-8 byte-order mark — fixes garbled special characters when opening in Microsoft Excel.
  7. Click Copy to copy the CSV, or Download to save as output.csv.
  8. Use Explain with AI to get a plain-English summary of your JSON data structure before converting.

Supported Input Formats

  • Array of objects[{"a":1,"b":2}, …] — the standard table format; each object becomes one row.
  • Single object — automatically wrapped as a one-row table.
  • Nested objects — enable Flatten to produce address.city, address.zip columns using dot notation.
  • Mixed keys — when rows have different keys, missing values produce empty cells; all keys are collected across all rows.
  • Arrays / complex values — nested arrays and objects that can't be flattened are JSON-stringified in their cell.

Delimiter Guide — Which to Use?

  • Comma ( , ) — the default. Works with all CSV parsers and tools globally.
  • Semicolon ( ; ) — use this if your data contains commas (e.g. addresses) or if you're opening in European locale Excel, which uses semicolons as the default list separator.
  • Tab — produces a TSV (Tab-Separated Values) file. Best for pasting directly into spreadsheets or Postgres COPY commands.
  • Pipe ( | ) — commonly used in log files and database exports where fields may contain commas and semicolons.

Why Does Excel Show Garbled Characters?

Microsoft Excel opens CSV files assuming your system's default encoding (often Windows-1252 in Western locales), not UTF-8. When your JSON contains non-ASCII characters — accented letters, Chinese, Arabic, emoji — Excel misreads them. The fix is the Excel BOM toggle: it prepends a UTF-8 byte-order mark (EF BB BF) that signals Excel to open the file as UTF-8. Google Sheets and most other tools ignore the BOM harmlessly.

Common JSON to CSV Errors

  • Invalid JSON — check for trailing commas, unquoted keys, or missing brackets. Use the JSON Validator to pinpoint the error.
  • All data in one cell — wrong delimiter selected. If your data has commas in values and you're using comma delimiter, the parser splits inside values. Switch to semicolon or tab.
  • Nested objects showing as [object Object] — enable Flatten to expand them, or pre-process your JSON to simplify the structure.
  • Missing columns on some rows — rows have different keys. Missing cells are left empty, which is correct CSV behaviour.

Tips & Tricks

  • Excel-compatibility — Excel expects UTF-8 BOM and CRLF line endings. Enable Excel mode if your file shows mojibake when opened.
  • Choose the right delimiter — comma is default. Use semicolons for European locales where comma is the decimal separator.
  • Nested objects — JSON objects inside rows are flattened with dot notation (user.name). Arrays become JSON-stringified text.
  • Header row — the first object's keys become column headers. Use the JSON Formatter first to standardise key order.
  • Quote everything for safety — enable Force quote to wrap all values in quotes. Avoids parsing ambiguity for downstream consumers.

Related Tools

Is My Data Sent to a Server?

No. All conversion runs entirely in your browser. Your JSON data never leaves your machine. The AI Explain feature sends only the text you paste to the AI model — nothing is stored or logged.