Nested JSON to CSV Converter
Convert nested JSON orders, customers, and line-item fields into readable CSV columns without writing a flattening script first.
Paste your JSON → Get CSV instantly (no signup)
→ Convert this JSON to CSV.
1name,age,city
2Alice,30,New York
3Bob,25,LondonLove the result?
Use this exact pipeline in your app, backend, or LLM workflow.
No setup needed. Works with curl, Node, Python.
Uses example data. For edited input, copy from the playground.
Works with:
- Nested order records
- Customer and billing objects
- Spreadsheet exports
- Flattened CSV columns
Example: input → output
Nested JSON to CSV converter
Convert nested JSON to CSV when each record contains objects inside objects, such as orders with customer.name, shipping.city, and payment.total. This page uses the same engine as the JSON to CSV converter, but the intent is different: the goal is to turn nested paths into readable spreadsheet columns instead of exporting only flat records.
Input
[
{
"orderId": "ORD-1001",
"customer": { "name": "Alice", "city": "Austin" },
"total": 42.5
},
{
"orderId": "ORD-1002",
"customer": { "name": "Ben", "city": "Denver" },
"total": 18
}
]
Output
orderId,customer.name,customer.city,total
ORD-1001,Alice,Austin,42.5
ORD-1002,Ben,Denver,18
How to convert nested JSON to CSV
Paste an array of nested records into the tool, keep flattening enabled, and run the conversion. Object paths become column names such as customer.name and shipping.city. Copy the CSV output into Excel, Google Sheets, a BI import, or a reporting workflow.
If the nested structure is very deep, preview the shape first with Flatten JSON. If different records use different keys, normalize the records before exporting so the CSV columns stay predictable.
When to use this tool
Use this tool when the search intent is specifically nested JSON, not generic conversion:
- Export order records with nested customer or shipping fields.
- Turn analytics events into CSV columns for spreadsheet review.
- Prepare API records for reporting after flattening nested paths.
- Share readable CSV with teammates who do not want nested JSON.
Common mistakes
Nested arrays can create awkward CSV columns when each record has a different number of items. For line items, decide whether to keep arrays joined in one cell, expand indexed paths, or split items into separate rows before export. Also keep the original nested JSON as the source of truth when an API still expects the nested shape.
Related tools
- JSON to CSV - generic JSON array to CSV conversion.
- Flatten JSON for CSV - inspect nested path columns before export.
- API JSON to CSV - export response wrappers and endpoint records.
- Normalize JSON - align record fields before CSV conversion.
Related tools
- CSV to JSONParse CSV text into a JSON array of row objects for further cleanup or reshaping
- Table JSON to RecordsConvert table-like JSON exports with header and row arrays into normal JSON records
- Format ValuesReformat individual values with case changes, trimming, coercion, and slugification
- Map ValuesRemap existing values through a lookup table such as enums, codes, or category names
- Compute FieldCreate derived values or fields from formulas, expressions, and simple conditionals
Read more on the blog
Advanced usage (optional)
JSON to CSV
v1.0.0Description
JSON to CSV
Convert a JSON array of objects into CSV text. Supports field selection, nested object flattening, custom column mappings with expressions, and configurable delimiters.
How It Works
The utility takes an array of objects and produces CSV text. Each object becomes a row, and object keys become column headers.
Basic Conversion
All fields from the first object determine the columns. Values are quoted when they contain the delimiter character.
Column Selection
Specify an array of field names to include only certain columns in a specific order.
Nested Object Flattening
When enabled, nested objects are flattened using dot notation. Arrays within cells are joined with a configurable delimiter.
Custom Column Mapping
Define custom columns with expressions using {{fieldName}} syntax. Allows combining fields, renaming columns, and applying transformations.
Configuration
| Field | Type | Default | Description | |
|---|---|---|---|---|
| Delimiter | enum | , | Field separator: ,, ;, \t (tab), or `\ | ` (pipe) |
| Include Headers | boolean | true | Add column names as the first row | |
| Columns | json | [] | JSON array of field names to include (empty = all fields) | |
| Flatten Nested Objects | boolean | false | Flatten nested objects using dot notation keys (e.g., user.name) | |
| Array Delimiter | string | `\ | ` | Character to join array values within a single cell |
| Column Mapping | column-mapping | [] | Define custom column mappings with expressions. When configured, overrides Columns and Flatten settings. |
Column Mapping Expressions
Custom mappings let you define exactly what each column contains:
Column: "Full Name" Expression: "{{firstName}} {{lastName}}"
Column: "Age" Expression: "{{age}}"
Column: "Location" Expression: "{{city}}"Use Cases
Data Export
- Spreadsheet export: Convert JSON data to CSV for Excel or Google Sheets
- Database import: Prepare CSV files for database bulk import
- Report generation: Export filtered data as CSV reports
Data Transformation
- Column selection: Export only relevant fields from large objects
- Field combination: Merge first/last name into a single "Full Name" column
- Nested flattening: Convert hierarchical data to flat CSV rows
Integration
- Legacy systems: Convert JSON API data to CSV for legacy system import
- Email tools: Prepare CSV contact lists for email marketing tools
- Analytics platforms: Export data in CSV format for analytics tools
Configuration
| Name | Type | Default | Description |
|---|---|---|---|
| Delimiter | enum | , | Character used to separate fields in the CSV output , ; \t | |
| Include Headers | boolean | true | Add column names as the first row |
| Flatten Nested Objects | boolean | false | Flatten nested objects using dot notation keys (e.g. user.name) |
| Array Delimiter | string | | | Character to join array values within a single cell |
| Columns | json | [] | JSON array of field names to include (empty = all fields) |
| Column Mapping (Advanced) | column-mapping | [] | Define custom column mappings with expressions. When configured, overrides Columns and Flatten settings. |
Examples
Convert this JSON to CSV.1name,age,city
2Alice,30,New York
3Bob,25,London1[]API Usage
curl -X POST https://your-domain.com/api/v1/utilities/convert.json-to-csv \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"inputs":{"primary":[{"name":"Alice","age":30,"city":"New York"},{"name":"Bob","age":25,"city":"London"}]},"config":{"delimiter":",","includeHeaders":true,"columns":[],"flattenNested":false,"arrayDelimiter":"|"}}'1name,age,city
2Alice,30,New York
3Bob,25,London