How to Convert JSON to CSV and CSV to JSON
JSON and CSV are two of the most common data formats, but they serve different purposes. JSON is great for APIs and nested data; CSV is great for spreadsheets and tabular analysis. This guide shows you how to convert between the two instantly in your browser.
When You Need JSON ↔ CSV Conversion
- You received API data in JSON and need to open it in Excel or Google Sheets
- You have a CSV dataset and need to send it as JSON to an API
- You want to flatten nested JSON into a simple table for analysis
- You need to transform data between systems that use different formats
How to Convert JSON to CSV
Step 1: Open the tool
Go to the JSON to CSV Converter.
Step 2: Paste your JSON
Paste a JSON array of objects into the input editor. For example:
[
{ "name": "Alice", "age": 30, "city": "Tokyo" },
{ "name": "Bob", "age": 25, "city": "Osaka" }
]Step 3: Click Convert
Click "Convert" and the CSV output appears with headers automatically extracted from the JSON keys. Nested objects are flattened using dot notation (e.g. address.city).
Step 4: Copy or download
Click "Copy" to paste into a spreadsheet, or "Download" to save as a .csv file.
How to Convert CSV to JSON
Step 1: Open the tool
Go to the CSV to JSON Converter.
Step 2: Paste your CSV
Paste CSV data with headers in the first row. The tool auto-detects comma and tab delimiters.
name,age,city
Alice,30,Tokyo
Bob,25,OsakaStep 3: Click Convert
The tool outputs a JSON array of objects, one per row. Headers become keys, and values are preserved as strings.
Step 4: Copy or download
Click "Copy" for use in code, or "Download" to save as a .json file.
Tips
- If your JSON has deeply nested objects, the dot-notation flattening produces column names like
user.address.city. This is readable in most spreadsheet tools. - For JSON that isn't an array of objects (e.g. a single object or primitive), format it first with the JSON Formatter to understand its structure.
- When converting CSV to JSON, make sure headers don't contain special characters — they become JSON keys.
- Need to merge two CSVs? Use the CSV Joiner to match rows by a key column.
FAQ
How does the tool handle nested JSON?
Nested objects are flattened using dot notation. For example, {"user": {"name": "Alice"}} becomes a column called "user.name" with the value "Alice". Arrays are joined with semicolons by default.
What CSV format does the tool expect?
The tool follows RFC 4180 — comma-separated values with optional double-quote escaping. It also auto-detects tab-separated (TSV) files. The first row is treated as headers.
Can I convert CSV with special characters?
Yes. Fields containing commas, newlines, or double quotes are automatically wrapped in double quotes. Unicode text (including CJK characters) is fully supported.
Is my data uploaded to a server?
No. All conversion happens entirely in your browser using JavaScript. Your data never leaves your device.
Try It Now
Ready to convert? Open the JSON to CSV Converter or the CSV to JSON Converter — both work entirely in your browser with no sign-up required.