JSON to CSV Converter
About JSON to CSV Converter
The JSON to CSV Converter transforms JSON arrays into CSV format, making it easy to import data into spreadsheet applications like Microsoft Excel, Google Sheets, or Apple Numbers. The tool handles nested objects by flattening them with dot notation and converts arrays to JSON strings. All conversion happens in your browser, ensuring your data remains private and secure.
How to Use
- Paste your JSON array into the input field. The JSON must be an array of objects.
- The tool will automatically convert your JSON to CSV after a brief pause.
- Choose your preferred delimiter (comma, semicolon, tab, or pipe) from the dropdown.
- Toggle "Include Headers" to add or remove column headers in the CSV output.
- Click "Table" to preview your data in a formatted table, or "Text" to see the raw CSV.
- Click "Download CSV" to save the converted file to your computer.
Frequently Asked Questions
What format should my JSON be in?
Your JSON must be an array of objects. Each object in the array will become a row in the CSV, and the object keys will become column headers. Example: [{"name": "John", "age": 30}, {"name": "Jane", "age": 25}]
How are nested objects handled?
Nested objects are automatically flattened using dot notation. For example, {"user": {"name": "John", "age": 30}} becomes two columns: "user.name" and "user.age". This ensures all data is preserved in the CSV format.
What happens to arrays within the JSON?
Arrays are converted to JSON strings within the CSV cells. This preserves the array data while keeping the CSV format valid. You can parse these back into arrays if needed when importing the CSV.
Which delimiter should I use?
Use comma for standard CSV files that work with most applications. Use semicolon if your data contains many commas or for European Excel versions. Use tab for easy pasting into spreadsheets. Use pipe if your data contains commas and semicolons.
Can I convert CSV back to JSON?
While this tool converts JSON to CSV, you would need a separate CSV to JSON converter for the reverse operation. Many spreadsheet applications can also export to JSON format directly.
What if my JSON objects have different keys?
The converter automatically handles objects with different keys. It collects all unique keys from all objects and creates a column for each. Objects missing certain keys will have empty values in those columns.
Can I preview the CSV as a table?
Yes! Click the "Table" button above the output area to view your CSV data in a formatted table with rows and columns. This makes it easier to verify the data before downloading. You can switch back to "Text" view to see the raw CSV format.
Is my data secure?
Yes! All conversion happens entirely in your browser. Your JSON data is never sent to any server, ensuring complete privacy and security. The tool works offline once loaded.