JSON ↔ CSV Converter
Convert JSON arrays to CSV and back. Configure delimiter and headers.
What is JSON ↔ CSV Converter?
A JSON to CSV converter takes an array of JSON objects and rewrites it as a comma-separated values document with one header row and one data row per object, following the CSV format described in RFC 4180. The reverse direction parses a CSV document and emits a JSON array where each row becomes an object keyed by the header columns.
This JSON to CSV converter runs both directions in your browser. Paste an array of objects and click Convert to get a CSV file you can open in Excel, Google Sheets, or import into a database. Paste a CSV and switch the mode to CSV → JSON to get a clean JSON array ready for an API. Data engineers, analysts, and backend developers use it to bridge JSON-only APIs with CSV-only spreadsheets, BI tools, and legacy systems.
Why use this JSON to CSV converter?
- Move data between APIs and spreadsheets. Convert a JSON API response to a CSV that imports cleanly into Excel, Sheets, Airtable, or any SQL
COPYstatement. - Flatten nested fields automatically. Nested objects collapse to dotted column names (
user.email), so the resulting CSV has one row per record with no array gymnastics. - Reverse the trip in one click. The same tool converts CSV back to JSON, so a stakeholder edit in a spreadsheet round-trips into an API payload.
- Stay private by default. Conversion runs entirely in your browser. Your data never reaches a server, so customer records and PII stay on your machine.
- Skip the script. Quick conversions that would normally need a Python or Node snippet take one paste and one click, with no install.
How to use the JSON to CSV converter
- Select the direction with the JSON → CSV or CSV → JSON toggle at the top.
- Paste your data into the input panel on the left.
- Click Convert. The result appears in the output panel on the right.
- Click the copy icon on the output panel to copy the result, or paste it directly into a spreadsheet or text file.
A minimal JSON to CSV conversion:
[
{ "id": 1, "name": "Ada Lovelace", "role": "admin" },
{ "id": 2, "name": "Grace Hopper", "role": "owner" }
]becomes:
id,name,role
1,Ada Lovelace,admin
2,Grace Hopper,ownerType-mapping table
JSON has six value types. CSV has only strings. The converter applies these rules in both directions so the round-trip is predictable.
| JSON type | CSV output | CSV → JSON re-read |
|---|---|---|
string | Literal value, quoted if it contains ,, ", or newline | Always re-read as string |
number | Decimal literal (3.14, -2) | Re-read as number if numeric |
boolean | true / false | Re-read as boolean |
null | Empty cell | Re-read as empty string |
object (nested) | Flattened keys (address.zip) | Stays flat unless un-flattened manually |
array | JSON-stringified inside the cell ("[1,2,3]") | Re-read as string |
Because CSV is typeless, the round-trip preserves shape but not necessarily types. A column that was all numeric becomes numbers again, but a column with mixed types becomes strings.
Worked examples
Nested objects flatten by joining keys with a dot, which Excel and Sheets accept as plain header text:
[
{ "id": 1, "user": { "name": "Ada", "email": "a@x.io" } },
{ "id": 2, "user": { "name": "Grace", "email": "g@x.io" } }
]id,user.name,user.email
1,Ada,a@x.io
2,Grace,g@x.ioStrings that contain commas, quotes, or newlines are wrapped in double quotes per RFC 4180. Embedded double quotes are escaped by doubling them:
[
{ "id": 1, "note": "She said \"hello, world\"" }
]id,note
1,"She said ""hello, world"""In the CSV → JSON direction, the parser auto-detects numeric and boolean columns and casts them back. Empty cells become null. The first row is always treated as the header.
Common use cases
- Data analysts pulling JSON APIs into spreadsheets. Convert the API response to CSV and paste it into Sheets for pivot tables and charts.
- Backend developers loading seed data. Convert a CSV exported from Excel into a JSON fixture for tests and database seeders.
- QA engineers building test datasets. Edit a CSV in a spreadsheet, then convert it back to JSON for API integration tests.
- Operations teams migrating between systems. Move user records, product catalogs, or transaction logs between a JSON-only SaaS and a CSV-only legacy tool.
- Marketers preparing import files. Convert API exports into CSVs that match the column format required by HubSpot, Mailchimp, or Salesforce.
JSON to CSV vs alternatives
| Tool | Best for | Offline | Cost | Limitations |
|---|---|---|---|---|
jq -r + shell | Scripted batch conversion | Yes | Free | Verbose syntax; manual flattening. |
Python pandas | Large files, custom transforms | Yes | Free | Requires Python install. |
| Online services | Quick one-off conversions | No | Free or paid | Uploads data to a server. |
| This JSON to CSV converter | Paste, convert, both directions, in browser | Yes (in browser) | Free | Best for files under ~10 MB. |
Frequently asked questions
How does the JSON to CSV converter handle nested objects?
Nested objects flatten into dotted column names, so {"user": {"name": "Ada"}} becomes a column called user.name. This keeps the CSV one row per record without losing any data. Arrays inside objects are JSON-stringified into a single cell, since CSV has no native array representation.
Can I convert CSV back to JSON?
Yes. Use the CSV → JSON mode at the top of the tool. The first row is treated as the header and every later row becomes one JSON object. Numeric and boolean columns are auto-detected and cast back to native types, while empty cells become null.
What CSV dialect does the converter produce?
It follows RFC 4180: comma delimiter, double-quote escape character (doubled to escape a quote), CRLF line endings, and the first row as the header. Most tools (Excel, Sheets, PostgreSQL COPY, MySQL LOAD DATA) accept this dialect without configuration.
My JSON is a single object, not an array. Does it still convert?
No. CSV needs a collection of records to produce rows. Wrap your single object in an array ([{...}]) before pasting, or paste the array of records you want as rows. The converter throws an error if the root is not an array of objects.
How does the converter handle commas and quotes inside strings?
Strings that contain a comma, double quote, or newline are wrapped in double quotes per RFC 4180. Embedded double quotes are escaped by doubling them. So She said "hi" becomes "She said ""hi""" in the CSV. The reverse parser unescapes this correctly.
What happens to fields that are missing in some objects?
The header is the union of every key across every object. Objects that are missing a key produce an empty cell in that column. When you convert CSV back to JSON, those empty cells become null to preserve the difference between an empty string and a missing value.
Can the converter handle large datasets?
Files up to about 10 MB convert quickly in a modern browser. Beyond that, the textarea and the DOM rendering of the output slow down. For large datasets, use a CLI tool like jq for JSON to CSV or csvkit’s in2csv for the reverse.
Does the converter respect column order?
Yes. The header row is built from the order keys appear in the first object, with extra keys from later objects appended. If you need a specific column order, reorder the keys in the first object of your JSON array before converting.
Related tools
- JSON Formatter & Diff: Pretty-print JSON and compare two payloads.
- JSON Validator: Check JSON syntax and pinpoint the exact line of any error.
- JSON Minifier: Strip whitespace and compress JSON to its smallest valid form.
- CSV Generator: Generate sample CSV data for tests and fixtures.
Related tools
JSON Formatter & Diff
Paste two JSON payloads and see the real diff with collapsible tree, key search, and copy-as-JSON-path.
Open toolJSON Validator
Paste JSON and instantly see if it's valid, with the exact line and character of any error.
Open toolJSON Minifier
Strip whitespace and compress JSON to its smallest valid form.
Open toolShotMark captures what you do here, in one click.
The traces, payloads, and tests you run by hand? ShotMark grabs the whole bug and hands it to your AI agent.