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)

⚡ Instant resultsNo signupRuns in your browser
Try examples:

Convert this JSON to CSV.

[
{
"name": "Alice",
"age": 30,
"city": "New York"
},
{
"name": "Bob",
"age": 25,
"city": "London"
}
]
Output
1name,age,city
2Alice,30,New York
3Bob,25,London

Love 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.

Read integration guide

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

Read more on the blog

Advanced usage (optional)

JSON to CSV

v1.0.0
Convert
arrayreversible

Description

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

FieldTypeDefaultDescription
Delimiterenum,Field separator: ,, ;, \t (tab), or `\` (pipe)
Include HeadersbooleantrueAdd column names as the first row
Columnsjson[]JSON array of field names to include (empty = all fields)
Flatten Nested ObjectsbooleanfalseFlatten nested objects using dot notation keys (e.g., user.name)
Array Delimiterstring`\`Character to join array values within a single cell
Column Mappingcolumn-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

NameTypeDefaultDescription
Delimiterenum,Character used to separate fields in the CSV output , ; \t |
Include HeadersbooleantrueAdd column names as the first row
Flatten Nested ObjectsbooleanfalseFlatten nested objects using dot notation keys (e.g. user.name)
Array Delimiterstring|Character to join array values within a single cell
Columnsjson[]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

AI Prompt
Convert this JSON to CSV.
[
{
"name": "Alice",
"age": 30,
"city": "New York"
},
{
"name": "Bob",
"age": 25,
"city": "London"
}
]
Output
1name,age,city
2Alice,30,New York
3Bob,25,London
Config
Delimiter
,
Include Headers
ON
Flatten Nested Objects
OFF
Array Delimiter
|
Columns
1[]

API Usage

POST /api/v1/utilities/convert.json-to-csv
Example:
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":"|"}}'
Response
1name,age,city
2Alice,30,New York
3Bob,25,London