JSON ⇄ CSV Converter

Convert JSON to CSV and CSV to JSON. Nested objects become dotted columns, values with commas, quotes or line breaks are quoted per RFC 4180, and the delimiter and column types are detected for you.

Converter Web & Dev Updated Oct 3, 2026
Learn how this works
How to Use
  1. Choose JSON → CSV or CSV → JSON.
  2. Paste your data, or drop a .json, .csv or .tsv file; the direction is picked from the file. The result updates as you type.
  3. Leave Delimiter on Auto, or pick comma, tab, semicolon or pipe. Untick Header row if the first CSV line is data, not column names.
  4. Check the table preview and Show Work: they list the columns, which values were quoted and why, and which columns became numbers or true/false.
  5. Press Copy result, Download the file, or Swap to send the result back the other way.
Input
array of objects
⇄
Or drop a .json, .csv or .tsv file (up to 20 MB)
Presets
Result
CSV
Rows
—
Columns
—
Delimiter
—
Quoted fields
—

Worked Example

JSON to CSV. Two records: {"id": 1, "name": "Smith, Jr.", "address": {"city": "Leeds", "zip": "LS1 4AP"}, "tags": ["vip", "new"]} and {"id": 2, "name": "Ada \"The Countess\"", "address": {"city": "London"}}.

Columns are every key in the order first seen, with the nested address flattened: id, name, address.city, address.zip, tags — 5 columns. Record 2 has no zip and no tags, so those cells are empty. Three values need quotes: Smith, Jr. contains a comma, the tags array is written as JSON text that contains quotes, and Ada’s name contains quotes, which are doubled.

id,name,address.city,address.zip,tags
1,"Smith, Jr.",Leeds,LS1 4AP,"[""vip"",""new""]"
2,"Ada ""The Countess""",London,,

CSV to JSON. name,zip,age,member with rows Ann,02134,30,true, Ben,10001,25,false and Cal,94105,41,true. Each column is typed as a whole: age holds only plain numbers, so 30, 25 and 41 become numbers; member holds only true and false, so it becomes booleans; zip has 02134 with a leading zero, so the whole column stays text and Ann’s zip keeps its zero: {"name": "Ann", "zip": "02134", "age": 30, "member": true}.

The common mistake: splitting CSV lines on every comma. The first data line above, 1,"Smith, Jr.",Leeds,LS1 4AP,"[""vip"",""new""]", has 5 fields, but a plain split gives 7 — "Smith and Jr." land in different columns, and the city moves under the zip heading. A real parser has to track whether it is inside quotes.

Show Work

Paste JSON or CSV above to see how the columns, quoting and types were worked out.

Conversion Rules

When to quote
value has delimiter, " or a line break ⇒ "value"
RFC 4180, section 2
Quote escaping
" → ""   Ada "A" → "Ada ""A"""
A doubled quote inside quotes is one literal quote
Columns
columns = ∪ keys(recordi)
First-seen order; a missing key is an empty cell
Flattening
{"a": {"b": 1}} → a.b = 1
Arrays are kept whole as JSON text in one cell
Delimiter detection
same field count > 1 on every line ⇒ chosen
Tried on the first 10 lines: comma, tab, semicolon, pipe
Column types
all ^-?(0|[1-9]\d*)(\.\d+)?$ ⇒ number
All true/false ⇒ boolean; anything else keeps the column as text

Two Formats, Fifty Years Apart

Comma-separated values are older than the personal computer: IBM’s FORTRAN compilers for OS/360 accepted list-directed input separated by commas by 1972, and spreadsheets and databases later adopted the idea to exchange tables. For decades there was no standard, which is why files still disagree about quotes, line endings and delimiters. RFC 4180, published in October 2005, finally wrote down the common rules: fields separated by commas, lines ending in CRLF, and fields containing commas, quotes or line breaks enclosed in double quotes with inner quotes doubled.

JSON came from the other direction. Douglas Crockford described it in the early 2000s as a subset of JavaScript’s object syntax; it became ECMA-404 in 2013 and RFC 8259 in 2017. JSON nests and has types; CSV is a flat grid of text. Converting between them means choosing how to flatten the nesting and how to guess the types back, which is what this tool shows step by step.

About This Tool

This tool converts JSON to CSV and CSV to JSON. From JSON it builds the columns from every record, flattens nested objects into dotted columns and quotes exactly the values that need it. From CSV it detects the delimiter, reads quoted fields that contain commas, quotes or line breaks, and types each column as a whole, so zip codes and other leading-zero values are not damaged.

The table preview, readouts and Show Work tell you what happened: which delimiter was chosen and why, which values were quoted, which rows are uneven and which columns became numbers. Files up to 20 MB are converted in your browser; nothing is uploaded.

Related tools: JSON Formatter, JSON to TypeScript, and CSV Viewer.

Frequently Asked Questions

What JSON shape converts to CSV?

An array of objects, one row per object. The columns are the union of every key in the order first seen, so records do not all need the same fields; a missing key leaves an empty cell. Nested objects become dotted columns (address.city), arrays are written as JSON text in one cell, a single object becomes one row, and an array of arrays is written row by row with no header.

How are commas, quotes and line breaks handled?

As RFC 4180 says: a value containing the delimiter, a double quote or a line break is wrapped in double quotes, and each quote inside it is doubled. Smith, Jr. becomes "Smith, Jr." and Ada "The Countess" becomes "Ada ""The Countess""". Lines end in CRLF. Reading CSV, the same rules apply in reverse, so a quoted field can even span several lines.

How does the delimiter detection work?

The first 10 lines are split with each candidate — comma, tab, semicolon and pipe — while respecting quotes, and the one that gives the same number of fields (more than one) on every line wins. For produkt;preis;menge followed by Apfel;1,20;3, semicolon gives 3 fields on all 4 lines while comma gives 1 field on the header line, so semicolon is chosen and 1,20 stays one value.

Why did my zip code stay as text?

Types are decided per column, not per cell. A column becomes numbers only if every value is a plain number with no leading zero, so a zip column holding 02134 stays text for every row and keeps the zero. A column of only true and false becomes booleans, a decimal comma such as 1,20 stays text, the word null becomes null, and an empty cell becomes an empty string. Untick Detect types to keep everything as text.

How large a file can it convert?

Up to 20 MB of text. A 9.8 MB CSV of 200,000 rows converted in about half a second in testing. The preview table shows the first 8 rows and 8 columns, while the output and the download hold everything. The data never leaves your browser.

How do I use the JSON ⇄ CSV Converter?

Simply type or paste your value and read the result, which refreshes the instant you change something. There is nothing to submit and nothing to wait for.

Is it free? Does it work without internet?

Yes to both. It is free with no sign-up, and once the page has loaded it keeps working even with no internet.

Where does my data go?

Nowhere — every calculation runs on your own device. Nothing you enter is uploaded, logged, or stored.

Common Use Cases

API data into a spreadsheet

Turn a JSON response of 500 orders into CSV for Excel or Google Sheets, with the nested customer.email and customer.city as their own columns.

Spreadsheet into code

Export a sheet as CSV and get a JSON array with real numbers and booleans, ready to paste into a fixture or config file.

European CSV files

Files from locales that write 1,20 for one point two use semicolons between columns; Auto detects the semicolon so prices stay in one column.

Tab-separated exports

Paste cells copied from a spreadsheet: they arrive tab-separated, and Auto picks the tab without any setting.

Finding broken rows

Show Work lists rows with too few or too many fields and any quote that never closes, the usual reason a 1,000-row import shifts columns halfway down.

Last updated: