Transform JSON data into clean CSV files. Handles nested objects, arrays, and JSON Lines format.
8 min readThis converter reads your JSON input, identifies the structure, and flattens it into a two-dimensional table that maps directly to CSV rows and columns. The process involves three main steps: parsing the JSON text into a JavaScript object, traversing the data tree to collect all unique keys (including nested paths), and then writing each record as a CSV row with proper escaping.
When you paste or upload JSON data, the parser first tries standard JSON.parse(). If that fails, it checks whether the input follows JSON Lines format, where each line is a standalone JSON object. This dual-mode approach means you can work with API responses, database exports, log files, and streaming data without any preprocessing.
The column mapping step lets you control exactly what ends up in your CSV. Every detected field appears in the mapping panel, where you can toggle visibility, rename headers, and drag columns into your preferred order. This eliminates the need for post-processing in a spreadsheet application.
Not all JSON looks the same. Here are the most common patterns this tool handles:
[{"{"}name":"A"{"}"}, {"{"}name":"B"{"}"}]address.city becomes a column header.Real-world JSON is rarely flat. API responses from services like Stripe, GitHub, and Shopify routinely nest objects three or four levels deep. This converter walks the entire object tree and creates column headers using dot-separated paths. For instance, a structure like {"{"}user: {"{"}profile: {"{"}name: "Jo"{"}"}{"}"}{"}"} produces a column called user.profile.name.
Arrays of primitive values (strings, numbers, booleans) are joined with semicolons into a single cell. This preserves the data while keeping each record on one row. If an array contains objects, those objects are flattened with indexed notation like items.0.name and items.1.name.
This approach follows the same conventions used by tools like MDN's JSON reference and popular Node.js flat-file converters, ensuring the output is predictable and easy to work with downstream.
CSV might seem simple, but the details matter when importing into different applications. The delimiter choice affects compatibility: commas work everywhere, but semicolons are the default in many European locales where commas serve as decimal separators. Tab-separated values (TSV) avoid delimiter conflicts entirely, and pipe-delimited files work well with Unix command-line tools.
The quote character wraps values that contain the delimiter, newlines, or the quote character itself. Double quotes are the RFC 4180 standard, but single quotes can be useful for specific import targets. Line endings matter too: Windows applications expect CRLF, while Unix and macOS tools prefer LF.
Toggling the header row is useful when you need to append data to an existing CSV or when your downstream process expects raw data without column names.
Developers, analysts, and project managers reach for JSON-to-CSV conversion in a wide range of scenarios:
Nested objects are automatically flattened using dot notation. For example, an object with address.city and address.state becomes separate CSV columns named address.city and address.state.
Yes. The converter auto-detects JSON Lines format where each line contains a separate JSON object. It parses each line independently and merges all objects into a unified CSV output.
Arrays of primitive values are joined with semicolons by default. This keeps them in a single CSV cell while preserving the data.
No. All processing happens entirely in your browser using client-side JavaScript. Your data never leaves your device, making this tool safe for sensitive or proprietary information.
The converter supports comma, semicolon, tab, and pipe delimiters. You can also choose between CRLF and LF line endings, toggle header rows, and set the quote character.
This tool works in all modern browsers including Chrome 80+, Firefox 78+, Safari 14+, and Edge 80+. It relies on standard Web APIs like FileReader, JSON.parse, Blob, and the Clipboard API. No plugins, extensions, or server-side processing required. Mobile browsers on iOS and Android are fully supported, though the drag-and-drop file upload works best on desktop.
This tool processes everything locally in your browser. No data is uploaded, stored, or transmitted to any server. You can verify this by disconnecting from the internet and using the tool offline. Your JSON data stays on your device at all times.
This free json to csv converter helps you get things done quickly and privately in your browser. No signup required, no data collected.
Built by Michael Lip. Runs 100% client-side. No data sent to any server.