Skip to content
Back to Blog
how-to-convert

How to Convert JSON to CSV for Excel and Google Sheets

2026-05-17 8 min read

Why JSON and CSV Are Built for Different Jobs

JSON (JavaScript Object Notation) is designed to represent structured, hierarchical data. A single JSON file can contain nested objects, arrays of arrays, and mixed data types — all of which make it ideal for APIs and application configuration. CSV (Comma-Separated Values), by contrast, is a flat, row-and-column format. Every row has the same number of fields, and there is no concept of nesting. That structural difference is exactly why moving data from JSON to CSV requires more than a simple rename. When you export data from a REST API — say, a list of 500 customer records from a CRM — the response almost always comes back as JSON. Each record might look like this: {"id": 1042, "name": "Sara Okonkwo", "email": "sara@example.com", "orders": [{"id": 88, "total": 49.99}]} Excel and Google Sheets cannot open that file directly and produce a usable table. They need flat rows. Converting JSON to CSV bridges that gap, letting analysts, marketers, and operations teams work with API data inside the spreadsheet tools they already know. The conversion is straightforward when the JSON is a simple array of objects, and it gets considerably more complicated when nesting is involved — a limitation worth understanding before you start.

What Happens to Nested JSON During Conversion

This is the part most tutorials skip, and it causes real headaches. When your JSON contains nested objects or arrays, any conversion tool — including CocoConvert — has to make a decision about how to handle them. There are three common strategies: 1. Flatten the nested keys using dot notation. A field like address.city becomes a column header called address.city, and the value drops into that cell. This works well for single-level nesting. 2. Stringify the nested value. The entire nested object or array is serialized back to a JSON string and placed in one cell. This preserves the data but makes it unreadable in a spreadsheet without further processing. 3. Expand arrays into multiple rows. If a customer has three orders, the converter creates three rows — one per order — repeating the parent fields. This is the most spreadsheet-friendly approach but can inflate row counts dramatically. CocoConvert uses flattening with dot notation for nested objects and stringification for nested arrays by default. That means if your JSON has a two-level object like {"shipping": {"method": "express", "days": 2}}, you will get columns named shipping.method and shipping.days. If your JSON has an array under a key, that array lands in a single cell as a string. For deeply nested structures — three or more levels, or arrays of objects — you will likely need to pre-process the JSON manually or with a script before conversion produces a clean CSV. No online converter handles every nesting pattern perfectly, and it is worth testing with a small sample before processing thousands of records.

Converting JSON to CSV with CocoConvert

For straightforward JSON — a flat array of objects or one-level-deep nesting — CocoConvert handles the conversion quickly without requiring any setup. Here is the step-by-step process: 1. Go to /convert/json-to-csv. You will see an upload area and a set of output options. 2. Upload your file. CocoConvert accepts .json files up to 50 MB on the free tier. If your file is larger, you will need to split it first — a Python one-liner like json.dump(data[:5000], open('chunk1.json','w')) works fine for this. 3. Choose your delimiter. The default is a comma, which is correct for standard CSV. If you are working in a locale where Excel expects a semicolon (common in Germany, France, and several other European countries), switch the delimiter before downloading. 4. Select whether to include a header row. Leave this on — Excel and Google Sheets both expect the first row to contain column names. 5. Click Convert. For a 10,000-row file, processing typically takes under 10 seconds. 6. Download the .csv file. One practical note: if your JSON keys contain spaces or special characters — for example, "first name" or "unit$price" — those become column headers verbatim. Excel handles them fine, but formulas referencing those columns will need the column letter rather than a structured table reference. Renaming the keys in your JSON before conversion (or renaming the columns immediately after import) saves time downstream.

Opening the CSV Correctly in Excel

Downloading a CSV is only half the job. How you open it in Excel determines whether the data lands in columns or ends up as one long string per row. The safest method is the import wizard rather than double-clicking the file. In Excel 365 and Excel 2019, go to Data → Get Data → From Text/CSV. Select your file. Excel will show a preview and let you confirm the delimiter — make sure it matches what you set during conversion. If you see all your data crammed into column A, the delimiter is wrong. For dates, watch the format. If your JSON stored dates as ISO 8601 strings (2025-11-03T14:22:00Z), Excel may import them as plain text. After import, select the column, go to Data → Text to Columns, choose Delimited, click Next twice, then set the column data format to Date with the YMD order. That converts the strings to proper Excel date serials that you can sort and filter. For large files — say, 200,000 rows — Excel will import everything, but pivot tables and VLOOKUP operations will be slow. Consider using Power Query (Data → Get & Transform Data → From CSV) instead. Power Query loads data lazily and handles files that would otherwise make Excel sluggish. One limitation: Excel's maximum row count is 1,048,576. If your JSON has more records than that, the CSV will import but rows beyond the limit are silently dropped. Split the source file before converting if you are anywhere near that threshold.

Importing the CSV into Google Sheets

Google Sheets handles CSV imports cleanly in most cases, but there are a few settings worth knowing. The simplest method: open Google Sheets, go to File → Import, upload your CSV, and in the import dialog set Import location to your preference (a new sheet is usually safest), set Separator type to Comma (or Custom if you used a semicolon), and uncheck Convert text to numbers, dates, and formulas if you want raw string values preserved — useful when your data contains things like product codes that look like numbers (e.g., 00847) but should keep their leading zeros. If you leave automatic conversion on, Google Sheets will parse ISO dates into its own date format automatically, which is convenient. It will also turn numeric strings into numbers, which is usually what you want but occasionally causes problems with identifiers. For repeated imports — for example, pulling a fresh JSON export from your analytics platform every Monday — consider using Google Sheets' IMPORTDATA function or a Google Apps Script instead of manual uploads. IMPORTDATA only works with publicly accessible URLs, so it is not always practical, but Apps Script can fetch a JSON endpoint and write rows directly to a sheet, bypassing the CSV step entirely. That said, for one-off conversions or teams without a developer, the manual CSV import via CocoConvert at /convert/json-to-csv takes under two minutes and requires no code. File size limit in Google Sheets is 100 MB per file and 10 million cells per spreadsheet. A 50,000-row, 20-column CSV sits at about 1 million cells — well within limits.

Handling Common Conversion Errors

A few error patterns come up repeatedly when converting JSON to CSV. Inconsistent keys across objects. Valid JSON allows different objects in the same array to have different keys: one record might have a phone field and another might not. Most converters, including CocoConvert, handle this by creating a column for every key that appears anywhere in the dataset and leaving cells empty where the key is absent. That is the correct behavior, but it means a dataset with 30 slightly different record schemas can produce a CSV with 80 columns where most cells are blank. Inspect your JSON for schema consistency before converting. Unicode and special characters. JSON files are UTF-8 by default. If your data contains non-Latin characters — Arabic, Chinese, accented European characters — make sure you open the CSV with UTF-8 encoding in Excel. Go to Data → Get Data → From Text/CSV, and in the preview dialog set File Origin to 65001: Unicode (UTF-8). Skipping this step produces garbled text (mojibake) for any character outside the ASCII range. Very large numbers. JSON supports arbitrary-precision numbers. JavaScript (and therefore many JSON generators) represents large integers like 9007199254740993 accurately in JSON, but both Excel and Google Sheets use 64-bit floating point, which can only represent integers exactly up to 2^53 (9,007,199,254,740,992). Numbers larger than that will be rounded. If your JSON contains large integer IDs — common with database primary keys — store them as strings in the source JSON before converting. Empty arrays and null values. A null in JSON becomes an empty cell in CSV, which is usually fine. An empty array [] becomes either an empty cell or a pair of brackets depending on the converter. CocoConvert renders it as an empty string, which is the most spreadsheet-friendly choice.

When a Converter Is Not the Right Tool

Online converters are the right choice for one-off tasks, quick checks, and files where the structure is already flat or nearly flat. They are not the right choice for every situation. If you are converting JSON to CSV as part of an automated pipeline — nightly ETL jobs, CI/CD data processing, or anything that runs without human involvement — use a scripted solution. Python's pandas library can do this in four lines: read the JSON with pd.read_json(), flatten nested structures with pd.json_normalize(), and write to CSV with .to_csv(). The jq command-line tool is another strong option for Unix environments: jq -r '(.[0] | keys_unsorted) as $keys | $keys, (.[] | [.[$keys[]]] | @csv)' input.json > output.csv handles flat arrays cleanly. If your JSON is deeply nested — three or more levels, or arrays of objects inside objects — no online converter will produce a clean result without pre-processing. You will need to write a flattening function tailored to your specific schema. This is not a limitation unique to CocoConvert; it is a structural problem that requires schema-specific logic. If you are working with JSON Lines format (.jsonl), where each line is a separate JSON object rather than a single array, upload the file as-is to CocoConvert — it handles JSONL correctly. But if your file mixes JSON Lines and regular JSON, you will need to normalize the format first. For everything else — a JSON export from a SaaS tool, an API response you want to analyze in a spreadsheet, a configuration file you need to review in tabular form — head to /convert/json-to-csv, upload the file, and have your CSV in under a minute.

Ready to convert?

Try it now — fast, secure, and private.

Convert Now →