JSON to CSV and Excel converter
Convert JSON to CSV or JSON to Excel (.xlsx), 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. Lists of records inside each item, such as an order's items or the b2b[].inv invoices in a GSTR-2B download, are offered too, up to three lists deep: each inner item becomes a row, with the fields of the items around it repeated first (supplier GSTIN and name, then the invoice's own columns, named like inv.inum). An item whose list is missing or empty still gets one row, so nothing drops out. 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. When each row holds a list of records, like orders with their items or a GST return's suppliers with their invoices, choose that list under Rows from to get one row per item, with the order's or supplier's details repeated on each. Converting the CSV back to JSON on this page rebuilds the nesting from the dotted names.
How do I convert JSON to Excel?
Paste or open the JSON, then press Download .xlsx for an Excel workbook: numbers and true or false become Excel values, text stays text (long IDs and leading zeros included), and the header row is bold and stays in view. Or download the CSV, which is marked as UTF-8 so Excel shows accented letters and emoji right.
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 here: turn a sheet into CSV with the CSV to Excel converter's Excel to CSV mode first. The .xlsx download has one sheet, with the same rows and columns as the CSV; JSON numbers longer than the 15 digits Excel keeps are saved as text. 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.
XML to JSON, CSV and Excel converter
Convert XML to JSON, or XML to CSV and Excel with each repeating element as a row, and JSON back to XML. Your files are never uploaded.
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.