← Back to blog
Convert

JSON to CSV Converter (Handles Nested Data) - Free Online Tool

Convert JSON to CSV online with nested data support, custom column mappings, clean exports, and examples for Excel, Sheets, and BI tools.

2026-04-0112 min readUpdated May 1, 2026

Most spreadsheet and BI tools do not understand raw JSON the way APIs do.

The same export might include:

  • nested customer fields
  • arrays inside order records
  • optional keys that appear in only some objects
  • values that need clean column names

This breaks Excel, Google Sheets, analytics, and reporting workflows that expect rows and columns. In this guide, you will learn how to convert JSON to CSV with clean headers, nested field mappings, and repeatable export rules. If the data is nested first, start by learning how to flatten nested JSON before converting to CSV.

Used in reporting pipelines, API exports, analytics workflows, and spreadsheet operations, JSON to CSV conversion keeps structured data usable across systems.

Convert JSON to CSV instantly - no code required.
Paste your JSON below and export clean CSV in seconds.

Most JSON exports break CSV tools because:

  • nested objects do not map cleanly to columns
  • arrays create inconsistent rows
  • missing fields break headers

Use this JSON to CSV converter to fix that instantly.

Convert JSON to CSV (live tool)

[
{
"id": "ord_1001",
"customer": {
"name": "Maya Chen",
"email": "maya@example.com"
},
"total": 89.5,
"status": "paid"
},
{
"id": "ord_1002",
"customer": {
"name": "Jon Smith",
"email": "jon@example.com"
},
"total": 42,
"status": "pending"
}
]
Output
1id,customer_name,customer_email,total,status
2ord_1001,Maya Chen,maya@example.com,89.5,paid
3ord_1002,Jon Smith,jon@example.com,42,pending

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

Result: CSV export

After converting JSON to CSV, your data becomes a structured table:

  • each JSON object → one row
  • each field → one column
  • consistent format across all records
id,customer_name,customer_email,total,status
ord_1001,Maya Chen,maya@example.com,89.5,paid
ord_1002,Jon Smith,jon@example.com,42,pending

What happened?

The converter automatically:

  • flattens nested objects: customer.name becomes customer_name
  • converts objects into rows: each record becomes one CSV line
  • normalizes arrays: ensures consistent row structure
  • fills missing fields: prevents broken CSV headers

This makes your data ready for:

  • Excel
  • Google Sheets
  • BI tools (Tableau, Power BI)

Try it with your own JSON above →

What is JSON to CSV conversion?

JSON to CSV conversion is the process of transforming JSON data into a table format, where each object becomes a row and each field becomes a column in the CSV file.

It is one part of JSON export: first clean or flatten the JSON, then map fields to CSV columns, and finally validate or download the final CSV output.

JSON to CSV converter (step-by-step)

  1. Choose the JSON array that should become rows
  2. Map fields or nested paths to CSV columns
  3. Export, download, or reuse the CSV output

This ensures spreadsheet-friendly data for Excel, Google Sheets, BI tools, and reporting.

Why JSON is hard to export as CSV

  • JSON can contain nested objects and arrays
  • CSV needs rows and columns
  • Missing fields can create inconsistent columns
  • Nested paths need readable column names

To make JSON usable in spreadsheets, map JSON fields into a clean table before reporting, sharing, or importing the data elsewhere.

Try it with your data

Paste your JSON and convert it instantly:

Convert JSON to CSV in 10 seconds ->

No setup. No code. Reusable workflow.

How to export JSON to CSV

To convert JSON to CSV:

  1. Start with a JSON array of objects
  2. Choose which fields become CSV columns
  3. Flatten or map nested fields when needed
  4. Export the result as CSV

The goal is not just text with commas. The goal is a stable table: each object becomes one row, useful fields become columns, and nested values get readable headers.

How to flatten JSON to CSV

Converting nested JSON to CSV means mapping nested paths such as customer.email into CSV headers such as customer_email.

For API exports, this usually means flattening or mapping nested fields first, deciding how arrays should be represented, and choosing column names that work in spreadsheets. A JSON to CSV pipeline is the most reliable way to standardize exports across systems because the same mapping rules can run every time new data arrives.

The JSON to CSV workflow

This workflow uses 3 steps:

  1. Read each JSON object as one row
  2. Map fields or nested paths into CSV columns
  3. Generate CSV text with headers and values

The combination handles row selection, column naming, and export formatting. Each step has a single job, which keeps the export workflow easy to audit and rerun.

Open JSON to CSV ->

JSON to CSV online export options

OptionExampleNotes
Flat exportid,name,totalBest for simple arrays of objects
Nested mappingscustomer.email -> customer_emailBest for API responses
Flatten firstnested JSON -> flat JSONUseful before CSV export
Custom columnsorder_totalBest for reports and spreadsheets

For more background on the CSV format, see RFC 4180.

When to use a JSON to CSV converter

