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 and CSV are built for totally different worlds. JSON (JavaScript Object Notation) represents structured, hierarchical data. It handles nested objects, arrays of arrays, and mixed data types with ease, which is why it's the standard for APIs and application configs. CSV (Comma-Separated Values) is the opposite: a simple, flat table. Every row must have the same number of columns. No nesting. This fundamental difference means you can't just rename a .json file to .csv and expect it to work. When you pull data from a REST API, like a list of 500 customer records from a CRM, you'll almost always get it as JSON. A single customer record might look like this: {"id": 1042, "name": "Sara Okonkwo", "email": "sara@example.com", "orders": [{"id": 88, "total": 49.99}]} Excel and Google Sheets can't parse that file into a clean table. They need flat rows. Converting JSON to CSV is the bridge that lets analysts, marketers, and ops teams pull API data into the spreadsheet tools they use every day. The conversion is easy if your JSON is a simple list of objects. It gets much harder once nesting is involved, and that's where most people get stuck.

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—must decide how to flatten it. There are a few ways this can go. One strategy is to flatten nested keys using dot notation. A field like `address.city` becomes a column header, and the value drops right into that cell. This is a great solution for simple, single-level nesting. Another approach is to "stringify" the nested value, where the entire object or array is crammed into a single cell as a JSON string. This preserves all the data, but it's basically unreadable in a spreadsheet without more work. A third, and often the most useful, strategy is to expand arrays into multiple rows. If a customer has three orders, the converter creates three separate rows for that customer, duplicating the parent fields for each order. This makes the data immediately usable in a spreadsheet, but it can also make your file huge. CocoConvert defaults to flattening with dot notation for nested objects and stringifying nested arrays. So, if your JSON has a two-level object like {"shipping": {"method": "express", "days": 2}}, you'll get columns for `shipping.method` and `shipping.days`. But if it has an array, that whole array ends up as a string in one cell. For deeply nested data—three or more levels, or arrays of objects—you'll almost certainly need to pre-process the JSON with a script to get a clean CSV. No online converter can magically handle every nesting pattern. You absolutely should test with a small sample before throwing thousands of records at it.

Converting JSON to CSV with CocoConvert

When you have straightforward JSON—a flat array of objects or simple one-level nesting—using CocoConvert is fast and requires no setup. The process is simple. First, head to /convert/json-to-csv. You’ll see the upload box and output options. Upload your .json file. CocoConvert's free tier handles files up to 50 MB. If your file is bigger, you'll have to split it. A quick Python one-liner like `json.dump(data[:5000], open('chunk1.json','w'))` is perfect for this. Next, choose your delimiter. The comma is standard, but if you're in a region where Excel expects a semicolon (I'm looking at you, Germany and France), you need to switch this before downloading. This little setting trips up so many people. Always keep the "include a header row" option on. Spreadsheets need that first row for column names. After that, just click "Convert." A 10,000-row file usually takes less than 10 seconds. Then you can download your shiny new .csv file. Here’s a pro tip: if your JSON keys have spaces or special characters, like "first name" or "unit$price", they will become your column headers as-is. Excel can handle this, but writing formulas gets annoying because you have to use column letters instead of structured references. It's much cleaner to rename the keys in your JSON before you convert, or just fix the column names in Excel right after you import. This will save you headaches later.

Opening the CSV Correctly in Excel

Downloading a CSV is only half the job. How you open it in Excel makes all the difference between a clean table and a useless mess of data in a single column. Whatever you do, don't just double-click the file. The only reliable method is to use the import wizard. In Excel 365 and Excel 2019, find it under Data → Get Data → From Text/CSV. Select your file, and Excel will show a preview. This is your chance to confirm the delimiter. If it doesn't match what you chose during conversion, all your data will be crammed into column A. Anyone who has wrestled with a CSV import knows this pain all too well. Watch out for date formats. If your JSON used ISO 8601 strings (like `2025-11-03T14:22:00Z`), Excel often imports them as plain text. You can fix this. Select the column, go to Data → Text to Columns, choose Delimited, click Next twice, and then set the column data format to Date (YMD). This converts the text into real date values you can sort and filter properly. For big files, say 200,000 rows, Excel will import it, but it will crawl. Pivot tables and VLOOKUPs will be painfully slow. Use Power Query instead (Data → Get & Transform Data → From CSV). It's much better at handling large datasets without making Excel unusable. And be aware of Excel's hard limit: 1,048,576 rows. If your JSON produces a CSV with more rows than that, Excel will silently drop everything past the limit. If you're getting close to that number, split your source file before you even start the conversion.

