Input Size 0 B
JSON_INPUT
1
Convert
CSV_OUTPUT
1
Formatted output will appear here...

What is JSON to CSV Converter?

Convert JSON arrays and objects to CSV format for use in spreadsheets and databases. Handles nested structures and automatically generates column headers.

CSV (Comma-Separated Values) is the universal format for spreadsheets. Converting JSON to CSV lets you analyze API data in Excel, Google Sheets, or import into databases like MySQL and PostgreSQL.

How to Convert JSON to CSV

  1. Paste JSON array: Add JSON array of objects [{key: "value"}]
  2. Automatic conversion: Tool generates CSV with headers from object keys
  3. Nested objects: Automatically flattened using dot notation (user.email)
  4. Copy or download: Use CSV in Excel, Google Sheets, or database imports
  5. Works with single objects: Converts to 1-row CSV with headers

Why Convert JSON to CSV?

Analyze API Data in Spreadsheets

Export API responses to Excel or Google Sheets for analysis. Non-technical stakeholders can filter, sort, and create charts from JSON data without writing code.

Import to Databases

Most databases (MySQL, PostgreSQL, SQL Server) have built-in CSV import tools. Convert JSON to CSV to bulk-import data without writing complex SQL scripts.

Share Data with Non-Developers

Business analysts, marketers, and project managers understand spreadsheets. Convert JSON reports to CSV so they can work with the data in familiar tools.

Data Migration

When migrating between systems, CSV is a safe intermediate format. Export from JSON API, convert to CSV, then import to new system using standard CSV loaders.

Supported JSON Formats

  • Array of objects: [{name: "Alice", age: 30}, {name: "Bob", age: 25}] → 2 rows
  • Single object: {name: "Alice", age: 30} → 1 row with headers
  • Nested objects: {user: {email: "a@b.com"}}} → user.email column
  • Arrays in values: {tags: ["a", "b"]} → "a,b" in cell
  • Mixed types: Handles strings, numbers, booleans, null
  • Empty arrays: Converted to empty CSV with error message

Key Features

  • Automatic headers: Generates column names from JSON keys
  • Nested flattening: Converts user.profile.email to flat columns
  • Array handling: Preserves array data as comma-separated values
  • Type preservation: Numbers stay as numbers, not strings
  • Download CSV: Save as .csv file for Excel/Sheets
  • Copy to clipboard: Paste directly into spreadsheets
  • Client-side: Your data stays in browser (PapaParse library)
  • Large files: Handles 1000+ row JSON arrays

CSV Import Tips

Excel: Open Excel → Data tab → From Text/CSV → Select your downloaded .csv file. Excel auto-detects delimiters and imports cleanly.

Google Sheets: File → Import → Upload → Select .csv file. Choose "Detect automatically" for separator type. Data imports into new sheet.

MySQL: Use LOAD DATA INFILE 'file.csv' INTO TABLE table_name FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n' IGNORE 1 ROWS;

PostgreSQL: Use \copy table_name FROM 'file.csv' DELIMITER ',' CSV HEADER; command in psql terminal.

Common Issues and Solutions

  • Commas in data: Values with commas are automatically quoted ("value, with, commas")
  • Quotes in data: Quotes are escaped with double quotes (""quoted text"")
  • Nested arrays: Arrays inside arrays are converted to JSON strings
  • Different keys: If objects have different keys, all columns are included (missing values are empty)

Related Tools

Before or after converting JSON to CSV: