About This Tool
Exporting JSON data as CSV is essential when you need to share structured data with spreadsheet users, import records into legacy systems, or generate reports that non-technical stakeholders can open in Excel or Google Sheets. While JSON is the standard for APIs and modern applications, CSV remains the universal format that every tool understands. The challenge comes when your JSON contains nested objects, arrays, or inconsistent structures. This converter handles all of that by flattening nested properties into dot-notation keys (e.g., "address.city"), joining array values with semicolons, and normalizing rows so every record has the same columns. Paste your JSON, select a delimiter, and download a clean CSV file ready for any spreadsheet application. The converter supports comma, tab, semicolon, and pipe delimiters to match whatever format your target system expects.
How JSON to CSV Conversion Works
The converter takes a JSON array of objects and maps each object to a CSV row. Object keys become column headers, and values become cell data.
For nested structures, the tool uses dot notation to flatten hierarchies:
{"address": {"city": "NYC"}}becomes a columnaddress.citywith valueNYC- Nested arrays like
{"tags": ["a", "b"]}are joined with semicolons:a; b - Deeply nested objects are recursively flattened:
user.profile.name
The tool collects all unique keys across every object to build the complete set of columns. If an object is missing a key that other objects have, the cell is left empty.
Handling Nested and Complex JSON
Real-world JSON data is rarely flat. API responses typically include nested objects, arrays of primitives, and arrays of objects. Here is how each case is handled:
- Nested objects: Flattened with dot notation.
{"user": {"name": "John"}}becomes columnuser.name - Primitive arrays: Joined into a single cell with semicolons.
{"roles": ["admin", "editor"]}becomesadmin; editor - Object arrays: Serialized as JSON strings within the cell, since CSV cannot represent nested structures
- Null values: Converted to empty strings for clean CSV output
- Boolean values: Converted to
trueorfalsetext
This approach preserves all data while keeping the CSV as flat and readable as possible.
Choosing the Right Delimiter
The delimiter you select depends on your target application and data content:
- Comma: Standard CSV format. Works with Excel, Google Sheets, and most import tools. Avoid if your data contains commas (the tool auto-escapes them with quotes, but some parsers struggle).
- Tab: Best when data contains commas or semicolons. TSV files open cleanly in most spreadsheet apps and avoid quoting issues.
- Semicolon: Standard in European countries where commas are decimal separators. Required for many European ERP and accounting systems.
- Pipe: Common in EDI (Electronic Data Interchange) systems, mainframe exports, and certain database tools.
Best Practices for Data Export
Follow these guidelines for trouble-free CSV exports:
- Validate JSON first: Run your JSON through a validator before converting. A missing comma or bracket will cause the entire conversion to fail.
- Check column count: After conversion, verify the column count matches your expected schema. Extra columns usually mean unexpected nested keys.
- Handle encoding: If your data contains non-ASCII characters (accents, CJK characters, emoji), the downloaded CSV uses UTF-8 encoding. Some older applications may need the file re-saved with a different encoding.
- Test with a subset: For large datasets, convert a small sample first to verify the structure before processing thousands of records.
Frequently Asked Questions
Can I convert a single JSON object (not an array) to CSV?
How are nested JSON objects handled in the CSV output?
{"user": {"name": "John", "address": {"city": "NYC"}}} produces columns user.name and user.address.city. This keeps the CSV flat while preserving the full data hierarchy in the column names.What happens to arrays inside JSON objects?
{"tags": ["web", "dev"]} becomes the cell value web; dev. Arrays of objects are serialized as JSON strings since CSV cannot natively represent nested structures.