DevBolt
Processed in your browser. Your data never leaves your device.

How do I convert JSON to CSV online?

Paste a JSON array of objects and instantly get a CSV file with headers extracted from the JSON keys. The tool flattens nested objects, lets you select columns, and handles special characters. Download as .csv or copy to clipboard. Everything runs in your browser.

Flat JSON array to CSV
Input
[
  {"name":"Alice","age":28,"city":"NYC"},
  {"name":"Bob","age":35,"city":"London"}
]
Output
name,age,city
Alice,28,NYC
Bob,35,London
← Back to tools

JSON to CSV Converter

Convert JSON arrays to CSV format. Automatically flattens nested objects with dot notation, lets you select columns, and download as a .csv file.

About JSON to CSV Conversion

  • Nested objects are flattened using dot notation (e.g. address.city).
  • Arrays within objects are serialized as JSON strings in the CSV output.
  • Select or deselect columns after converting to customize your output.
  • Supports comma, tab, semicolon, and pipe delimiters.
  • Download the result as a .csv file ready for Excel, Google Sheets, or any spreadsheet app.
  • Everything runs in your browser — no data is sent over the network.

Tips & Best Practices

Pro Tip

Flatten nested objects before converting to CSV

CSV is inherently flat — there are no nested columns. When converting JSON with nested objects, flatten keys using dot notation (user.address.city → user_address_city). This preserves the data hierarchy in column names while keeping the output importable into Excel, Google Sheets, and databases.

Common Pitfall

Commas and newlines inside values break naive CSV parsers

If a JSON string value contains commas, quotes, or newlines, the CSV cell must be wrapped in double quotes with internal quotes escaped as "". Many hand-rolled CSV converters skip this, producing corrupt files that import incorrectly into spreadsheets and databases.

Real-World Example

Export API responses to CSV for stakeholder reports

Product managers and data analysts often need API data in spreadsheets. Converting a /api/users JSON response to CSV lets them build pivot tables and charts in Excel without writing code. Use consistent field ordering so the columns align across exports.

Security Note

CSV injection can execute formulas in spreadsheets

If JSON values start with =, +, -, or @, Excel and Google Sheets interpret them as formulas. A malicious value like '=HYPERLINK("http://evil.com","Click")' can execute when opened. Prefix dangerous values with a single quote or tab character before CSV export.

Frequently Asked Questions

How do I convert a JSON array to a CSV file?
Paste your JSON array of objects and the converter extracts all unique keys as column headers, mapping each object's values to corresponding columns. Missing values become empty cells. The output can be downloaded as a .csv file that opens in Excel, Google Sheets, or Numbers. The conversion runs entirely in your browser for privacy. This is ideal for exporting API responses, database results, and log data into spreadsheet formats.
How does the converter handle nested JSON objects?
Nested objects are flattened using dot notation for column names. A record like {user: {name: 'Alice', address: {city: 'NYC'}}} produces columns user.name and user.address.city. Arrays within records can be joined into a single cell with a delimiter. DevBolt uses dot-notation flattening by default to produce a single row per JSON object with readable column names.
What encoding issues should I watch for in JSON to CSV conversion?
Fields containing commas must be wrapped in double quotes per RFC 4180. Fields with double quotes need those quotes escaped by doubling them. Fields with newlines must be quoted. Unicode characters require UTF-8 encoding, and you may need a BOM prefix for Excel to detect UTF-8 correctly. Numeric strings like zip codes may lose leading zeros in spreadsheet applications.

Related Convert Tools