JSON ↔ CSV Converter

Convert JSON arrays to CSV format for Excel and Google Sheets, or convert CSV data back to JSON. Handles nested objects, custom delimiters, and data type inference.

How to use JSON ↔ CSV Converter

  1. 1

    Paste your JSON array or CSV data into the input panel.

  2. 2

    Select conversion direction: JSON → CSV or CSV → JSON.

  3. 3

    Choose your delimiter (comma, semicolon, tab, or pipe).

  4. 4

    Click "Convert" to transform your data.

  5. 5

    Copy or download the output file.

Frequently Asked Questions

What JSON format is required for CSV conversion?

Your JSON must be an array of objects. Each object becomes one CSV row, and all unique keys across all objects become CSV column headers.

How are nested objects handled?

Nested objects are flattened using dot-notation. For example, {"address": {"city": "Dhaka"}} becomes a column named "address.city".

What delimiters are supported?

Comma (,), semicolon (;), tab, and pipe (|). European locales often prefer semicolons since commas are used in numbers.

Detailed Guide

The Problem JSON and CSV Solve Differently

JSON is designed for structured, hierarchical data. It handles nested objects, arrays of arrays, and mixed data types naturally. It's the format of APIs, databases, and interservice communication.

CSV is designed for tabular data — rows and columns, like a spreadsheet. It's the format of Excel, Google Sheets, data pipelines, and business analytics tools. Every data analyst you've ever met works in CSV.

The friction happens when you have data in one format and tools that expect the other. JSON from an API → needs to go into a spreadsheet for stakeholder review. A spreadsheet of customer data → needs to become JSON for an API import. Our converter handles both directions.


JSON to CSV: How It Works

Converting a JSON array to CSV is conceptually simple but has edge cases:

Step 1 — Parse the JSON. The input must be a valid JSON array of objects. Each object becomes one CSV row.

Step 2 — Extract headers. All unique keys from all objects in the array are collected to form the CSV header row.

Step 3 — Handle missing fields. If object A has a phone key but object B doesn't, the phone column in object B's row is left empty (not an error).

Step 4 — Flatten nested objects. This is where it gets complex. A key like address.city from a nested {"address": {"city": "Dhaka"}} structure needs to be flattened into a single column. Our tool uses dot-notation flattening: address.city becomes the header.

Step 5 — Handle arrays within objects. An array value like {"tags": ["react", "next"]} gets serialized as a single cell string: "react,next" (quoted to avoid CSV column confusion).

Step 6 — Quote strings with special characters. Any value containing commas, quotes, or newlines is wrapped in double-quotes per the RFC 4180 CSV standard.


CSV to JSON: How It Works

The reverse process:

  1. Parse the first row as headers
  2. Each subsequent row maps to a JSON object using those headers
  3. Data types are inferred (numbers stay numbers, true/false become booleans, empty cells become null)
  4. The result is a JSON array of objects

Delimiter Options

Standard CSV uses commas (,), but many European locales use semicolons (;) because commas appear in numbers (e.g., 1.234,56). Some tools output tab-delimited TSV format instead.

Our converter lets you specify the delimiter: comma, semicolon, tab, or pipe (|).


Real-World Use Cases

**API dat...

Looking for a more detailed deep-dive and advanced tips?

Read Full Article on our Blog