</>DevTools

CSVJSON ↔ CSV

Convert between JSON and CSV formats

JSON ↔ CSV Conversion Complete Guide

JSON and CSV are the two most widely used formats for storing and exchanging data. JSON excels at hierarchical data representation, while CSV opens directly in Excel or Google Sheets — ideal for analysis and sharing. Whether you need to import API responses into a spreadsheet, or convert tabular CSV data into a JSON payload, this tool gives you an instant, browser-side solution.

Handling Nested JSON and Arrays

Basic Conversion Rules

The core input for JSON → CSV is an array of objects. Each object key becomes a CSV column header, and each object becomes a row.

// JSON input
[
  {"name": "Alice", "age": 30, "city": "Seoul"},
  {"name": "Bob",   "age": 25, "city": "Busan"}
]

// CSV output
name,age,city
Alice,30,Seoul
Bob,25,Busan

Nested Object Caveats

Nested objects ({"address": {"city": "Seoul"}}) are not auto-flattened. Verify your structure in the JSON Formatter tool and flatten manually before converting. Array values ("roles": ["admin", "user"]) are serialized as strings.

Common Escape Issues

  • Values with commas: Automatically wrapped in double quotes per RFC 4180.
  • Values with newlines: Wrapped in double quotes, newline preserved.
  • Values with double quotes: Escaped as "".

Fixing Excel Encoding Issues

If Korean or special characters look garbled in Excel, use Data → Get Data → From Text/CSV and set the encoding to UTF-8. Alternatively, save the file with a UTF-8 BOM using Notepad (Windows) or TextEdit (Mac).

Practical Example: API Response → Spreadsheet

Paste a JSON response from GitHub API, Notion API, or any REST endpoint, click JSON → CSV, and you have a spreadsheet-ready file instantly. You can also paste the CSV output directly into Google Sheets without saving a file.

🔗Related Tools🔄 Text / Data