JSON to CSV Converter

Convert a JSON array of objects to CSV and CSV back to JSON, with proper quoting and escaping.

Paste JSON or CSV above to see the converted output

JSON to CSV Converter

JSON (JavaScript Object Notation) and CSV (Comma-Separated Values) are two of the most common data interchange formats. This tool converts a JSON array of flat objects into a well-formed CSV file, automatically extracting column headers from the object keys, and escaping any fields that contain commas, double-quotes, or newlines according to RFC 4180.

You can also convert in the reverse direction — paste a CSV file and get back a JSON array of objects, ready to use in any programming language or API. The parser correctly handles quoted fields, embedded commas, and escaped double-quotes, making it suitable for real-world data exports from spreadsheets, databases, and SaaS platforms.

How it works

JSON → CSV: extract unique keys as header row, then for each object emit a row of values in the same order; wrap any value containing a comma, double-quote, or newline in double-quotes and escape internal double-quotes by doubling them (RFC 4180). CSV → JSON: parse the header row as keys, split each subsequent row into fields using the same quoting rules, and pair each field with its corresponding header to form an object.

Use cases

  • Exporting API response data into a spreadsheet-friendly CSV for analysis in Excel or Google Sheets
  • Importing CSV database dumps back into a JavaScript or Python application as structured JSON
  • Preparing data migrations between systems that use different formats
  • Quickly inspecting the structure of a JSON API payload in tabular form
  • Converting configuration or seed data between JSON and CSV for use in ETL pipelines

Frequently asked questions

How do I convert JSON to CSV?

Paste a JSON array of objects into the tool and it extracts the unique object keys as the CSV header row, then emits one row of values per object in the same column order. Fields containing commas, double-quotes, or newlines are automatically quoted and escaped per RFC 4180. The result is ready to open in Excel or Google Sheets.

Can I convert CSV back to JSON?

Yes, the converter is bidirectional. Paste a CSV and the first row is parsed as keys; each subsequent row is split into fields using the same quoting rules and paired with its header to form an object. The output is a JSON array of objects ready to use in JavaScript, Python, or any API.

How are commas and quotes inside values handled?

Following RFC 4180, any value containing a comma, double-quote, or newline is wrapped in double-quotes, and internal double-quotes are escaped by doubling them. For example, the value He said \"hi\" becomes \"He said \"\"hi\"\"\" in the CSV output. The CSV-to-JSON direction reverses these rules when parsing.

What structure does my JSON need for CSV conversion?

The input should be a JSON array of flat objects, such as [{\"name\": \"Ana\", \"age\": 30}]. Each object becomes one CSV row and the union of keys becomes the header. Nested objects or arrays inside values do not map cleanly to CSV columns, so flatten them first (e.g., address.city as a single key).

Is my data uploaded to a server?

No. The conversion runs entirely in your browser using client-side JavaScript, and no data is transmitted or stored anywhere. This makes the tool safe for exports containing internal or sensitive information, and it also works on large payloads without upload limits.

Related Calculators