Home/ Glossary/ JSON to CSV
Konverter

JSON to CSV

The JSON ↔ CSV Converter transforms JSON arrays of objects into comma-separated value files and vice versa. It automatically detects column headers from the JSON keys, handles nested values, and lets you configure the delimiter, quoting style, and header behavior. It is the fastest way to move tabular data between APIs that speak JSON and spreadsheet tools or databases that work with CSV.

What are JSON and CSV?

JSON (JavaScript Object Notation) is a lightweight text format for structured data, supporting objects, arrays, strings, numbers, booleans, and null. It is the dominant format for REST APIs and configuration files. CSV (Comma-Separated Values) is a flat tabular format where rows are separated by newlines and fields within a row are separated by commas (or another delimiter like semicolons or tabs). CSV has no native support for nested structures or types – all values are plain strings unless interpreted by the consumer. Converting between the two requires flattening JSON objects into rows with a fixed set of columns.

How does the converter work?

For JSON-to-CSV, the tool expects a JSON array of objects at the top level. It collects all unique keys across all objects to form the header row, then emits one CSV row per object using the values for each key in header order. Missing keys in an object produce an empty field. String values containing commas, double quotes, or newlines are wrapped in double quotes per RFC 4180, with internal double quotes escaped as two double quotes. For CSV-to-JSON, the first row is treated as headers and each subsequent row becomes a JSON object with those keys.

Typical Use Cases

  • Exporting API response data to CSV for analysis in Excel or Google Sheets
  • Importing a spreadsheet export (CSV) into a system that accepts JSON
  • Transforming a database query result set from JSON format to a CSV for reporting
  • Batch converting records from a CRM or analytics tool between formats

Step-by-step Guide

  1. Step 1: Paste your JSON array or CSV content into the input field.
  2. Step 2: Select the conversion direction: JSON → CSV or CSV → JSON.
  3. Step 3: Configure delimiter, quote character, and header options if needed.
  4. Step 4: Copy or download the output file.

Example

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

Tips & Notes

  • If your JSON objects have inconsistent keys, the tool fills missing fields with empty strings to maintain column alignment.
  • Use a semicolon delimiter if your data will be opened in Excel with European locale settings that treat commas as decimal separators.
  • Nested JSON objects cannot be represented directly in CSV; flatten your JSON first or use the JSON formatter to inspect the structure.

Frequently Asked Questions

Can I convert nested JSON to CSV?
Deeply nested JSON cannot be directly represented in a flat CSV. The converter flattens one level of nesting by joining nested key names with a dot. For complex hierarchies, restructure the JSON before conversion.
Does the tool handle large files?
The tool processes data entirely in the browser. Performance depends on your device; files with tens of thousands of rows work well, but very large files (>50 MB) may be slow and are better handled by a command-line tool like jq or csvkit.
What delimiter should I use for TSV (tab-separated values)?
Select 'Tab' as the delimiter in the options. TSV files avoid ambiguity when data fields contain commas, making them a popular choice for data exchange between spreadsheet tools.
JSON to CSV
Convert JSON arrays to CSV — with automatic column detection, nested object flattening, delimiter selection, and a tabular preview.
Open Tool