Developer Tools

JSON to CSV Converter

Convert JSON arrays and objects to CSV format instantly. Live table preview, custom delimiter, nested object flattening, and one-click CSV download. 100% private: no data leaves your browser.

Last updated

Live Table Preview
Download CSV File
Nested Flattening
100% Private
Our networkfavorit5The 5 worth buying.Top fives, comparisons and what reviewers say.See the top 5s
J→C
JSON to CSV Converter
Delimiter
Flatten Nested
JSON Input empty
CSV Output ready
Ready. Paste a JSON array on the left to convert.

How JSON Becomes CSV

Each object in a JSON array becomes one CSV row, and each key becomes a column header. Nested objects turn into columns such as address.city, and arrays are joined into a single cell. Paste your JSON above to get standard CSV you can copy or download for Excel, Google Sheets or a database import. The conversion runs entirely in your browser.

CSV is a flat table, so the converter does three things: it collects every key that appears in any row to build the header (in the order keys are first seen), flattens nested objects into dotted or underscored column names, and quotes any cell that contains the delimiter, a double quote or a line break. A single object converts to a one row CSV.

Worked Example: JSON In, CSV Out

Two records with a nested object, an array, a comma, quotes, a line break, a null and a missing key:

[
  {"id": 1, "name": "Smith, Jane", "address": {"city": "Boston", "zip": "02134"},
   "tags": ["vip", "east"], "note": "Said \"hi\"", "phone": null},
  {"id": 2, "name": "Lee", "address": {"city": "Austin", "zip": "73301"},
   "tags": [], "note": "Line one\nLine two"}
]

Output with the default settings (comma delimiter, dot notation, null as an empty cell):

id,name,address.city,address.zip,tags,note,phone
1,"Smith, Jane",Boston,02134,"vip, east","Said ""hi""",
2,Lee,Austin,73301,,"Line one
Line two",

"Smith, Jane" is quoted because it contains the delimiter, the quotes around hi are doubled, and the note with a line break stays in one quoted cell. The second row has no phone key, so its cell is empty, exactly like the null in row one.

How Each Value Is Written

JSON valueCSV cellNote
"Boston"BostonQuotes only when needed
"Smith, Jane""Smith, Jane"Contains the delimiter
"Said \"hi\"""Said ""hi"""Inner quotes doubled
42, true42, trueWritten as text
null(empty)Or the word null with "Write null as text"
Missing key(empty)Header comes from other rows
{"city": "Boston"}column address.cityOr address_city, or skipped
["vip", "east"]vip, eastOne cell
["Smith, J", "Lee"]"[""Smith, J"",""Lee""]"Items with commas kept as JSON
[{"sku": "A1"}]"[{""sku"":""A1""}]"Objects in arrays kept as JSON
{}(empty)Column kept

Opening the CSV in Excel and Google Sheets

  • Accented letters look garbled: Excel on Windows guesses the encoding. The downloaded file starts with a UTF-8 byte order mark, which fixes this; if you paste the text into a file yourself, save it as "CSV UTF-8".
  • Leading zeros disappear: ZIP codes like 02134 and IDs like 007 are read as numbers. Import with Data, From Text/CSV and set the column type to Text.
  • Long numbers turn into 1.23457E+19: Excel keeps only 15 significant digits, so card numbers and long IDs are changed. Import those columns as Text as well.
  • Columns do not split: in countries that use a decimal comma, Excel expects semicolons. Pick the semicolon delimiter above.
  • Cells that start with =, +, − or @: spreadsheets may treat them as formulas. If the data comes from untrusted users, check those cells before opening the file.

Rows end with a line feed. RFC 4180 describes CR LF line endings, but Excel, Google Sheets, pandas and PostgreSQL's COPY all read either. To tidy or validate the JSON first, use the JSON formatter.

Method and sources. Quoting follows RFC 4180 (Common Format and MIME Type for CSV Files): fields containing the delimiter, double quotes or line breaks are enclosed in double quotes and inner quotes are doubled. JSON parsing uses the browser's JSON.parse (RFC 8259). The example output and the value table were produced by running the page's own conversion code in Node.js. Excel's 15 digit precision limit is documented in Microsoft's Excel specifications and limits.

JSON to CSV Guide

This converter handles two main formats. An array of objects (most common): [{"name":"Alice","age":30},{"name":"Bob","age":25}], each object becomes a row, keys become column headers. A single object: {"name":"Alice","age":30}, converted to a single-row CSV. Deeply nested objects are flattened using dot notation or underscores. Arrays are joined into one cell with a comma and a space, or kept as JSON text when they hold objects or values with commas. Inconsistent keys across rows are handled gracefully: missing values appear as empty cells.

