JSON to CSV Converter: Flatten, Export and Open in Excel
Convert a JSON array, API response or nested object to CSV. Flatten keys, pick delimiters, add an Excel BOM and guard formulas. Runs in your browser.
Runs in your browser. Nothing is uploaded.
ConvertersJSON to CSV
JSON
Max 50MB each
Leave empty to detect. Use dots for keys and numbers for array positions.
Result
Paste JSON on the left, or load the sample. Rows and columns appear here as you type.
Example
[{"id":1,"name":"Asif","address":{"city":"Lahore"},"tags":["node","angular"]},{"id":2,"name":"Sara","address":{"city":"Leeds"},"tags":[]}]id,name,address.city,tags 1,Asif,Lahore,"[""node"",""angular""]" 2,Sara,Leeds,[]
How to convert JSON to CSV
Paste JSON into the input box, drop a .json file on it, or load the sample. The CSV appears next to it as you type, and you can copy it or download a .csv file. A top-level array of objects is the usual case: each object becomes a row and every key becomes a column. The tool also accepts an array of arrays, an array of plain values, a single object, and an API envelope such as {"page":1,"data":[...]}, where it finds the largest array of objects on its own. If the rows sit somewhere else, type a path like data.users in the path box.
Objects in an array rarely have identical keys, so the columns are the union of all keys, in the order they first appear or alphabetically if you prefer. A row that lacks a key gets an empty cell. A null value becomes an empty cell or the word null, as you choose. Numbers and booleans are written as they are, and strings that contain the delimiter, a quote or a line break are quoted correctly, with quotes inside doubled, as RFC 4180 describes.
Nested objects, arrays and dates
CSV is flat, JSON is not, so something has to give. By default nested objects are flattened into dot paths: {"address":{"city":"Lahore"}} becomes a column named address.city. If you would rather keep the structure, choose to leave nested objects as a JSON string in one cell. Arrays have three modes: a JSON string in one cell, a joined list such as node; angular, or one column per item (tags.0, tags.1). The per-item mode can create many columns, so the tool stops at 10,000 columns and tells you to pick another mode.
JSON has no date type, so dates arrive as text, usually ISO 8601. Excel tends to show 2024-03-05T14:30:00Z as plain text. The Excel-friendly option rewrites full ISO timestamps as 2024-03-05 14:30:00 in UTC, which Excel recognises as a date. Date-only strings such as 2024-03-05 are left alone. Integers larger than 2^53 are kept digit for digit instead of being rounded by the JSON parser, in browsers that expose the original number text.
Excel, encoding and CSV injection
Excel assumes your computer's legacy code page unless a file starts with a UTF-8 byte order mark. If accents or emoji look garbled after you open a downloaded CSV, switch on the BOM option. The BOM is added to the downloaded file only, not to the text you copy. Semicolon-delimited output is what Excel expects in many European locales, and CRLF line endings match RFC 4180.
A CSV cell that begins with =, +, - or @ can be run as a formula when the file is opened in Excel or Google Sheets. That is called CSV injection or formula injection, and it matters whenever JSON from users or an external API ends up in a spreadsheet someone else opens. The guard option prefixes such cells with a single quote so they are shown as text. Plain numbers such as -5 are left untouched. The guard reduces the risk but cannot promise that every spreadsheet program treats every cell as text, so keep untrusted exports out of automated imports.
Everything runs in your browser. Inputs above about one megabyte are converted in a background worker so the page stays responsive, and very large inputs are limited by your browser's memory, with a 50 MB cap on files.
Frequently asked questions
How do I convert nested JSON to CSV?
Leave "Nested objects" on flatten. Each nested key becomes a dotted column such as address.city. Choose how arrays are written: a JSON string, a joined list or one column per item.
Why do the columns differ between rows?
JSON objects in an array can have different keys. The CSV uses the union of all keys as columns and leaves the cell empty where a row has no value for that key.
Why does Excel show garbled characters?
Excel guesses a legacy encoding unless the file begins with a UTF-8 byte order mark. Turn on "BOM for Excel" and download the file instead of copying the text.
What does the CSV injection guard do?
It puts a single quote in front of any text cell that starts with =, +, - or @, so spreadsheets show it as text rather than evaluating it as a formula. Numbers like -5 are not changed.
Is my JSON uploaded anywhere?
No. The conversion runs in your browser, in a background worker for large inputs. Nothing is sent to a server.
