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

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→CSV: keys = union(obj.keys); rows = array.map(obj => keys.map(k => quote(obj[k]))) CSV→JSON: headers = first row; json = rows.map(row => zipObject(headers, row))

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

Assumptions and Limitations

Disclaimer: Processing happens entirely in your browser. No data is uploaded or stored.

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

Related Calculators

JSON FormatterJSON to XMLYAML to JSONBase64 EncoderURL EncoderUUID Generator