Use a JSON to CSV converter when you need table-friendly data for spreadsheets, analytics, reporting, or team handoff:

  • Export API data to Excel
  • Prepare analytics datasets
  • Import into BI tools
  • Share structured data with non-developers

JSON to CSV tool examples

Real-world CSV exports usually start with where the file is going next:

  • Excel reports: map nested order fields into readable columns.
  • Google Sheets imports: keep headers predictable and avoid nested blobs.
  • BI tools: export clean columns for grouping, filtering, and charts.
  • API exports: flatten nested response data before sharing it with non-developer teams.
  • Ecommerce orders: convert customer.email, total, and status into reporting columns.

These cases all use the same pattern: define the rows, choose columns, map nested fields, then export CSV text for downstream tools.

Example: Nested JSON export

Here is a simple nested JSON export example. The JSON contains order rows with nested customer fields.

[
  {
    "id": "ord_1001",
    "customer": {
      "name": "Maya Chen",
      "email": "maya@example.com"
    },
    "total": 89.5,
    "status": "paid"
  },
  {
    "id": "ord_1002",
    "customer": {
      "name": "Jon Smith",
      "email": "jon@example.com"
    },
    "total": 42,
    "status": "pending"
  }
]

See how this transformation works step by step in the interactive pipeline below.

Use this tool to convert JSON into CSV for spreadsheets and BI tools:

Step-by-step: convert nested JSON to CSV

To convert nested JSON to CSV, map each nested path to a flat CSV column. A tabular export utility turns a JSON array of objects into CSV text and lets you keep all fields, flatten nested fields, choose specific columns, or use custom mappings.

For the order example above, use mappings like this:

{
  "delimiter": ",",
  "includeHeaders": true,
  "arrayDelimiter": "|",
  "mappings": [
    { "columnName": "id", "expression": "{{id}}" },
    { "columnName": "customer_name", "expression": "{{customer.name}}" },
    { "columnName": "customer_email", "expression": "{{customer.email}}" },
    { "columnName": "total", "expression": "{{total}}" },
    { "columnName": "status", "expression": "{{status}}" }
  ]
}

For this example, the workflow produces a short set of useful steps:

  1. Read each object in the JSON array as one row.
  2. Map nested customer fields into top-level CSV columns.
  3. Export the result as CSV.

Result

You end up with:

  • id
  • customer_name
  • customer_email
  • total
  • status

For more complex workflows (clean -> transform -> export), you can chain multiple steps into a reusable JSON pipeline.

How to choose CSV export rules

Choose export rules based on the spreadsheet or downstream system:

  • If the input is nested, flatten or map fields before export.
  • If arrays represent repeated records, expand them before CSV conversion.
  • If arrays are metadata, serialize them with a clear delimiter.
  • If the report needs stable headers, use custom column mappings.
  • If downstream analysis depends on numbers, clean and normalize values before export.

The most important rule is consistency. Do not let one export use customer.email while another uses customer_email unless that difference has a real business meaning.

JSON to CSV checklist

Before reusing CSV downstream, confirm that you have:

  • Selected the JSON array that should become rows
  • Chosen stable CSV column names
  • Mapped nested fields into readable headers
  • Decided how arrays should be represented
  • Cleaned or normalized values before export
  • Validated the CSV output in the target tool

Common mistakes when converting JSON to CSV

The most common mistakes happen when row, column, and array rules are decided too late:

  • Exporting nested objects as unreadable [object Object] or JSON blobs.
  • Skipping optional fields that appear only in later records.
  • Forgetting to quote values that contain commas, line breaks, or delimiters.
  • Flattening arrays without deciding whether each item should become a row or a cell value.

Avoid these by defining rows first, choosing columns second, and then applying the same mapping rules to every export.

What happens if you don't prepare JSON before CSV?

Unprepared JSON creates spreadsheet and reporting problems:

  • Nested values disappear or become unreadable blobs
  • Analytics tools split similar fields across inconsistent columns
  • CSV exports miss optional keys from later records
  • Spreadsheet users need manual cleanup before every import

Preparing the JSON first prevents these problems by making row and column behavior explicit before export.

Flatten before CSV export

Flattening nested JSON is often the bridge between raw API structure and usable CSV output. Once nested fields are flat and predictable, CSV exporters, spreadsheets, and BI tools can handle the data without custom path logic.

If your pipeline cleans, flattens, and then exports in that order, each stage has a single job and failures are easier to diagnose. Start by cleaning JSON before CSV export, flatten nested JSON, then convert JSON to CSV here.

JSON to CSV: code vs workflow

Code is useful when the JSON is flat and stable:

const rows = [{ id: "ord_1001", total: 89.5 }];
const headers = ["id", "total"];
const csv = [
  headers.join(","),
  ...rows.map((row) => headers.map((key) => row[key]).join(",")),
].join("\n");

A workflow is better when export rules need to be reused, reviewed, or adjusted:

  • Non-developers can inspect column mappings
  • Each export step can be previewed before download
  • The same workflow can run against future API pulls
  • Cleanup, flattening, and CSV export can stay separate

