JSON to CSV converter
Turn JSON into a CSV file for Excel or Google Sheets, with nested objects flattened into columns, or CSV back into JSON. Nothing is uploaded.
- Runs in your browser
- Nothing is uploaded
- Free, no sign-up
Paste or open JSON to turn it into CSV. Nothing you add leaves this page.
How it works
JSON is read with the same strict parser as the JSON formatter, so a mistake is reported with its line and column, and numbers are copied exactly as written: long IDs like 12345678901234567890 aren't rounded and 1.50 stays 1.50. JSON Lines (one value on each line) is read too.
An array of objects becomes one row per object, with a column for every key that appears in any of them, in the order they first appear. When the array sits inside an object, as in most API responses ({"data": [...]}), the page finds it and lets you pick another one. An object whose values are all objects becomes a row per key, with the key in its own column. An array of arrays is written as rows as it is, with no header line. Empty values and null become empty cells, and true and false stay as words.
The CSV follows RFC 4180, the format Excel and Google Sheets read: a value with the delimiter, a quote or a line break in it is put in double quotes, quotes inside it are doubled, and lines end with CR LF. The download starts with a UTF-8 byte order mark unless you untick it, because without one Excel reads the file in the computer's older character set.
Text starting with =, +, - or @ can run as a formula when a spreadsheet opens the file, which is a known way to attack people with data from someone else. The page counts such cells, and “Stop text being run as formulas” puts an apostrophe before each, as security guides recommend. Numbers like -5 are left alone.
CSV to JSON reads the same format, including quoted values over several lines. It writes JSON indented with 2 spaces. Values with leading zeros, like 007 and many zip codes, stay text, and so does anything in quotes in the CSV. Whole numbers too long for JavaScript are kept as text too, so they can't be rounded. Everything runs in a background worker inside this tab, so big files don't freeze the page.
Questions
How do I convert JSON to CSV?
Paste the JSON into the box or open a .json file. Each object in the array becomes a row and each key a column, shown as a table as you type. Pick a comma, semicolon or tab, then copy the CSV or download it as a .csv file that opens in Excel, Google Sheets or Numbers.
How are nested objects and arrays turned into columns?
Nested objects get one column per value, named with dots: a customer with a name and a city becomes the columns customer.name and customer.city. Arrays inside a row get a column per item (tags.0, tags.1) or, if you choose, stay as JSON text in one cell. Converting the CSV back to JSON on this page rebuilds the nesting from the dotted names.
How do I open JSON in Excel?
Convert it to CSV here and open the downloaded file in Excel. The download is marked as UTF-8, so accented letters and emoji come out right. If Excel puts everything in one column, your Excel expects semicolons, as it does in much of Europe: choose Semicolon and download again.
How do I convert CSV to JSON?
Choose CSV to JSON at the top, then paste or open the CSV. The first row becomes the keys and every other row an object; numbers and true or false become JSON values unless you turn that off, and empty cells become null. Commas, semicolons and tabs are detected for you.
Limits
The limit is 10,000,000 characters (about 10 MB) either way. Excel and Google Sheets open at most 1,048,576 rows, and the page says so when the CSV has more; it refuses JSON that would make more than 16,384 columns, more than Excel can show, and suggests keeping arrays in one cell instead. The table shows the first 100 rows and 50 columns; the CSV has all of them.
Excel files (.xlsx) aren't read or written: save a sheet as CSV in Excel first, or open the CSV from here in Excel and save it as .xlsx. JSON must be strict JSON; comments and trailing commas are errors.
Keys containing dots are joined the same way as nested keys, so on the way back to JSON a key like “a.b” becomes a nested object unless you untick “Nest dotted keys”. Files are read as UTF-8 text. Nothing is kept in the page address or saved: reloading the page clears it.
Privacy
This tool runs entirely in your browser. The files you open and what you type are never sent to a server, and nothing is stored after you close the page. See the privacy page.
Related tools
JSON formatter and validator
Format, beautify, minify and validate JSON, with errors explained by line and column and a tree view. Your JSON is never uploaded or saved.
JWT decoder
Paste a JSON Web Token to read its header and claims, see when it expires and check its signature. The token never leaves your browser.
Unix timestamp converter
Turn a Unix timestamp into a date in your time zone, UTC and ISO 8601, or a date into a timestamp. Reads seconds or milliseconds, and makes Discord codes.