JSON to CSV Converter Online
Paste a JSON array to instantly convert it into CSV format. Flatten nested objects, customize delimiters, preview in a table, and download the result as a .csv file. Free, private, and runs entirely in your browser.
Tool Highlights
Instant JSON to CSV Conversion
Paste any valid JSON array and get well-formatted CSV output in a single click. The converter analyzes every object in your array, collects all unique keys across every row, and produces a complete CSV document with consistent columns. Whether your input contains ten records or ten thousand, the conversion happens entirely in your browser with no server round-trip and no file-size upload limit. This makes the tool ideal for quick data exports, one-off migrations, and ad-hoc reporting where you need spreadsheet-compatible output from raw API data.
Nested Object Flattening
Real-world JSON rarely comes in flat key-value pairs. APIs return deeply nested objects with sub-objects and arrays embedded inside each record. Our converter handles this by recursively flattening every nested structure using dot notation. A field like address.city becomes its own CSV column, preserving the hierarchical relationship in the header name while keeping the cell values simple and readable. Array values within objects are serialized as JSON strings so that no data is lost during the conversion process, giving you a lossless transformation from tree-structured data to tabular format.
Customizable Delimiters
Not every application expects the same CSV dialect. European spreadsheet software often defaults to semicolons because commas are used as decimal separators. Database import tools sometimes prefer tab-separated values, and Unix pipeline workflows may use pipes. This converter lets you choose between comma, semicolon, tab, and pipe delimiters so your output file works correctly the first time you open it in Excel, Google Sheets, LibreOffice Calc, or any data processing pipeline. The delimiter setting applies to both the text output and the downloaded file.
Live Data Preview Table
Before downloading your CSV file, review the parsed data in a scrollable, sortable preview table rendered directly on the page. Column headers are highlighted for quick identification, and each cell truncates long values with an ellipsis so the table remains readable even with wide datasets. The preview shows the exact same row and column structure that will appear in your downloaded file, so you can verify the flattening logic and delimiter settings are correct before committing to a download. This eliminates the trial-and-error loop of converting, downloading, opening, and reconverting.
How to Convert JSON to CSV
- Paste your JSON array. Copy a JSON array of objects from your API response, database export, or text editor and paste it into the input area. You can also click the Sample button to load example data and explore the tool immediately. The input must be a valid JSON array where each element is an object.
- Configure options. Select your preferred delimiter (comma, semicolon, tab, or pipe). Check or uncheck Include Headers to control whether the first row contains column names. Enable Flatten Nested Objects to expand sub-objects into dot-notation columns automatically.
- Click Convert. The tool parses your JSON, collects all unique keys, flattens nested structures if enabled, and generates CSV text. The output appears in the CSV panel below the input, and a preview table renders the data in a visual grid.
- Copy or download. Click Copy CSV to send the result to your clipboard, or click Download .csv to save a ready-to-use CSV file to your computer. The file uses UTF-8 encoding with a BOM for maximum Excel compatibility.
Use dot notation to flatten nested JSON keys into CSV column headers (e.g., user.address.city). This preserves the hierarchical relationship in the column name, making it easy to reconstruct the original JSON structure later if needed.
Forgetting that CSV loses all data type information — numbers, booleans, null values, and dates all become plain strings. When importing CSV back into a typed system, you must explicitly parse and cast each column. A JSON boolean true becomes the string "true" in CSV.
Use Cases & Examples
Product Manager
Sofia exports user analytics data from a REST API as JSON and converts it to CSV for pivot table analysis in Excel. She uses the flattening option to expand nested event properties into separate columns for easy filtering and charting.
Data Scientist
Nikolai converts API response data from JSON to CSV for import into pandas DataFrames. He verifies the column structure and data types here before writing the automated Python script that will process thousands of records nightly.
Business Analyst
Fatou receives JSON exports from the company CRM and needs to produce CSV reports for stakeholders who use Google Sheets. She converts the data, selects semicolon delimiters for European locale compatibility, and downloads the file directly.
Understanding JSON to CSV Conversion
JSON and CSV are two of the most common data interchange formats in modern software development, yet they serve fundamentally different purposes. JSON excels at representing hierarchical, nested data structures that map naturally to objects in programming languages. CSV, on the other hand, represents flat, tabular data where every record has the same columns — making it the universal format for spreadsheets, relational databases, and data analysis tools. Converting from JSON to CSV is a routine task for developers, data analysts, and system administrators who need to bridge these two worlds.
The core challenge in JSON-to-CSV conversion is structural: JSON supports arbitrary nesting depth, mixed types within arrays, and optional fields that may appear in some records but not others. A naive conversion that ignores nested objects would lose critical data. This tool addresses that challenge by recursively walking every object in your array and building a complete, flat key set using dot notation. For instance, an object like {"user": {"name": "Alice", "address": {"city": "Seoul"}}} becomes three columns: user.name and user.address.city. Array values that cannot be further flattened are serialized as JSON strings within the CSV cell, ensuring no information is discarded.
Encoding is another important consideration. CSV files destined for Microsoft Excel should include a UTF-8 Byte Order Mark at the beginning of the file so that Excel correctly interprets special characters, accented letters, and non-Latin scripts. Without the BOM, Excel may default to a locale-specific encoding and corrupt international characters. Our download feature automatically prepends the BOM so your files open correctly in Excel on any operating system without additional configuration steps.
Delimiter choice matters more than many users realize. While commas are the default in English-speaking regions, many European countries use semicolons in their CSV conventions because the comma is reserved as a decimal separator. Tab-separated values are preferred in scientific computing and bioinformatics because they avoid conflicts with commas embedded in text fields. Pipe-delimited files are common in legacy mainframe systems and EDI data exchanges. By offering all four delimiters, this tool ensures your output is compatible with your target system on the first try.
FAQ
Why would I convert JSON to CSV?
JSON is the standard format for API responses and application data storage, but many business tools operate on tabular data. Spreadsheet applications like Excel and Google Sheets, relational database import utilities, and data visualization platforms all expect CSV or TSV input. Converting JSON to CSV allows you to take structured data from an API endpoint, a NoSQL database export, or a log file and immediately use it in these tools for analysis, reporting, and sharing with non-technical team members who are more comfortable working with rows and columns than nested brackets.
How are nested objects handled during conversion?
When the Flatten Nested Objects option is enabled, the converter recursively traverses every sub-object and creates columns using dot-notation paths. For example, a JSON field at user.profile.email becomes a CSV column header named user.profile.email with the corresponding value in each row. If a nested field is itself an array or a complex structure that cannot be further flattened into simple values, it is serialized as a JSON string within the CSV cell. This approach ensures that no data is lost while still producing a flat tabular structure suitable for spreadsheet applications.
What happens to array values inside JSON objects?
Arrays that contain primitive values (strings, numbers, booleans) are converted to a JSON-encoded string and placed in a single CSV cell. For example, {"tags": ["dev", "tool"]} produces a cell containing ["dev","tool"]. If an array contains objects and the flatten option is on, the entire array is serialized as a JSON string because there is no universal way to map a variable-length array of objects to a fixed set of columns. If you need each array element in its own row, you would need to preprocess the JSON to unnest the arrays before conversion.
Will the CSV file open correctly in Excel?
Yes. The downloaded file uses UTF-8 encoding with a Byte Order Mark (BOM), which is the recommended encoding for CSV files opened in Microsoft Excel. The BOM tells Excel to interpret the file as UTF-8, ensuring that accented characters, Asian scripts, emoji, and other non-ASCII content display correctly. If you are using the comma delimiter and your system's regional settings use semicolons, you can switch the delimiter to semicolons in the options bar so that Excel parses the columns correctly without requiring manual import configuration.
Is there a size limit for the JSON input?
There is no hard limit enforced by this tool because all processing happens in your browser using JavaScript. The practical limit depends on your device's available memory and processing power. Modern browsers can handle JSON documents of several megabytes without issues. For extremely large datasets in the tens of megabytes, you may experience a brief delay during parsing and flattening. If you are working with files larger than about 50 MB, a command-line tool or a server-side script would be more appropriate for the conversion.
What encoding does the downloaded CSV file use?
The downloaded file is encoded as UTF-8 with a Byte Order Mark (BOM) prepended at the beginning of the file. UTF-8 is the universal character encoding that supports every writing system and symbol. The BOM (three bytes: EF BB BF) serves as a signal to applications like Excel that the file is UTF-8 encoded. Without the BOM, some spreadsheet programs might misinterpret the file using a legacy encoding such as Windows-1252, which would corrupt any characters outside the basic ASCII range. Google Sheets and LibreOffice always interpret CSV as UTF-8 regardless of the BOM.
Is my data safe when using this tool?
Yes, your data stays completely private. All JSON parsing, flattening, and CSV generation happen entirely in your browser using client-side JavaScript. Nothing is uploaded to any server, stored in any database, or transmitted over the network. You can verify this by opening your browser's developer tools and monitoring the Network tab while using the tool — no data requests are made when you convert, copy, or download. This makes the tool safe for sensitive datasets including internal business data, personal information, and proprietary API responses.
Flattening Nested JSON
Converting hierarchical JSON to flat CSV requires a process called flattening. Nested objects become dot-separated column names, and arrays are expanded into indexed columns. Understanding this process helps you predict and control the CSV output structure.
{
"id": 1,
"name": "Alice",
"address": {
"city": "Seattle",
"state": "WA",
"zip": "98101"
},
"tags": ["admin", "editor"]
}
id → idname → nameaddress.city → address.cityaddress.state → address.stateaddress.zip → address.ziptags[0], tags[1] → indexed columnsid,name,address.city,address.state,address.zip,tags.0,tags.1
1,Alice,Seattle,WA,98101,admin,editor
How flattening rules work: Nested object keys are joined with a dot separator (e.g., address.city). Array elements are expanded into separate columns using numeric indices (e.g., tags.0, tags.1). When different objects in an array have different keys, all unique keys become CSV columns with empty values where a particular object lacks that key.
Handling edge cases: Deeply nested structures produce long column names like order.items.0.product.name. Arrays of objects create multiple column groups per array element. If your JSON contains mixed-type arrays (strings and objects together), some converters will serialize the non-primitive values as JSON strings within the CSV cell. This tool handles all of these cases automatically.