JSON to CSV Converter

The JSON to CSV Converter transforms JSON data into CSV (Comma-Separated Values) format, making it easy to import into spreadsheets, databases, and data analysis tools. CSV is universally supported by Excel, Google Sheets, and business intelligence tools. This converter handles flat JSON objects and arrays of objects, extracting keys as column headers and values as rows. It is ideal for data export, reporting, and sharing structured data with non-technical users who need spreadsheet access.

Formula

Conversion logic:
1. Extract all unique keys as column headers
2. For each JSON object, create a CSV row
3. Nested objects are flattened with dot notation
4. Arrays are joined with semicolons
5. Values are quoted if they contain commas

CSV format: RFC 4180

Example

Input JSON: [{"name":"Alice","age":30,"city":"NYC"}, {"name":"Bob","age":25,"city":"LA"}] Output CSV: name,age,city Alice,30,NYC Bob,25,LA

How to Use

  1. Paste your JSON array of objects into the input
  2. The converter extracts all keys as columns
  3. Click convert to generate CSV
  4. Download or copy the CSV output
  5. Open in Excel, Google Sheets, or your database tool

Frequently Asked Questions

Can I convert nested JSON to CSV?

Yes, nested objects are flattened using dot notation. For example, {"user":{"name":"Alice"}} becomes a column named 'user.name' with value 'Alice'. Deeply nested structures may produce many columns.

How are arrays handled in CSV?

Arrays within JSON objects are joined with a separator (usually semicolons) and placed in a single CSV cell. For example, ["red","blue"] becomes "red;blue" in the CSV output.

What if my JSON objects have different keys?

The converter collects all unique keys across all objects and uses them as columns. Missing values are left empty in the CSV. This ensures no data is lost when objects have inconsistent schemas.

Does CSV support special characters?

Yes, values containing commas, quotes, or newlines are wrapped in double quotes per RFC 4180. Quotes within values are escaped by doubling them. This ensures proper parsing in Excel and other tools.

What is the maximum JSON size for conversion?

Most browsers handle JSON up to 50MB. For larger datasets, use a server-side tool like Python's pandas or Node.js csv-writer. This online tool is best for datasets under 10MB.