What This Tool Does
This bidirectional converter transforms JSON arrays of objects into CSV format and CSV spreadsheets into JSON arrays. It auto-detects column headers, handles quoted fields with embedded commas, escapes special characters, and supports custom delimiters. Perfect for moving data between APIs, databases, and spreadsheets.
Inputs Explained
- Direction: JSON → CSV or CSV → JSON.
- Input: Paste the JSON array or CSV text.
- Delimiter: Comma (default), semicolon, tab, or pipe.
- Headers: Whether the first CSV row contains column names.
How It Works
JSON to CSV: parses input as a JSON array, collects all unique keys across objects for the header row, then emits one row per object with properly quoted values. CSV to JSON: parses the CSV respecting quoted fields, uses the first row as keys, and produces an array of objects with each subsequent row as a record.
Formula / Logic Used
JSON to CSV & CSV to JSON Converter
Convert JSON arrays to CSV rows or CSV back to JSON — in one click.
Step-by-Step Example
Input JSON:
[
{"name":"Alice","age":30,"city":"Delhi"},
{"name":"Bob","age":25,"city":"Mumbai"}
]
Output CSV:
name,age,city Alice,30,Delhi Bob,25,Mumbai
Use Cases
- API to spreadsheet: Convert API responses into CSV for analysis in Excel or Google Sheets.
- Spreadsheet to API: Transform CSV exports into JSON payloads for REST API imports.
- Database imports: Prepare data in the format your database tool requires.
- Data migration: Move data between systems that use different formats.
- Quick data inspection: Convert JSON arrays to CSV for easier visual scanning.
Assumptions and Limitations
- Nested objects in JSON are serialized as [object Object] in CSV — flatten them first if needed.
- CSV parsing follows RFC 4180 with quoted field handling, but malformed CSV may produce unexpected results.
- Very large datasets (10,000+ rows) may slow the browser; consider splitting into smaller batches.
- JSON must be an array of objects at the top level; a single object or nested structure won't convert directly.
Frequently Asked Questions
Does the tool handle quoted CSV fields with commas inside?
Yes. The CSV parser follows RFC 4180 — fields wrapped in double quotes can contain commas, newlines, and escaped quotes (""). Your data's quoted values are preserved correctly.
What if my JSON objects have different keys?
The tool collects all unique keys across all objects for the CSV header row. Missing values in specific objects become empty cells in the output.
Can I convert nested JSON to CSV?
Nested objects and arrays are not automatically flattened. For nested data, pre-process your JSON to flatten it (e.g., user.name becomes user_name) before converting.
What delimiters are supported?
Comma, semicolon, tab, and pipe. European locales often use semicolon because comma is the decimal separator. Tab is useful when data contains commas. Choose whichever matches your target system.
Is UTF-8 supported?
Yes. All text is processed as UTF-8, so accented characters, emoji, and Unicode from any language are preserved through conversion.
Can I upload a file?
This tool processes pasted text only. Copy the file contents (Ctrl+A, Ctrl+C) and paste into the input box — this keeps everything client-side and private.
How big can my data be?
Several megabytes work comfortably on modern browsers. For very large datasets, split into chunks of a few thousand rows and convert separately.
Is my data private?
Yes. Everything runs in your browser using native JavaScript. Data never leaves your device — you can even use this tool offline once the page has loaded.
Sources and References
- RFC 4180 — CSV Format — Official CSV format specification.
- ECMA-404 — JSON Standard — JSON format specification.
- MDN — JSON.parse — Browser API used for JSON parsing.
- W3C — CSV on the Web — Modern guidance on tabular data exchange.