JSON to CSV Converter | Flatten and Export JSON Locally

ConverterRuns in Your Browser (No Uploads)

Convert a JSON object or an array of records into review-ready CSV. Keep columns from every row, flatten nested fields or preserve them as JSON text, choose a delimiter, and protect spreadsheet formula cells without uploading the source.

What to do next

Continue with a related workflow or open the next tool that usually follows this task.

How to Use This Tool

Paste one JSON object or a non-empty array of objects.

Choose comma, tab, semicolon, or pipe as the one-character delimiter.

Choose Flatten for dotted nested columns or JSON text to keep nested values in one cell.

Keep headers and spreadsheet formula protection enabled unless your destination requires otherwise.

Review the row, column, and warning counts, then inspect empty cells and quoted values.

Copy the CSV or download a UTF-8 file; keep the BOM option enabled for spreadsheet apps that need it.

When to Use This Tool

API response review

Turn an API records array into rows that product, support, or QA can filter in Excel or Google Sheets.

Operations data handoff

Create a CSV handoff while retaining optional fields that appear only in later JSON records.

QA fixture comparison

Flatten nested fixture fields into dotted columns for test-case comparison without uploading internal data.

Safer spreadsheet import

Export identifiers and user-entered text with warnings for unsafe integers and protection against spreadsheet formulas.

Common Mistakes

Converting the API wrapper instead of its records

A response such as {data:{items:[...]}} is one wrapper record, not the records array. Extract data.items first when each item should become its own CSV row.

Leaving long IDs as JSON numbers

JSON numbers above JavaScript's safe integer range can lose digits before export. The converter stops and asks you to quote large IDs so the CSV preserves them exactly.

Disabling formula protection without reviewing cells

Text beginning with =, +, -, or @ may execute as a spreadsheet formula. Keep formula protection enabled unless the destination explicitly requires raw formulas.

Examples

Keep fields that appear in later records

Columns are collected in first-seen order across every record, so a field that appears only in a later row is retained and earlier missing values become empty cells.

Input
[{"id":1,"name":"Ada"},{"id":2,"active":true}]
Output
id,name,active
1,Ada,
2,,true

Flatten nested records without losing arrays

Flatten mode creates dotted headers for nested objects and keeps arrays as quoted JSON text, producing predictable spreadsheet columns without [object Object] values.

Input
[{"id":1,"profile":{"name":"Ada"},"tags":["admin","editor"]}]
Output
id,profile.name,tags
1,Ada,"[""admin"",""editor""]"

How safe JSON-to-CSV conversion works

The input is parsed as strict JSON. Comments, trailing commas, multiple roots, invalid escapes, duplicate keys, and exact error positions are handled explicitly instead of relying on browser-specific JSON.parse messages.

Every row must be an object. Headers are collected across all rows in first-seen order, missing fields become empty cells, null becomes an empty cell, and literal dots or backslashes in keys are escaped when nested paths are flattened.

PapaParse serializes the prepared table with CRLF row endings and quotes cells containing delimiters, quotes, or line breaks. Nested arrays and JSON-text mode values are serialized with JSON.stringify before CSV quoting.

Formula protection is enabled by default for risky string cells and headers. Input is limited to 5 MB, with separate row, column, nesting-depth, and output-size guards; downloaded files can include a UTF-8 BOM without adding it to copied preview text.

Frequently Asked Questions

Which JSON shapes are accepted?

Use one object for a single CSV row or a non-empty array of objects for multiple rows. Scalar roots, arrays of strings or numbers, mixed arrays, and empty arrays are rejected because they do not define a reliable table.

How are nested objects and arrays handled?

Flatten mode turns nested object paths into dotted headers and stores arrays as JSON text. JSON text mode keeps each top-level object or array value in one quoted CSV cell.

Is JSON uploaded to a conversion server?

No. Parsing and CSV generation run in your browser. The tool accepts up to 5 MB of JSON and does not need a conversion-server upload during normal use.

How does the converter prevent spreadsheet data loss or formula injection?

Formula protection prefixes risky string cells with an apostrophe. Large integer literals outside the safe JavaScript range are blocked with a line and column; wrap identifiers that large in JSON double quotes before converting.

How This Tool Was Verified

Maintained and tested by Reviewed

Method: To check “API records exported as CSV rows”, we used JSON to CSV Converter with the guide's exact source data and applied “Convert the array into CSV rows”. The output had to match the documented result; evidence for “Pasting the full API wrapper” and “Expecting nested objects to flatten perfectly” was reviewed before recording the check.

Expected result: The export produced id,email,plan rows in stable order and preserved both API records without serializing the surrounding response wrapper. Boundary review confirmed that a missing key becomes an empty cell, while long IDs and formula-like user text stay visible for spreadsheet-safety review.

Open the tested workflow

Related workflow guides

Use these focused guides when you need a practical workflow before opening the tool.

Related Tools

Continue with another maintained workflow

Browse All Tools