From JSON records to spreadsheet rows
JSON and CSV solve the same problem—representing data as structured text—but for different audiences. JSON is hierarchical and self-describing, ideal for APIs and nested data. CSV is flat and simple, perfect for spreadsheets and data analysis. Converting between them happens constantly: you export JSON data from an API and need to load it into Excel, or you have a CSV of customer records that a backend API expects as JSON. This tool handles the conversion, flattening nested objects into dot-notation columns so nothing is lost.
CSV (Comma-Separated Values) sounds simple—just comma-delimited text—but correctness requires careful escaping. Per RFC 4180, quoted fields protect commas, newlines, and quotes themselves. This tool generates CSV exactly per spec, quoting headers and values, escaping internal quotes by doubling them. The result is compatible with Excel, Google Sheets, and any standard CSV reader.
How JSON-to-CSV conversion works
The conversion assumes a JSON array of objects, where each object becomes a CSV row. The first step is collecting all unique keys across all objects to form the header row. If objects have different shapes (some missing fields, some with extras), all keys appear as column headers and missing values become empty cells.
Nested objects are flattened using dot notation: an object {"person": {"name": "John", "age": 30}} becomes columns person.name and person.age. Arrays remain stringified (they can't flatten cleanly into single columns). The tool then generates CSV by quoting all fields and escaping internal quotes by doubling them.
One quirk: Excel sometimes misinterprets UTF-8 CSV files. If your data contains non-ASCII characters and Excel displays them wrong, prepending a byte-order mark (BOM) signals UTF-8 explicitly. This tool doesn't add a BOM by default, but some exported CSV files have one.
Common JSON-to-CSV scenarios
- API data export. Fetch JSON from a REST API and convert to CSV for analysis in Excel or Google Sheets.
- Database dumps. Export database records as JSON (e.g., from MongoDB or PostgreSQL JSON functions) and convert to tabular CSV.
- Reporting. Generate JSON reports from business logic, then convert to CSV for stakeholders who prefer spreadsheets.
- Data migration. Convert JSON config or data files to CSV for import into a different system.
- Batch processing. Convert bulk API responses to CSV, then use spreadsheet formulas or pivot tables for analysis.
Frequently asked questions
What happens to nested objects or arrays?
Nested objects are flattened with dot notation: {"address": {"city": "NYC"}} becomes the column address.city. Arrays are converted to strings (e.g., [1,2,3]becomes the text "[1,2,3]" in a single cell), which isn't ideal for analysis but preserves the data.
Why does Excel show strange characters?
Excel sometimes assumes the wrong encoding. If you export CSV with non-ASCII characters and see garbled text, try opening the CSV in Excel and explicitly selecting UTF-8 encoding. Alternatively, some tools add a UTF-8 BOM at the start of the file to signal encoding.
Can I specify a custom delimiter (semicolon or tab)?
This tool generates standard CSV (comma-delimited per RFC 4180). If you need a different delimiter (semicolon is common in European locales), download the CSV and open it in a text editor to replace commas. Or load it into Google Sheets, which lets you re-save with a different delimiter.
Is my JSON data stored or sent anywhere?
No. All conversion happens in your browser. Your JSON data never leaves your device, making this tool safe for sensitive business data, customer records, or private information.