JSON to CSV flattener
Export nested records into spreadsheet columns.
Your inputs
Your results
Ready when you areYour results will appear here.
How it works
Turn an API response or a collection of JSON records into a rectangular spreadsheet. Nested objects become dot-separated column names, while every field seen anywhere in the records contributes to the header. The comma export uses double-quoted fields, doubled internal quotes, and CRLF record endings as described in RFC 4180 (https://www.rfc-editor.org/rfc/rfc4180). Parsing uses the browser’s JSON.parse API (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse). Conversion happens locally in your browser.
A few things to know
Accepts one object or a top-level array of objects, not JSON Lines. Duplicate JSON keys follow JSON.parse behavior: the last value wins. Property paths that produce the same dot-separated name are rejected. No array explosion or automatic type inference. JavaScript floating-point parsing can round decimals; unsafe integer values and non-finite numbers are rejected, but exact decimal precision is not guaranteed. Quote identifiers and exact amounts in the JSON to preserve their text. Limits: 2 MB input, 10,000 records, 500 columns, 500,000 cells, 32 nesting levels, 200,000 values, and 10 MB export. Formula protection reduces common spreadsheet injection risks but is not a universal guarantee for every spreadsheet import setting.
When to use this tool
JSON records often contain nested objects that do not fit directly into spreadsheet columns. This converter flattens object paths into dot-separated headers and creates one row per record. It builds the header from every field encountered, so later records can add columns without losing earlier values. Choose how arrays appear, select a separator and review spreadsheet formula protection before downloading. Conversion is local and does not fetch an API or infer a data schema.
- Turn a small API-response record collection into a spreadsheet export.
- Flatten nested contact information while retaining missing-field distinctions.
- Convert JSON objects to comma, semicolon or tab-separated output.
How to use json to csv flattener
Paste supported JSON records
Enter one JSON object or a top-level array of objects. Use valid double-quoted JSON without comments or trailing commas. Put large identifiers and exact amounts in strings when their original text must be preserved.
Choose array and export options
Keep arrays as JSON cells or join primitive array items with |. Choose comma, semicolon or tab output. Decide whether apostrophe-prefixing formula-like headings and values is appropriate for your destination.
Review the rectangular result
Inspect the ordered headers, record count and protection count. The preview shows up to 500 rows; download the file for all supported records. Import with the matching delimiter and verify identifier and numeric handling in your spreadsheet.
Flatten two contact records
Inputs
Use the built-in Maya and Alex JSON records, keep arrays as JSON, choose comma output and leave spreadsheet protection on.
Result
The converter produces two records and seven columns: name, contact.city, contact.email, tags, note, balance and company. No cells are prefixed. Alex’s missing contact.email is blank; explicit balance null becomes the text null.
What it means
Nested contact fields become columns, while tags remain a JSON array inside one cell. The later company field adds a shared column, leaving Maya’s cell blank instead of dropping the field.
Common mistakes to avoid
Sending unsafe numeric identifiers
JavaScript parsing cannot preserve every large number exactly. Unsafe integers are rejected, and exact decimal precision is not guaranteed. Quote IDs and exact amount text in the source JSON.
Joining arrays that need round-trip fidelity
A pipe-joined presentation can become ambiguous when values contain pipes, null strings or empty items. Keep arrays as JSON when preserving structure matters.
Ignoring formula-protection changes
Protection adds an apostrophe to suspicious cells, including negative values and headings. The preview shows originals; downloadable CSV text contains the changed values. Check the destination’s import behavior.
Frequently asked questions
Definitions, edge cases, and practical next steps for this tool. Search all tool FAQs ↗
Which JSON shapes are accepted?
Use a single object or a top-level array whose records are all objects. Primitive arrays, null records and JSON Lines are not accepted. An API envelope containing an array is not automatically expanded into rows; extract the intended record array before pasting it.
How do nested objects become column names?
Each nested object path is joined with dots, so contact.city becomes a column. The header is an ordered union across all records, following first appearance. Empty objects remain the cell text {}, while nonempty objects continue into their nested properties.
What happens to missing fields and null?
A field absent from a record produces a blank cell in its shared column. Explicit JSON null produces the text null. This distinguishes absence from a stated null value, although your spreadsheet may apply additional type or text transformations during import.
Can arrays become multiple rows?
No. Arrays remain one cell, either serialized as JSON or joined with | when all their items are primitive values. There is no array explosion or relationship-table generation. Nested objects or arrays inside an array require the JSON-cell mode rather than primitive joining.
Why do keys containing dots sometimes cause an error?
A literal key a.b and a nested path a then b would both flatten into the same header. The converter rejects that collision rather than overwriting data. Rename the literal key or restructure the records so each flattened path has a distinct name.
Will long numeric IDs keep every digit?
Not if they are supplied as unsafe JSON numbers. The converter rejects detected unsafe integers, but JSON parsing still uses floating-point numbers and can round decimals. Supply identifiers and exact numeric text in quoted JSON strings, then import those columns as text where required.
Why does protection prefix a negative number?
The protection rule treats leading formula-like characters, including minus, as suspicious text. It is a precaution rather than full spreadsheet validation and can affect legitimate numeric values. Leave it on for review, or disable it only when preserving trusted original cell text is appropriate.
How much data can I convert?
Limits include 2 MB input, 10,000 records, 500 columns, 500,000 cells, 32 nesting levels and a 10 MB export. The table shows at most 500 rows. Reduce the batch or selected fields when a limit is reached rather than assuming the preview is the full file.
Explore the topic in the blog
Sources and method
Use the references below to check definitions and platform guidance. The model’s scope and limits are explained above. Read our editorial standards.