HandyTools Hub

JSON to CSV Converter

Convert JSON arrays to CSV format instantly

Convert JSON data from APIs, databases, or config files into clean CSV that opens directly in Excel or Google Sheets. Paste an array of objects and get a properly escaped, standards-compliant spreadsheet in seconds — nested objects are flattened automatically. It is built for developers, analysts, and anyone moving structured data into a spreadsheet.

How to Use

  • Paste JSON: Drop a JSON array of objects into the input area.
  • Convert: Click convert to generate the CSV instantly.
  • Review the output: Check the header row and data rows.
  • Copy or download: Copy to the clipboard or save as a .csv file for import.

Features

  • Nested objects flattened into dot-notation column names
  • Keys merged across all rows — missing fields become empty cells
  • Full RFC 4180 escaping for commas, quotes, and line breaks
  • Reports row and column counts for sanity-checking
  • Works entirely in your browser — data is never uploaded

JSON vs CSV: When to Use Which?

JSON is hierarchical and self-describing: objects nest inside objects and keys travel with the data, which makes it the natural format for APIs and configuration. CSV is a flat table of rows and columns — exactly what spreadsheets, database imports, and most analysis tools expect. The trade-off is that flatness loses structure: an address object with street, city, and zip cannot fit one CSV cell. This converter bridges the gap by flattening nested keys into columns like address.city, so an API response becomes a spreadsheet without losing values. Arrays inside objects are kept as their JSON string for later processing.

Use Cases

  • API data analysis: Turn REST responses into spreadsheets for filtering and pivots.
  • Reporting: Convert database exports for stakeholders who live in Excel.
  • Data migration: Flatten JSON records before bulk database imports.
  • Logging: Convert structured JSON logs for quick inspection.

Tips for Clean Conversions

Confirm your input really is an array of objects — a wrapper like {"results": [...]} needs unwrapping first; a JSON formatter helps you inspect the structure. If rows have wildly different keys, the union of all keys becomes the columns, so trim irrelevant fields beforehand to keep the sheet readable. Spot-check values containing commas or line breaks: they should appear quoted in the output, which is exactly what Excel expects. When opening files with non-ASCII characters in Excel, use Data → From Text/CSV so you can pick the encoding and avoid mojibake.

Frequently Asked Questions

What JSON format does this converter accept?

The converter expects a JSON array of objects. Each object represents a row, and its keys become CSV column headers. Example: [{"name": "Alice", "age": 30}, {"name": "Bob", "age": 25}]. Non-array JSON will produce an error.

How are nested objects handled?

Nested objects are automatically flattened using dot notation. For example, {"user": {"name": "Alice", "age": 30}} becomes two columns: "user.name" and "user.age". Arrays within objects are kept as their JSON string representation.

What happens if objects have different keys?

The converter collects all unique keys across all objects in the array. If a row doesn't have a particular key, that cell will be empty in the CSV output. This makes it flexible for datasets with optional fields.

Will special characters break the CSV?

No. Fields containing commas, double quotes, or newlines are automatically wrapped in double quotes and properly escaped following the CSV standard (RFC 4180). The resulting CSV is compatible with Excel, Google Sheets, and other tools.