Importing the CSV into Google Sheets

Google Sheets is generally better at handling CSV imports than Excel, but a few settings are critical. The process is straightforward: open a sheet, go to File → Import, and upload your CSV. In the dialog that appears, you have a few choices. Always set the "Import location" to a new sheet to avoid overwriting existing data. Set the "Separator type" to Comma (or Custom for a semicolon). Here’s the most important setting: "Convert text to numbers, dates, and formulas." If your data has product codes that look like numbers (e.g., `00847`), you must uncheck this box to keep the leading zeros. Otherwise, Google Sheets will helpfully "fix" your data by turning it into the number 847. If you leave automatic conversion on, Sheets does a decent job parsing ISO dates into its native format. It also converts numeric strings to numbers, which is usually fine but can be a problem for those special identifiers. If you do this often, like pulling a new JSON export every Monday, don't do it manually. Look into using Google Sheets' `IMPORTDATA` function or a Google Apps Script. `IMPORTDATA` is limited to public URLs, making it a non-starter for private data. Apps Script is far more powerful; it can fetch data from a protected JSON endpoint and write it directly to a sheet, skipping the CSV step completely. But for one-off jobs or for teams without a developer on hand, a manual import using a file from CocoConvert at /convert/json-to-csv is the fastest way to get the job done. It takes two minutes and zero code. Google Sheets has its own limits: 100 MB per file and 10 million cells per spreadsheet. A CSV with 50,000 rows and 20 columns is only 1 million cells, so you have plenty of room to work with.

Handling Common Conversion Errors

You're going to run into a few common problems when converting JSON to CSV. Here's what to watch for. Inconsistent keys across objects. JSON is flexible. One object in an array can have a `phone` field while the next one doesn't. Converters like CocoConvert handle this by creating a column for every unique key found in the entire dataset. Where a key is missing for a record, the cell is just left empty. This is the right way to do it, but be warned: a messy source file with 30 slightly different object structures can result in a CSV with 80 columns, most of them empty. Clean up your JSON schema before you convert. Unicode and special characters. JSON files are almost always UTF-8. If your data includes non-Latin characters (like Arabic, Chinese, or accented letters), you must tell Excel to expect them. When you import via Data → Get Data → From Text/CSV, look for the "File Origin" setting in the preview dialog and change it to `65001: Unicode (UTF-8)`. If you forget this, all your special characters will turn into garbled junk (mojibake). Very large numbers. This one is subtle but destructive. JSON can handle enormous numbers with perfect precision. But spreadsheets can't. Both Excel and Google Sheets use 64-bit floating point math, which means they start rounding large integers after 9,007,199,254,740,992 (or 2^53). If your JSON contains a bigger number, like 9007199254740993, it will be silently rounded on import. If you're dealing with large integer IDs from a database, your only safe bet is to store them as strings in the JSON *before* you convert. Empty arrays and null values. A `null` value in JSON correctly becomes an empty cell in a CSV. An empty array `[]` is handled differently by various tools. CocoConvert turns it into an empty string, which is the best choice for spreadsheets and avoids confusion.

When a Converter Is Not the Right Tool

Online converters are perfect for one-off tasks and quick checks, especially when your JSON is already flat. But they aren't the right tool for every job. If your conversion is part of an automated pipeline—a nightly ETL job, data processing in CI/CD, or anything that needs to run without you—you must use a scripted solution. An online tool is just not reliable enough for automation. Python's pandas library is the industry standard here; you can read JSON with `pd.read_json()`, flatten it with `pd.json_normalize()`, and write to CSV with `.to_csv()` in just a few lines. For command-line wizards, `jq` is an incredibly powerful alternative in Unix environments: `jq -r '(.[0] | keys_unsorted) as $keys | $keys, (.[] | [.[$keys[]]] | @csv)' input.json > output.csv` will get the job done for flat arrays. When your JSON is deeply nested (three or more levels deep, or contains arrays of objects), no online converter will give you a clean CSV out of the box. The problem is structural; you need to write a custom script that understands your specific schema to flatten it properly. One other format to know is JSON Lines (.jsonl), where each line is a separate JSON object. CocoConvert handles these files perfectly, so you can upload them as-is. Just make sure your file doesn't mix regular JSON and JSON Lines, or you'll need to clean it up first. For everything else? A JSON export from a SaaS platform, an API response you need in a spreadsheet, a config file you want to review as a table—head straight to /convert/json-to-csv. Upload your file, and you'll have a clean CSV in less than a minute.

Ready to convert?

Try it now — fast, secure, and private.

Convert Now →