BrowserTools
Home / Converters / JSON to CSV Converter, Flatten JSON Arrays into Spreadsheets

JSON to CSV Converter, Flatten JSON Arrays into Spreadsheets

Convert a JSON array of objects to CSV in your browser. Flattens nested objects and arrays, auto-detects columns, previews and downloads the file.

Loading JSON to CSV Converter, Flatten JSON Arrays into Spreadsheets… If nothing happens, please enable JavaScript.

Paste a JSON array of objects, or drop a .json file anywhere on the tool, and get a ready-to-use CSV file instantly. The converter automatically detects the columns by taking the union of every key found across all objects, so records with different or missing fields still line up correctly, absent values simply become empty cells. The live preview table shows the first 20 rows exactly as they will appear in your spreadsheet, and a row and column counter confirms the size of the result at a glance.

Frequently asked questions

What JSON structure does the converter accept?
A top-level array of objects, for example [{"name": "Alice", "age": 30}, {"name": "Bob"}]. Each element becomes one CSV row. If the top-level value is an object, a string or a number, or if any array item is not an object, the tool shows a clear error explaining exactly what it found instead.
How are nested objects handled?
They are flattened using dot notation. An object like {"address": {"city": "Lisbon", "zip": "1000"}} produces two columns, address.city and address.zip. The flattening works to any depth, so deeply nested API responses convert without manual preprocessing.
How are arrays inside objects handled?
Each element gets its own column with a bracketed index: {"tags": ["admin", "dev"]} becomes columns tags[0] and tags[1]. Arrays of objects combine both rules, so items[0].price and items[1].price appear as separate columns. Rows with shorter arrays leave the extra columns empty.
What happens when objects have different keys?
The column set is the union of every key found across all objects, in first-seen order. An object that lacks a key simply gets an empty cell in that column, so heterogeneous data (common in NoSQL exports and API logs) converts cleanly without losing any field.
When should I choose the semicolon delimiter?
When the file is destined for Excel in a European locale (Portugal, Spain, France, Germany and others), where the comma is the decimal separator and Excel expects semicolon-separated CSV. For most other tools, including Google Sheets and programming libraries, the standard comma is the safe default. Tab is useful for pasting into a spreadsheet directly.
What does the quote-all option do?
By default, fields are only wrapped in double quotes when they contain the delimiter, a quote or a line break, which is the minimal RFC 4180 style. Quote-all wraps every single field in quotes, which some strict importers, legacy systems and data pipelines require. Both modes escape embedded quotes by doubling them.
How are special characters like quotes and line breaks escaped?
Following the RFC 4180 convention: any field containing the delimiter, a double quote or a newline is enclosed in double quotes, and each double quote inside the field is doubled. This is the escaping that Excel, Google Sheets, Python's csv module and virtually every CSV parser understand.
Is my JSON uploaded to a server?
No. Parsing, flattening and CSV generation all happen in your browser with JavaScript. Nothing you paste or drop leaves your machine, so the tool is safe for confidential exports such as customer lists, financial records or API responses containing tokens.
Why do accented characters look wrong when I open the CSV in Excel?
Excel assumes a legacy encoding unless the file starts with a UTF-8 byte order mark. The Download CSV button adds that mark automatically, so accents, umlauts and other non-ASCII characters display correctly. If you use the Copy button and paste elsewhere, the target application controls the encoding instead.
Is there a limit on file size?
The only limit is your browser's memory. Files of tens of megabytes with hundreds of thousands of rows convert fine on a typical machine; the preview always renders only the first 20 rows, so the interface stays responsive even with large inputs.

About JSON to CSV Converter, Flatten JSON Arrays into Spreadsheets

Real-world JSON is rarely flat, so the converter flattens structure automatically. Nested objects are expanded with dot notation: {"address": {"city": "Lisbon"}} becomes a column named address.city. Arrays are expanded with bracketed indices: {"tags": ["admin", "dev"]} becomes tags[0] and tags[1]. The two rules combine to any depth, so a deeply nested API response such as orders[0].items[2].price turns into a clean, predictable column name without any manual work.

Output options cover the quirks of every spreadsheet application. Choose comma, semicolon or tab as the delimiter, semicolons are what Excel expects in most European locales, where the comma is the decimal separator. Toggle the header row off when appending to an existing sheet, and enable quote-all when a strict importer requires every field to be wrapped in double quotes. Escaping follows the RFC 4180 convention: fields containing the delimiter, quotes or line breaks are wrapped in double quotes, and embedded quotes are doubled. The downloaded file includes a UTF-8 byte order mark so Excel displays accented characters correctly.

Everything runs client-side in your browser: the JSON you paste or drop is never uploaded, logged or stored, which makes the tool safe for exports containing customer data, credentials or internal records. Error messages are precise rather than cryptic, you are told whether the JSON failed to parse (with the parser's own message), whether the top-level value is not an array, or which specific item is not an object. Typical uses include turning REST API responses into spreadsheets, preparing data for Excel or Google Sheets, and feeding JSON exports into tools that only accept CSV.

From Punch Cards to REST APIs: the Odd Couple of Data Formats

CSV is far older than most people assume. Comma-separated lists of values appear in the very first release of IBM's FORTRAN compiler in 1972, and the general idea of delimiter-separated fields goes back to punch-card tabulation. Yet for its first three decades CSV had no specification at all: every program invented its own rules for quoting, line endings and embedded commas, which is why parsing other people's CSV files became a rite of passage for programmers. The format was only written down in 2005, when RFC 4180 documented the de facto conventions, fields separated by commas, quotes doubled for escaping, records ended by CRLF. Even then the RFC describes itself merely as documenting existing practice, not defining a standard.

JSON is the much younger half of the pair, and it was discovered rather than invented. Douglas Crockford named and specified it in 2001, but as he likes to point out, JavaScript object literal syntax already existed, he simply carved out a language-independent subset, put up the one-page json.org site, and wrote a specification short enough to print on a business card. JSON's rise tracked the rise of web APIs: it displaced XML in the 2000s largely because it was lighter to transmit and mapped directly onto the data structures of every mainstream language, becoming an ECMA standard in 2013 and an RFC (8259) in 2017.

The two formats endure because they sit at opposite ends of a trade-off. JSON expresses hierarchy, nesting, types and arrays, which makes it ideal for machines talking to machines. CSV expresses a flat grid, which makes it ideal for humans looking at data in a spreadsheet, still the world's most widely used analytical tool. Nearly every data pipeline eventually needs to cross that boundary, flattening nested structures into rows and columns, which is precisely the dot-notation and bracket-index transformation this converter performs. Half a century after FORTRAN's commas and a quarter century after json.org, translating between the two remains one of the most common tasks in data work.

Support