For repeated spreadsheet exports, a reusable workflow is easier to maintain than one-off scripts scattered across reports, dashboards, and imports.

JSON to CSV converter vs writing code

MethodSpeedComplexityBest for
Python / JSSlowHighEngineers
Online converterFastLowOne-time
Forge JSON pipelineFast + repeatableLowTeams

Writing a JSON to CSV Python script or JSON to CSV JavaScript helper can work for stable, flat files. A JSON to CSV online tool is faster when you need to inspect the result, flatten nested data, and hand the workflow to people who do not want to maintain code.

Why not just export JSON to CSV manually?

Manual export works for one file, but it breaks down when JSON changes or the export repeats.

ApproachWorks forBreaks when
Manual spreadsheet cleanupOne-off files and quick inspectionFields change or exports repeat
Custom scriptFlat, stable JSONTeams need to adjust mappings or nested paths
JSON pipelineRepeated exports, nested JSON, shared reportsRow and column rules are not defined

Manual CSV export also hides transformation rules in spreadsheets, scripts, or ad hoc edits. A pipeline approach is repeatable, auditable, and scalable because column mappings stay visible.

JSON workflow pipeline

Use JSON to CSV conversion as the export step in an end-to-end JSON workflow:

  1. Clean API responses to remove noise, whitespace, null-heavy fields, and values you do not need.
  2. Normalize inconsistent API fields so types, empty values, booleans, and enums follow one rule.
  3. Flatten nested JSON so object paths become stable fields.
  4. Convert JSON to CSV with this guide so rows and columns are ready for Excel, Sheets, BI tools, or reporting.
  5. Merge JSON configs or datasets when CSV rows need fields from multiple sources.
  6. Compare JSON changes before future exports when you need to catch shape drift over time.

Limitations

JSON to CSV conversion can break down when the input structure does not match a simple table.

Common limitations include:

  • deeply nested arrays may require flattening
  • inconsistent keys can lead to missing columns
  • large files may require streaming or chunking
  • mixed value types can make spreadsheet columns harder to analyze

For very large JSON files, consider streaming or chunked processing before converting to CSV.

For these cases, clean the JSON first, flatten nested fields, or split the export into smaller steps before generating CSV.

If JSON exports change often, a reusable CSV workflow is not optional.

Without it, columns drift, nested values disappear, and spreadsheet imports need manual cleanup.

Start with a reusable JSON to CSV workflow and apply it to every recurring export.

Build reusable JSON to CSV workflows ->

Use the example panel below to open this sample input and run the JSON to CSV workflow directly in the editor.

FAQ

Can I convert JSON to CSV online?

Yes. Paste JSON, configure the JSON to CSV utility, and export CSV text from the browser.

What JSON shape works best for CSV export?

A JSON array of objects is the cleanest input because each object can become one CSV row.

Can nested JSON fields become CSV columns?

Yes. Use flattening for dot-notation columns, or custom mappings when you want column names like customer_name instead of customer.name.

How do I flatten JSON before converting to CSV?

You can either enable flattening or use custom mappings like {{customer.name}} to extract nested fields into columns.

Can I choose specific columns for CSV export?

Yes. Use mappings to define exactly which fields become columns and how they are named.

Support material

Practical example and product context

Use these examples to understand the transformation and apply the same workflow in your own JSON tasks.

Before & After

Example Transformation

See how this workflow reshapes the sample material into clean output.

Input / Output
Input
[
{
"id": "ord_1001",
"customer": {
"name": "Maya Chen",
"email": "maya@example.com"
},
"total": 89.5,
"status": "paid"
},
{
"id": "ord_1002",
"customer": {
"name": "Jon Smith",
"email": "jon@example.com"
},
"total": 42,
"status": "pending"
}
]
Output
id,customer_name,customer_email,total,status
ord_1001,Maya Chen,maya@example.com,89.5,paid
ord_1002,Jon Smith,jon@example.com,42,pending
Config
1{
2 "delimiter": ",",
3 "includeHeaders": true,
4 "columns": [],
5 "flattenNested": false,
6 "arrayDelimiter": "|",
7 "mappings": [
8 {
9 "columnName": "id",
10 "expression": "{{id}}"
11 },
12 {
13 "columnName": "customer_name",
14 "expression": "{{customer.name}}"
15 },
16 {
17 "columnName": "customer_email",
18 "expression": "{{customer.email}}"
19 },
20 {
21 "columnName": "total",
22 "expression": "{{total}}"
23 },
24 {
25 "columnName": "status",
26 "expression": "{{status}}"
27 }
28 ]
29}
Why this output is ready to use
  • Each JSON object becomes one CSV row.
  • Custom mappings rename nested fields into spreadsheet-friendly column names.
  • The output is CSV text that can be opened in Excel, Google Sheets, Airtable, or BI tools.
Built with Convert utility
Open the sample input and generated pipeline in the editor.
View Utility

Related Articles

Continue with another practical guide in the same workflow area.