HomeFile Converter ToolsJSON to CSV
JS→CSV
File

JSON to CSV Converter

Convert JSON arrays to CSV. Handles nested objects (dot-notation flattening), arrays of arrays, missing keys, and multi-level nesting. Choose delimiter, quote style, and whether to include headers. Live preview with row count.

🔀 Nested object flatten📋 Choose delimiter👁 Live preview⬇ Download CSV
Converters:
🔒 100% Private — All conversion runs in your browser. No files are uploaded to any server.

📖 How to Use JSON to CSV

  1. 1
    Paste JSON and set options

    Paste a JSON array (array of objects, array of arrays, or a single object) into the input. Set delimiter (comma, tab, semicolon), whether to include a header row, and how to handle nested objects — either flatten to dot-notation (user.address.city) or stringify them.

  2. 2
    Preview the CSV output

    The CSV appears in the output panel. A row count is shown. Check that nested fields have flattened correctly and that multi-value arrays are represented as expected.

  3. 3
    Copy or download

    Click Copy to clipboard or Download CSV. The output is UTF-8 encoded with a BOM for Excel compatibility on Windows. Quote characters are properly escaped.

💡 Quick Reference

JSON type Handling
Array of objects Standard rows
Nested object Flattened: a.b.c
Array in object Joined: x;y;z
Missing key Empty cell

Frequently Asked Questions — JSON to CSV

What JSON structures are supported?

Array of objects: [{name:"Alice",age:30}] — standard, headers from keys. Array of arrays: [["Alice",30],["Bob",25]] — no headers by default. Single object: {"a":1,"b":2} — converts to a two-row CSV (key, value). Nested objects: {user:{name:"Alice",address:{city:"London"}}} — flattened to user.name, user.address.city columns.

How are nested objects handled?

Dot-notation flattening: {address:{city:"London",postcode:"E1"}} becomes two columns — address.city and address.postcode. This is the most useful option for databases and spreadsheets. Stringify: nested objects are JSON.stringify-d and placed in a single cell — useful when you want to preserve the original structure. Arrays in objects are handled as comma-joined strings or separate rows depending on your setting.

How are missing keys handled?

If different records have different keys, all unique keys across all records are used as column headers. Missing values for a given record output as empty cells. Example: record 1 has {name, email}, record 2 has {name, phone} — output has three columns: name, email, phone, with record 1 missing phone and record 2 missing email.

Why is a BOM added to the CSV output?

A UTF-8 BOM (Byte Order Mark, the sequence EF BB BF at the start of the file) helps Microsoft Excel on Windows correctly detect that the file is UTF-8 encoded. Without it, Excel may interpret the file as Windows-1252, causing accented characters, Chinese text, and other non-ASCII content to display as garbled characters. The BOM is harmless for other applications that handle UTF-8 correctly.

Can I convert JSON to Excel directly?

Use the CSV to Excel converter after converting JSON to CSV — this two-step process gives you an Excel file. Alternatively, tools like SheetJS support direct JSON to Excel conversion in JavaScript. For Python: import pandas as pd; df = pd.DataFrame(data); df.to_excel("output.xlsx", index=False).

How do I handle JSON arrays within objects?

Arrays within objects (e.g., tags: ["python", "javascript"]) can be handled in three ways: join as string ("python,javascript"), create separate columns for each index (tags.0, tags.1), or create separate rows for each array element. This tool joins arrays as semicolon-separated strings by default, which is the most spreadsheet-compatible approach.