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.

JSON to CSV

Use JSON to CSV when you have an API response, export file, or array of objects and need rows for Excel, Google Sheets, Airtable, or a database import. Paste the JSON, keep the direction set to JSON to CSV, and check the preview before downloading. The cleanest input is an array where each object uses the same field names, because those fields become the CSV column headers.

If your JSON has nested objects, flatten those fields first or turn them into clear text values. That keeps the CSV easy to sort, filter, and share with people who do not work directly with JSON.

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.

JSON to XML Converter

Use the JSON to XML Converter section when an API gives JSON but an older feed, CMS, or integration expects XML. A simple JSON object like {"name":"Ana","score":92} becomes XML such as <item><name>Ana</name><score>92</score></item>. The reverse XML to JSON workflow follows the same key names back into an object.

YAML to JSON and JSON to YAML

For config files, paste YAML to JSON when a service needs strict braces and quotes. Use json to yaml online when the same data should be easier to read in a deployment file. This page also remains a json to csv converter online tool free for flat arrays that need spreadsheet rows.

Frequently Asked Questions

1: What delimiter should I use for a CSV file in Excel?

For Excel, a comma is the safest default delimiter because CSV literally means comma-separated values. However, Excel also follows your computer's regional settings. In some countries, especially where comma is used as a decimal separator, Excel may expect a semicolon instead. If your data contains many commas inside text, choose tab-separated values (TSV) or semicolon CSV to reduce quoting issues. My practical advice is simple: use comma for general sharing, semicolon for regional Excel users, and tab when the data has lots of punctuation.

2: How do I convert a JSON array of objects to CSV?

Start with a JSON array where each item is an object, such as a list of users or products. The converter reads all object keys, turns them into CSV column headers, then writes one row per object. Simple values become cells. Nested objects or arrays usually need flattening first, for example address.city or tags.0. Before exporting, check that each object has a consistent shape, because missing keys become blank cells. After conversion, open the CSV in Excel or a text editor to confirm the headers and rows look right.

3: How do I convert CSV with quoted fields back to JSON?

A proper CSV parser understands quoted fields, so commas inside quotes stay inside the same cell instead of becoming new columns. For example, "Mumbai, India" should become one JSON value, not two. When converting back to JSON, the first row is usually treated as headers, and each following row becomes an object. The important part is escaping quotes correctly: a quote inside a quoted field is written as two quotes. Do not split CSV manually with commas; use the converter or a real parser so line breaks and quoted commas are handled safely.

4: Can I convert JSON to CSV without uploading the file?

Yes. On BulkCalculator's developer tools, the conversion is designed to run directly in your browser, so your file content does not need to be uploaded to a server. That is helpful when you are handling customer exports, logs, or internal configuration data. You can paste JSON into the tool, choose CSV options, and download the result locally. Still, treat sensitive data carefully: avoid public/shared computers, clear the page afterward, and do not paste secrets such as API keys unless you are sure the environment is trusted.

5: How do I convert JSON to TSV (tab-separated values)?

TSV is almost the same idea as CSV, but the delimiter is a tab character instead of a comma. In the converter, choose tab as the delimiter or select TSV output if the option is available. This is useful when your text fields contain commas, because tabs are less common in normal sentences. The JSON array is still converted into rows and columns the same way. After download, save the file with a .tsv extension and open it in Excel, Google Sheets, or any editor that supports tab-separated data.

6: Why does my CSV file have extra commas after JSON conversion?

Extra commas usually mean some rows have fewer values than the full header list. When JSON objects do not all contain the same keys, the converter keeps the complete set of columns and leaves blank cells where a property is missing. Those blanks appear as consecutive commas in plain CSV text. Another common reason is nested data being flattened into extra columns. This is not always an error. Check the header row, compare one problem row with the original JSON, and decide whether you want to remove empty columns before exporting.

7: Can I convert JSON to CSV preserving the column order?

Yes, but the best result comes from controlling the key order before conversion. Most converters use the order of keys found in the first object, then add new keys discovered later. If later objects have different structures, new columns may appear at the end. For a clean export, make the first JSON object contain all expected fields in the order you want. You can also manually reorder columns in the preview before downloading, if the tool supports it. For repeatable business reports, keep a fixed schema.

8: How do I convert CSV with headers in the second row to JSON?

If the real headers are in the second row, remove or skip the first row before converting. Many CSV files begin with a title, report date, or blank line, and that should not become JSON field names. In the tool, look for a "skip rows" or "headers row" option. If there is no option, quickly edit the CSV so the second row becomes the first line. Then convert normally: headers become object keys, and every row under them becomes one JSON object with matching property names.

9: What is the maximum file size for an online JSON-to-CSV converter?

The practical limit depends on your browser, device memory, and the tool's implementation. Since BulkCalculator's developer tools are browser-based, very large files are processed locally, which protects privacy but also means your laptop or phone does the heavy lifting. Small and medium exports usually work smoothly. For huge files, such as hundreds of megabytes, use a desktop script, database export, or command-line tool. A good rule is to try a small sample first, confirm the output format, then process the full file in batches if needed.

Sources and References

Related Calculators

JSON FormatterJSON to XMLYAML to JSONBase64 EncoderURL EncoderUUID Generator