JSON
Reverse direction: CSV to JSON.
CSV
a,b 1,2 3,4
JSON to CSV Converter - Arrays of Objects to Spreadsheet Rows
Default [{"a":1,"b":2},{"a":3,"b":4}] becomes header a,b and rows 1,2 and 3,4. Nested keys can flatten with dots. Conversion stays in the browser.
What Is a JSON to CSV Converter?
A JSON to CSV converter maps a table-shaped JSON document onto comma-separated rows. CSV is a table. JSON is a tree. The reliable mapping is an array of objects to a header row plus data rows. This page uses Papa Parse unparse. It is not a general tree flattener for arbitrary graphs, and it is not the JSON formatter.
The default document is [{"a":1,"b":2},{"a":3,"b":4}]. Papa emits:
a,b 1,2 3,4
That is the worked check. A single object is wrapped as one row so you are not stranded, but a nested config file is still a tree. Flatten mode turns {"user":{"id":1}} into a user.id column. Stringify mode puts the nested object in one cell as JSON text. Arrays as cell values stringify. Missing keys across the union of columns become empty cells.
This is the opposite direction of the existing CSV to JSON converter. It will not silently rebuild comments, original quoting quirks, or a column order that never existed as object key order in JSON. Huge tables belong in a local script or the JSON file processor, not a textarea.
Papa decides when a field needs quotes: commas, newlines, and embedded quotes inside a cell are escaped according to CSV rules. That is why a nested stringify of {"id":1} lands in one field instead of splitting on the inner comma. Numbers and booleans usually stay unquoted. Spreadsheets may still coerce an id that looks like a date; that is Excel, not this converter. If you need every column as text, wrap values as strings in the JSON before you unparse, or set the column type after import.
Headers are the union of keys after flatten or stringify. A property that appears only on the second row still becomes a column. Missing cells on other rows stay empty. That sparse-table behavior is the usual CSV import contract. You do not have to pad every object with null first unless you want a visible null token - this page treats JSON null as an empty field on purpose.
How to Convert JSON to CSV - Step by Step
Conversion is live as you type, once the document parses:
- Paste JSON - The default is
[{"a":1,"b":2},{"a":3,"b":4}]. An array of objects is the reliable mapping. A single object is wrapped as one row. - Choose nested handling - Flatten dotted keys such as
user.id, or stringify nested objects into a single cell. Arrays as cell values stringify. - Read the CSV in the right panel - Headers are the union of keys. Missing cells stay empty. Papa Parse unparse emits the default as a,b then 1,2 and 3,4.
- Copy the CSV - Use Copy to place the result on the clipboard for a spreadsheet or database import. Clear restores the default two-row array. Nothing is uploaded.
- Fix parse errors first - If the left panel is not JSON, you get line and column from
parseJsonDocument. Use the JSON validator or JSON repair, then convert. - Stay modest in the textarea - Tens of thousands of rows may still work on a desktop. Multi-megabyte tables do not belong here.
JSON to CSV Example - Default Rows and Nested Flatten
Two worked examples. The first is the default on this page. The second shows why flatten exists.
Default array of objects
[
{ "a": 1, "b": 2 },
{ "a": 3, "b": 4 }
]CSV output:
a,b 1,2 3,4
Nested object - flatten on
[
{ "user": { "id": 1 }, "ok": true }
]Flatten emits a user.id column plus ok. Stringify instead puts {"id":1} in the user cell and leaves ok as a boolean. Duplicate logical columns after flattening (a nested path and a literal dotted key) last-write-wins in the flattened map.
A JSON array of primitives such as [1, 2, 3] is not an array of objects. The tool reports that it needs an array of objects or one object. Wrap records first, or convert in a script.
When You Need JSON to CSV - Real-World Use Cases
Opening an API list in a spreadsheet
REST endpoints often return an array of objects. Pasting that array here produces a header row and one spreadsheet row per object. Analysts can then filter, pivot, and chart without writing a Python one-liner. Flatten nested user or address objects when those should become columns.
Preparing a database import
Many warehouses and admin UIs import CSV, not JSON. Converting an array of records locally avoids uploading the JSON to a third-party converter. Empty cells for missing keys match how CSV imports usually treat optional columns.
Comparing two exports in Excel
JSON diffs are trees. Spreadsheet diffs are tables. If both dumps are arrays of objects with stable keys, CSV is the format that Excel and Google Sheets already know how to highlight. Flatten first so nested ids become columns you can VLOOKUP.
Keeping nested blobs in one cell
Sometimes a nested object is not a set of columns - it is a payload you want to preserve. Turn flatten off. Papa puts JSON.stringify of that object in one field. Arrays as cell values stringify the same way. That is stringify mode, not flatten mode.
Cleaning rows in the JSON editor first
If objects are messy, edit them in table mode on the JSON editor, then paste the array here. This converter does not rename keys or drop columns; it only unparses what you give it.
Documenting a sample table in a ticket
A two-row default is already a complete CSV example. Replace a and b with the keys your API actually uses, copy the CSV, and paste it into a GitHub issue. Reviewers who do not read JSON still see a table.
Handling sparse objects
Row one may have keys a and b; row two may add c. Headers are the union. Missing cells stay empty. That is how CSV represents optional fields. You do not need to pad objects with null first unless you want the word null in a cell - this page treats JSON null as an empty field.
Avoiding a huge-file textarea
If the array is a 20 MB dump, do not paste it here. Use the JSON file processor to inspect or minify, then convert a sample, or run Papa in a local script. This page is for documents you are willing to keep as a string in the browser.
Flatten vs Stringify vs CSV to JSON
Three nearby choices. Mixing them up produces either extra columns or JSON-in-a-cell surprises:
| Goal | Flatten on | Flatten off | CSV to JSON |
|---|---|---|---|
| Nested object as columns | ✓ user.id | N/A (other page) | |
| Nested object as one cell | ✓ stringify | N/A | |
| Default two-row a,b / 1,2 / 3,4 | ✓ | ✓ | Reverse |
| Rebuild original CSV quoting | No | No | Not guaranteed |
| Spreadsheet import | ✓ | If nested stays in one field | Opposite |
| Array of primitives | Error | Error | Table → objects |
| Huge file | Not this textarea | Not this textarea | Not this textarea |
| Papa unparse quoting | ✓ | ✓ | Parse, not unparse |
The general rule: flatten for columns, stringify for blobs, CSV to JSON when you already have a table.
Common JSON to CSV Errors - Shape, Parse, Collisions
These are the failures this converter reports or silently last-write-wins. They are not pretty-print errors:
- Not JSON. Trailing commas and single quotes fail in
parseJsonDocumentwith line and column. Fix syntax before you expect CSV. - Not an array of objects.
[1,2,3]or a string root is not a table. Wrap records. A single object is allowed as one row. - Empty array.
isArrayOfObjectsrequires at least one object. An empty array is not a header source. - Nested arrays in a cell. They stringify. They do not become extra rows. Row explosion is a different job (unnest in a script).
- Flatten key collision. A nested path
user.idand a literal key"user.id"last-write-wins in the flattened map. - Null cells. JSON
nullbecomes an empty CSV field. If you need the word null, stringify a sentinel or convert in a script. - Booleans and numbers. Papa leaves them unquoted unless quoting is required. Spreadsheets may still coerce them; that is Excel, not this page.
- Huge input. A textarea will hitch long before Papa does. Use a modest array or a local script.
Privacy & Security - Papa unparse in the Browser
JSON to CSV runs entirely in your browser with Papa Parse unparse. The array is not posted to a server. That makes the page usable for exports that contain emails, order ids, or internal field names - with the usual shared-device caveat.
Drafts including the flatten checkbox are saved under a unique storage key for up to 30 days. Click Clear to restore the default two-row array and turn flatten back on. Panel width is stored separately. Do not leave production customer tables in localStorage on a borrowed laptop.
Frequently Asked Questions
What JSON shape converts to CSV?
A JSON array of objects. The default [{"a":1,"b":2},{"a":3,"b":4}] becomes the header a,b and two data rows. A single object is wrapped as one row so you are not stranded, but a nested config tree is still a tree, not a table.
How are nested objects handled?
Flatten mode turns {"user":{"id":1}} into a user.id column. Stringify mode puts {"id":1} in one cell as JSON text. Arrays as cell values stringify. Choose flatten when you want spreadsheet columns; choose stringify when nested structure should stay in one field.
Is this the reverse of CSV to JSON?
Yes, in spirit. CSV to JSON already exists on this site. JSON to CSV is the opposite direction and will not silently rebuild comments, original quoting quirks, or a column order that never existed as object key order in JSON.
Does conversion upload the data?
No. Papa Parse unparse runs in the browser. Drafts stay locally for up to 30 days. Nothing is posted to a server. Clear restores the default two-row array.
What about duplicate headers?
Object keys are unique in JSON after parse. Flattening can still collide if one row has both user.id as a nested path and a literal "user.id" key; later values win in the flattened map. That is a last-write-wins map, not a CSV error.
Can I convert a huge file?
Use a modest array in this textarea. Very large tables belong in the JSON file processor or a local script. A 50 MB array of objects will struggle in a textarea even if Papa could theoretically unparse it.
What happens to null, booleans, and arrays?
Booleans and numbers stay unquoted unless Papa decides they need quotes. Null becomes an empty field. Arrays as cell values stringify to JSON text. Missing keys across the union of columns become empty cells.
Does column order follow the first object only?
Headers are the union of keys after flatten or stringify, in the order Papa sees them from the prepared rows. A key that appears only on the second row still becomes a column. Missing cells on other rows stay empty.
Can I convert a single JSON object?
Yes. A single object is wrapped as one row. That is a convenience, not a claim that every JSON document is a table. Deeply nested configs still need flatten or stringify, and arrays of primitives are not objects.
Is this JSON to CSV converter free?
Yes. No signup, no row cap beyond what your browser will hold, and no upload. Convert as many arrays as you need, then copy the CSV into a spreadsheet or a database import.
Related JSON & Table Conversion Tools
CSV is one export. These pages cover the rest of the table and JSON workflow:
- CSV to JSON - The reverse direction: tabular text to an array of objects.
- JSON Editor - Clean rows in table mode before you unparse.
- JSON Formatter - Pretty-print the array if you need to read it as JSON first.
- JSON Validator - RFC 8259 syntax when the left panel will not parse.
- JSON File Processor - Worker parse for large files that do not belong in this textarea.
- JSON Schema Validator - Confirm record shape before you treat the array as a table.
- JSON Query - Extract a smaller array with JSONPath, then convert that slice.
- JSON Compare - Diff two arrays as trees when CSV is the wrong comparison format.
Related Tools
Discover more free developer tools that might interest you.
XML to JSON
Convert XML data to JSON format
Use ToolCSV to JSON
Convert CSV data to JSON format
Use ToolYAML to JSON
Convert YAML data to JSON format
Use ToolArray to Image
Convert array data to visual image representation
Use ToolBitmap to Array
Convert bitmap images to array data
Use ToolTimezone Converter
Convert time between different timezones
Use Tool