Paste JSON, pick your options, download a clean CSV — all in your browser.
Converting JSON data to CSV format is one of the most common data-wrangling tasks faced by analysts, developers, and business users alike. Whether you have pulled data from a REST API, exported records from a database, or received a JSON dump from a third-party service, a clean and reliable JSON-to-CSV conversion is frequently the first step before opening the file in Excel, importing it into a BI tool, or loading it into a database table. This free JSON to CSV Converter runs entirely inside your browser. Nothing is ever sent to a server — your data stays private and local, no matter how sensitive it is. Conversion happens in milliseconds, even for files with thousands of rows, because the tool processes everything using optimised JavaScript running on your own device. The converter handles the full range of real-world JSON shapes. If your input is a simple flat array of objects — the most common case — each object becomes a CSV row and the union of all keys becomes the header row. This means sparse datasets where some records have extra or missing fields are handled gracefully: missing values simply produce an empty cell rather than crashing the conversion. If your JSON is a single object rather than an array, the tool wraps it automatically so you still get a one-row CSV. If your JSON has a top-level wrapper object that contains an array as one of its properties, the converter detects and extracts that array automatically. Nested objects are a frequent pain point. When you have a structure like `{ "address": { "city": "London", "postcode": "EC1A" } }`, the tool can optionally flatten it into dot-notation columns — `address.city` and `address.postcode` — so every value lands in its own CSV column without losing any information. This recursive flattening handles arbitrarily deep nesting and is toggled with a single checkbox. Arrays embedded within objects present a different challenge. The converter offers three strategies: stringify the array as a JSON string and place it in a single cell (safe, lossless), join the array elements with a pipe character (readable, compact), or expand to multiple rows so each array element generates its own CSV row with the parent fields repeated. The right strategy depends on your downstream tool — Excel users typically prefer stringify or join, while database imports often benefit from row expansion. Quoting follows RFC 4180 by default — only values that contain the delimiter character, a double-quote, or a newline are wrapped in double quotes, and any literal double-quote inside a value is escaped as two consecutive double-quotes (`""`). You can switch to Always quote (wraps every cell regardless) for maximum compatibility with strict parsers, or Never quote for the simplest possible output when you are sure your data contains no problematic characters. Null and undefined values are handled cleanly: by default they produce an empty cell, but you can output the literal string `null` or any custom replacement text such as `N/A`, `0`, or `—`, giving you full control over how missing data appears in your spreadsheet. For Excel users on Windows, the BOM (Byte Order Mark) toggle prepends the `\uFEFF` character to the output. This invisible character signals to Excel that the file is UTF-8 encoded, preventing accented characters, Chinese text, or other non-ASCII content from showing as garbled symbols when the file is opened directly. The live preview table shows the first ten rows of your converted data as an HTML table, updating automatically as you change any option — no button click required. This makes it easy to spot formatting issues before you download. The stats bar shows row count, column count, and estimated file size so you always know what you are working with.
Understanding JSON to CSV Conversion
What Is JSON to CSV Conversion?
JSON (JavaScript Object Notation) is a hierarchical, human-readable text format used extensively for API responses, configuration files, and data exchange between services. It supports nested objects, arrays, mixed types, and null values. CSV (Comma-Separated Values) is a flat, tabular format where each row represents one record and columns are separated by a delimiter character — typically a comma. Converting between the two means mapping the hierarchical structure of JSON into the two-dimensional grid that CSV demands. For flat JSON arrays this is straightforward: each object becomes a row, each key becomes a column header. The challenge arises with nested objects, arrays-within-objects, and inconsistent schemas across records — all of which this tool handles transparently.
How Does the Conversion Work?
The converter first parses your JSON string using the browser's built-in `JSON.parse`, catching and reporting any syntax errors immediately. It then normalises the parsed value into an array of plain objects. The union of all keys across all objects is collected in first-seen order to form the header row — this ensures that sparse datasets (where some records have extra keys) produce a complete header without duplicates. If the flatten-nested option is enabled, objects are recursively traversed and each nested key path is joined with a dot to create a flat key. For each record and each header key, the cell value is resolved: null and undefined values are replaced according to the null-handling setting, arrays are stringified, joined, or expanded, and the resulting string is escaped according to the chosen quote strategy before being joined with the delimiter character. The final CSV string is assembled by joining all rows with the chosen line ending (LF or CRLF) and optionally prepending a UTF-8 BOM.
Why Does Proper CSV Formatting Matter?
A naively constructed CSV that simply joins values with commas will break as soon as any value contains a comma, a double-quote, or a newline. RFC 4180 — the de facto CSV standard — specifies that such values must be enclosed in double-quotes, and any literal double-quote within a value must be doubled. Ignoring this causes downstream tools like Excel, Google Sheets, and database importers to misparse the file, shifting data into wrong columns or truncating records. Choosing the correct delimiter is equally important: European locales often use semicolons as the decimal separator, so comma-delimited files can confuse spreadsheet software set to a European locale. The BOM prefix, while invisible to users, is critical for Excel on Windows to correctly open UTF-8 files without character encoding prompts or garbled text.
Limitations to Be Aware Of
CSV is inherently flat, so converting deeply nested or highly irregular JSON always involves some information loss or transformation. The dot-notation flattening strategy preserves all scalar values but cannot represent arrays of objects within arrays without losing structure — in such cases the expand-rows or stringify strategies are preferable. Very large JSON files (tens of thousands of rows with many columns) may cause the browser to slow during conversion, though the 300 ms debounce prevents excessive recalculation during typing. The Never-quote strategy can produce malformed CSV if any cell value contains the delimiter character, so use it only when you are certain your data is clean. Finally, the converter infers column order from first-seen key order; if column ordering is critical, review the detected column badges before downloading.
How to Convert JSON to CSV
Paste or Upload Your JSON
Switch between the Paste tab (type or paste JSON directly) and the Upload tab (drag-and-drop or browse for a .json file up to 5 MB). The tool accepts flat arrays of objects, single objects, and wrapped arrays where one property holds the dataset.
Choose Your Delimiter and Options
Select the delimiter that matches your target application — comma for most tools, semicolon for European Excel, tab for TSV. Toggle flatten nested objects if your JSON has nested properties you want spread into separate columns using dot-notation keys like address.city.
Configure Quoting, Nulls, and Arrays
Pick a quote strategy (Minimal follows RFC 4180 and is safe for all parsers), decide how null values should appear in the output, and choose how embedded arrays are handled — stringify for a safe single-cell representation, join for a readable pipe-separated value, or expand to generate one CSV row per array element.
Copy or Download the CSV
Your CSV is generated automatically as you type or change options. Review the live preview table to confirm the output looks correct, then click Copy CSV to send it to the clipboard or Download .csv to save the file. Enable the BOM prefix option before downloading if you plan to open the file in Excel on Windows.
Frequently Asked Questions
Is my JSON data sent to a server?
No — this tool is entirely client-side. Your JSON is parsed and converted using JavaScript running inside your browser tab. Nothing is transmitted over the network. This makes the tool safe to use with confidential data such as customer records, financial data, or internal business information. The privacy notice in the input panel confirms this. Because there is no server round-trip, conversion is also instantaneous regardless of your internet connection speed.
What JSON shapes does the converter support?
The converter handles three common shapes. First, a flat array of objects — `[{...}, {...}]` — where each object becomes a CSV row; this is the most common case. Second, a single object — `{...}` — which is treated as a one-row array automatically. Third, a wrapped object where one of the top-level properties is an array — `{ "data": [{...}, {...}] }` — in which case the tool detects and extracts the array. Deeply irregular or recursive JSON structures are not fully supported; in those cases, pre-processing the JSON to normalise it into a flat array first will give the best results.
How does nested object flattening work?
When the Flatten nested objects option is enabled, any property whose value is itself an object is expanded into separate columns using dot-notation keys. For example, `{ "address": { "city": "London", "postcode": "EC1A" } }` becomes two columns: `address.city` and `address.postcode`. The flattening is recursive, so three or more levels of nesting are also handled — `a.b.c` for a three-level path. Arrays within objects are not expanded by the flattening step; they follow whichever Array Values strategy you have selected separately.
Why do I need the BOM prefix for Excel?
Microsoft Excel on Windows uses a heuristic to detect the encoding of CSV files, and it often defaults to a legacy encoding such as Windows-1252 when opening a file by double-clicking. When your CSV contains non-ASCII characters — accented letters like é or ü, East Asian characters, currency symbols like € or ¥ — Excel misinterprets the UTF-8 bytes and displays garbled text. Prepending the UTF-8 Byte Order Mark (`\uFEFF`) signals to Excel that the file is definitely UTF-8 encoded, causing it to open correctly. The BOM is invisible in all other tools that handle UTF-8 properly, so it is safe to include by default if Excel compatibility is important.
What does the quote strategy setting do?
The quote strategy controls when cell values are wrapped in double-quote characters. Minimal (the default, following RFC 4180) only quotes a value when it contains the delimiter character, a double-quote, or a newline — this produces the most compact and universally compatible output. Always quote wraps every single cell in double quotes regardless of content, which some strict parsers require. Never quote outputs raw values without any quoting — this produces the shortest file but will break any downstream parser if a cell value contains the delimiter or a newline. Literal double-quotes within values are always doubled (`""`) in Minimal and Always modes.
How are arrays within JSON objects handled?
JSON objects often contain array-valued properties — for example a tags field holding `["sale", "featured"]`. The converter offers three strategies. Stringify places the raw JSON representation of the array into a single cell — e.g. `["sale","featured"]` — which is lossless but requires parsing in the target tool. Join concatenates the array elements with a pipe character — e.g. `sale|featured` — which is more readable in a spreadsheet but loses the distinction between a pipe in a value and the separator. Expand to rows generates one CSV row per array element, repeating all other fields — useful when each array item is a first-class record in the target system.