JSON to CSV Converter — Free Online Tool
Convert JSON arrays to CSV format online. Handles nested objects and arrays. Free, browser-based.
JSON is the standard format for web APIs, but CSV is widely used in spreadsheets, databases, and data analysis tools. This tool converts a JSON array of objects to CSV format, using the object keys as the CSV header row. It uses PapaParse's unparse function which handles all RFC 4180 escaping correctly — fields containing commas or double quotes are automatically quoted. If the JSON contains nested objects or arrays, they are serialised to strings in the corresponding CSV cell.
How to use
- Paste your JSON array into the input textarea.
- Click 'Convert to CSV' to generate the CSV output.
- Copy the CSV to clipboard or download it as a .csv file.
FAQ
What JSON structure is expected as input?
The tool expects a JSON array of objects, where each object represents a row and its keys represent the column names. For example: [{"Name": "Alice", "Age": 30}, {"Name": "Bob", "Age": 25}]. If the input is a single JSON object (not an array), it is automatically wrapped in an array before conversion. Other JSON structures (arrays of arrays, primitive values) are not supported and will produce an error.
How are inconsistent objects handled?
If the objects in the array have different keys (some rows have columns that others lack), the CSV header row will include all unique keys found across all objects. Rows that are missing a key will have an empty cell in the corresponding column. This ensures no data is lost, though the resulting CSV may have sparse rows.
What happens to nested objects and arrays in the JSON?
JSON supports nesting — an object value can itself be an object or array. CSV is flat and does not support nesting. Nested values are serialised to their JSON string representation and placed in the CSV cell as a string (quoted if necessary). For example, a nested array [1, 2, 3] becomes the string '[1,2,3]' in the CSV cell.
How are special characters handled in the output?
The PapaParse unparse function handles RFC 4180 escaping automatically. If a cell value contains a comma, double quote, newline, or carriage return, the entire value is wrapped in double quotes in the output. Embedded double quotes are escaped by doubling them. This ensures the CSV output is correctly parseable by all compliant CSV parsers.
Can I control the delimiter or quote character?
This tool outputs standard comma-delimited CSV with double-quote escaping, which is the most universally compatible format. For tab-delimited output (TSV) or other delimiters, the tool does not currently offer delimiter selection. You can manually replace commas with tabs in the output if needed, being careful not to replace commas inside quoted fields.
Is the conversion done in my browser or on a server?
The conversion runs entirely in your browser using the PapaParse library. Your JSON data is never uploaded to any server, making this tool safe for confidential API response data, customer records, or other sensitive information.