📋

JSON to CSV

Convert JSON array to CSV format with automatic column detection.

Input
CSV Output

📖 What is JSON to CSV?

JSON to CSV converts a JSON array of objects into comma-separated values (CSV) format, which you can open in Excel, Google Sheets or any spreadsheet tool. The converter auto-detects column headers from object keys and handles nested objects by flattening them into dot-notation columns.

Use it to export API response data into spreadsheets, prepare data for import into databases or reporting tools, or quickly visualize JSON data in tabular form. Everything runs in your browser — your data is never uploaded.

💡 Example

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

🛠️ Common Use Cases

  • Exporting API response data to Excel or Google Sheets for analysis
  • Converting MongoDB or Elasticsearch query results into spreadsheet format
  • Preparing JSON data for CSV-based database imports
  • Creating reports from JSON log files or analytics data
  • Sharing API data with non-technical stakeholders in a readable format

📝 How Nested JSON is Handled

When a JSON object contains nested objects, the converter flattens them using dot notation. For example, {"user": {"name": "Alice"}} becomes a column called user.name. Arrays inside objects are joined with commas or serialized as JSON strings depending on depth.

For deeply nested JSON, consider using a JSON path query to extract the specific fields you need before converting.

⚠️ Common Mistakes

  • Input is not an array — CSV conversion expects a JSON array of objects [{...}, {...}]. A single object needs to be wrapped in brackets first.
  • Inconsistent keys across objects — if some objects have fields others don't, missing values become empty columns. This is normal but check the output headers.
  • Commas in values — the converter wraps values containing commas in quotes. If your CSV reader isn't handling quoted fields, check its import settings.
  • Large arrays — very large JSON files (10MB+) may be slow in the browser. For production ETL, use a scripted solution.

❓ Frequently Asked Questions

Can I convert nested JSON?
Yes — nested objects are flattened with dot notation (e.g. user.name). Nested arrays are serialized as comma-separated strings. For deeply nested structures, consider extracting the specific fields you need first.
What if my JSON objects have different keys?
The converter creates columns for all unique keys found across all objects. Objects missing a key get an empty value for that column.
Can I open the CSV in Excel?
Yes — copy the CSV output and paste it into a .csv file, or paste directly into Excel using Data → From Text. Excel auto-detects comma-separated columns.
Is my data private?
Yes — all processing runs entirely in your browser using JavaScript. Your data is never sent to any server.
Is this tool free?
Completely free — no login, no usage limits, and it works offline once the page is loaded.
Yes — completely free, no login required, no usage limits.
Is my data private?
Yes — all processing runs in your browser. Your data is never sent to any server.
Does it work offline?
Yes — once the page is loaded, the tool works without an internet connection.
🔒
Your data stays private. All processing happens entirely in your browser using JavaScript. Nothing is ever sent to our servers. You can even use this tool offline after the page loads.