Last updated
Example: Nested Objects (Flattened)
// Input JSON:
[
{
"id": 1,
"name": "Alice",
"address": { "city": "New York", "zip": "10001", "country": "US" }
},
{
"id": 2,
"name": "Bob",
"address": { "city": "Chicago", "zip": "60601", "country": "US" }
}
]
// Output CSV (nested properties as dot-notation columns):
id,name,address.city,address.zip,address.country
1,Alice,New York,10001,US
2,Bob,Chicago,60601,US
Example: Arrays as Joined Values
// Input JSON:
[
{ "name": "Alice", "roles": ["admin", "editor"], "scores": [85, 92, 78] },
{ "name": "Bob", "roles": ["viewer"], "scores": [72, 68] }
]
// Option 1: Join array values with delimiter (|):
name,roles,scores
Alice,admin|editor,85|92|78
Bob,viewer,72|68
// Option 2: Expand to separate columns:
name,roles[0],roles[1],scores[0],scores[1],scores[2]
Alice,admin,editor,85,92,78
Bob,viewer,,72,68,
Example: Special Characters Handling
// Input JSON:
[
{ "name": "Smith, John", "bio": "Developer at \"Acme Corp\"" },
{ "name": "O'Brien, Mary", "bio": "Line 1\nLine 2" },
{ "name": "García, Carlos", "bio": "Salary: $50,000/year" }
]
// Output CSV (RFC 4180 compliant):
name,bio
"Smith, John","Developer at ""Acme Corp"""
"O'Brien, Mary","Line 1
Line 2"
"García, Carlos","Salary: $50,000/year"
// Rules applied:
// - Values with commas are wrapped in double quotes
// - Double quotes inside values are escaped as ""
// - Values with newlines are wrapped in double quotes
Example: Inconsistent Properties
// Input JSON (objects with different properties):
[
{ "id": 1, "name": "Alice", "email": "alice@example.com", "phone": "555-1234" },
{ "id": 2, "name": "Bob", "email": "bob@example.com" },
{ "id": 3, "name": "Carol", "phone": "555-5678" }
]
// Output CSV (all unique properties as columns, empty for missing):
id,name,email,phone
1,Alice,alice@example.com,555-1234
2,Bob,bob@example.com,
3,Carol,,555-5678
Example: Custom Delimiter (TSV)
// Input JSON:
[
{ "product": "Widget A", "price": 9.99, "category": "Electronics" },
{ "product": "Widget B", "price": 14.99, "category": "Electronics" }
]
// Output TSV (tab-separated):
product price category
Widget A 9.99 Electronics
Widget B 14.99 Electronics
// Other delimiter options:
// Semicolon (common in European locales):
product;price;category
Widget A;9.99;Electronics
// Pipe:
product|price|category
Widget A|9.99|Electronics
Example: Null Value Handling
// Input JSON:
[
{ "name": "Alice", "middleName": null, "age": 30 },
{ "name": "Bob", "middleName": "James", "age": 25 }
]
// Option 1: Null as empty cell (default):
name,middleName,age
Alice,,30
Bob,James,25
// Option 2: Null as literal "null":
name,middleName,age
Alice,null,30
Bob,James,25
// Option 3: Null as custom value (e.g., "N/A"):
name,middleName,age
Alice,N/A,30
Bob,James,25
Example: API Response to CSV
// Input: GitHub API response
{
"items": [
{ "name": "react", "stargazers_count": 220000, "language": "JavaScript", "forks": 45000 },
{ "name": "vue", "stargazers_count": 207000, "language": "TypeScript", "forks": 33000 },
{ "name": "angular", "stargazers_count": 93000, "language": "TypeScript", "forks": 24000 }
]
}
// Extract items array and convert:
name,stargazers_count,language,forks
react,220000,JavaScript,45000
vue,207000,TypeScript,33000
angular,93000,TypeScript,24000
// Ready to open in Excel or Google Sheets for analysis
Conversion Options Summary
- Delimiter: comma (default), semicolon, tab, pipe, or custom
- Header row: include (default), exclude, or use custom headers
- Nested objects: flatten with dot notation or keep as JSON string
- Arrays: join with delimiter, expand to columns, or keep as JSON string
- Null values: empty cell, "null" string, or custom placeholder
- Encoding: UTF-8 (default) or UTF-8 with BOM (for Excel compatibility)
Paste your JSON array to convert it to CSV. Download the result or copy it directly into Excel or Google Sheets.
Example: Simple Array of Objects
// Input JSON:
[
{ "id": 1, "name": "Alice", "email": "alice@example.com", "age": 30 },
{ "id": 2, "name": "Bob", "email": "bob@example.com", "age": 25 },
{ "id": 3, "name": "Carol", "email": "carol@example.com", "age": 35 }
]
// Output CSV:
id,name,email,age
1,Alice,alice@example.com,30
2,Bob,bob@example.com,25
3,Carol,carol@example.com,35