CSV (Comma-Separated Values) is a plain-text tabular format where each row is a line and columns are separated by delimiters (commas, semicolons, tabs). Use CSV when you need to: open data in Excel or Google Sheets, import data into databases or data warehouses, work with business intelligence tools (Tableau, Power BI), share flat tabular data with non-technical users, or process large datasets with pandas or R. Use JSON when data is hierarchical (nested objects), when you need arrays of arrays, or when communicating between web services. JSON handles complex structures; CSV handles flat tables.

CSV is a flat (2D) format: it has rows and columns, but no nesting. When your JSON has nested objects like {"user":{"name":"Alice","city":"NY"}}, this tool flattens them into separate columns. With dot notation, this becomes two columns: user.name and user.city. With underscores: user_name and user_city. The "Skip nested" option omits nested objects entirely and only includes top-level primitive values. Arrays within objects (like {"tags":["a","b","c"]}) are joined into a single cell as a, b, c.

In European countries (Germany, France, Netherlands, Poland, etc.) where commas are used as decimal separators (e.g., 1.234,56 for a number), Microsoft Excel and LibreOffice Calc default to semicolons as the CSV delimiter. If you open a comma-separated CSV in these locales, Excel may not split columns correctly. Use semicolons if your CSV will be opened in European-locale Excel, or if your data contains commas within values (e.g., addresses like "123 Main St, Suite 4"). Use tab as delimiter for TSV files, which are common in bioinformatics and some data pipelines.

Per the RFC 4180 CSV standard: fields containing the delimiter, double quotes, or newlines are wrapped in double quotes. Double quotes within a field are escaped as two double quotes (""). Example: the value He said, "Hello" becomes "He said, ""Hello""" in CSV. The "Quote all fields" option wraps every field in double quotes regardless: useful when importing into strict parsers. Newlines within JSON string values are preserved as literal newlines within a quoted CSV field, which is valid per RFC 4180 but may not render correctly in all editors.

Double-clicking the CSV usually works if your system locale uses commas. For European locales or when columns do not split correctly: in Excel, go to Data → From Text/CSV → select the file → choose the correct delimiter in the import wizard. In Google Sheets: File → Import → Upload the CSV file → Separator type: Comma (or whichever you chose). For Python: import pandas as pd; df = pd.read_csv('file.csv'). For large files (100K+ rows), pandas or DuckDB will outperform Excel. For SQL databases: use COPY table FROM 'file.csv' CSV HEADER; in PostgreSQL.

JSON arrays often have inconsistent keys across rows: one object may have a "phone" field and another may not. This converter collects all unique keys from all rows to build the headers, then fills missing values with empty strings. JSON null values become empty cells by default. Tick "Write null as text" to write the word null instead, which helps when an empty string and a null must stay different. JSON false and 0 are valid values and are preserved. In Excel, empty cells and null cells look identical; in pandas, null appears as NaN.

To convert CSV back to JSON in JavaScript: parse each row with a CSV parser, map rows to objects using the header row as keys. In Python: import csv, json; rows = list(csv.DictReader(open('file.csv'))); print(json.dumps(rows, indent=2)). In Node.js: use the csv-parse package. In the browser: use PapaParse (Papa.parse(csvString, {header: true})). Online tools like this site's JSON Formatter can help validate the resulting JSON. Note that type information is lost in CSV: all values come back as strings, so numbers and booleans need to be re-cast.

Yes, completely. All conversion happens in your browser using JavaScript. Nothing is sent to any server. The tool works offline once the page is loaded: you can disconnect from the internet and it will continue to function. We have no logs, no analytics on your data, and no access to what you paste. This makes it safe to use with sensitive data: API responses with user PII, internal company data, authentication tokens in JSON responses. The only data that leaves your device is the AdSense ad request, which has no knowledge of what you paste into the tool.

This tool processes JSON entirely in your browser's JavaScript engine. It comfortably handles JSON files up to several megabytes (tens of thousands of rows). For very large files (10MB+), the conversion will complete but the table preview may scroll slowly: use the Text view for better performance. For files exceeding 50MB, consider using command-line tools: jq -r '(.[0] | keys_unsorted) as $keys | $keys, (.[] | [.[$keys[]]] | @csv)' data.json (jq) or Python pandas: pd.read_json('data.json').to_csv('out.csv', index=False). These handle files with millions of rows efficiently.

Excel on Windows opens CSV files in the local legacy encoding unless the file starts with a UTF-8 byte order mark, so é is shown as é. The Download CSV button adds that mark, which fixes it. If you copy the text instead, save the file as "CSV UTF-8" or import it with Data, From Text/CSV and choose UTF-8.

CSV has no nesting, so an array stays in one cell. Simple arrays are joined with a comma and a space (["a","b"] becomes a, b). Arrays that contain objects, or items that contain commas, are written as JSON text so nothing is lost. To give each array item its own row, reshape the data first, for example with jq or pandas json_normalize.