Flattening nested JSON for tabular output
JSON is hierarchical (objects nested within objects), while CSV is strictly two-dimensional (rows and columns). Our converter handles nested objects by flattening keys with dot notation (e.g., "address.city" becomes a column header). Arrays within JSON objects are the hardest case — an array of addresses for one user produces either multiple rows (denormalized) or a single JSON-stringified cell. Our tool offers both modes: "expand" creates one row per array element (repeating parent data), and "compact" stores arrays as JSON strings in a single cell.
Large JSON arrays (100,000+ objects) can cause browser memory issues because the entire dataset must be processed client-side. For production ETL pipelines, use a backend tool like jq or a streaming CSV parser. Our tool is best suited for moderate-sized data (up to ~10 MB of JSON) for analysis or import into spreadsheet applications.
CSV encoding pitfalls
CSV has no official encoding standard (RFC 4180 is the closest). Common issues include: values containing commas (must be quoted with ""), values containing double quotes (must be escaped as ""), and multi-line values (must be quoted). Our converter follows RFC 4180 strictly: all cells are properly quoted and escaped. It also detects the delimiter — some systems expect semicolons as delimiters (European locales) — and lets you switch between comma, semicolon, and tab. For Excel compatibility (especially on non-English systems), semicolon-delimited CSV is often required.
Character encoding is another common source of errors. Our converter outputs UTF-8 with BOM, which Excel for Windows uses to correctly detect the encoding. Without the BOM, Excel may interpret UTF-8 text as Windows-1252, mangling special characters like accented letters and em dashes.
How to use the JSON to CSV Tool
Step 1: Paste your JSON data into the input area. The JSON should be an array of objects (like API response data) or a single object that can be flattened into a row.
Step 2: The tool automatically detects the JSON structure and flattens nested objects using dot notation (e.g., "address.city" becomes a column header).
Step 3: Preview the first few rows of the CSV output to verify that columns are correct and data is properly aligned before downloading.
Step 4: Choose the delimiter if needed — comma for standard CSV, semicolon for European locale Excel compatibility, or tab for TSV format.
Step 5: Download the CSV file using the download button, or copy the CSV text directly to paste into Excel, Google Sheets, or your data processing tool.
Step 6: Open the CSV in your spreadsheet application and verify that all columns are present and data types are correct (numbers as numbers, not strings).
Common mistakes and how to fix them
Error: JSON is not an array of objects. The tool works best with JSON arrays like [{"name":"Alice"},{"name":"Bob"}]. A single object or deeply nested structure without a clear tabular shape may not convert correctly.
Error: Inconsistent keys across objects. If some objects have keys that others do not, the CSV fills missing cells with empty values. Review the column list to ensure all expected fields are present.
Error: Excel displays numbers as text. This happens when the CSV lacks a BOM (Byte Order Mark). Our tool outputs UTF-8 with BOM for Excel compatibility. If using another tool, add the BOM prefix.
Error: Commas in data values breaking CSV format. Values containing commas must be enclosed in double quotes in CSV. Our tool follows RFC 4180 and quotes all cells properly to prevent this issue.
Error: Nested arrays producing unexpected output. Arrays within JSON objects can expand to multiple rows or be stored as JSON strings. Choose the expand mode for one row per array element, or compact mode for a single cell.
Tips and best practices
Preview the first 5 rows before downloading the full CSV. This catches unexpected nesting, missing keys, or data type issues that would produce empty or incorrectly formatted columns.
Use semicolon delimiters for European locale Excel installations where commas are used as decimal separators. Comma-delimited CSV may import incorrectly in these locales.
For large JSON datasets (100,000+ objects), consider using a backend tool like jq or a streaming CSV parser. Browser-based conversion may slow down with very large datasets.
After converting, open the CSV and verify that numbers are stored as numbers (not text strings) and dates are in a consistent format. Some spreadsheet applications auto-detect types during import.
When converting API responses, save the raw JSON first, then convert to CSV. This preserves the original data for re-conversion if you need different column layouts or filtering.