Converting JSON to CSV for Google Sheets Import
A JSON-to-CSV conversion is the cleanest way to load API data into Google Sheets. Here's the workflow that handles nested objects.
Google Sheets accepts CSV imports natively. Converting JSON to CSV is the cleanest path from an API response to a working spreadsheet you can pivot, chart, and share.
The 30-second workflow
- Get your JSON (API response, exported file, paste from anywhere)
- Open SwitchPDF JSON Converter
- Paste the JSON
- Click "CSV" as the export format
- Click Convert → download the CSV
- In Google Sheets: File → Import → Upload → drop the CSV in
- Choose "Replace current sheet" or "Insert new sheet"
Done. Your data is in Sheets, ready for analysis.
Nested objects handled automatically
The converter flattens nested JSON using dot notation. If your data looks like:
[
{
"id": 1,
"user": { "name": "Alice", "email": "alice@example.com" },
"metadata": { "source": "web", "timestamp": "2026-01-15" }
}
]
The CSV columns become:
id, user.name, user.email, metadata.source, metadata.timestamp
This is what makes the conversion actually useful for real-world API data — most APIs return nested objects, and a flat structure is what Sheets needs.
Arrays inside objects
Arrays of strings or numbers become comma-separated values within a single cell:
{ "tags": ["urgent", "review", "engineering"] }
Becomes:
tags
urgent, review, engineering
If you need each array element as its own row, restructure the JSON before converting (or post-process in Sheets with SPLIT/TRANSPOSE).
Encoding gotchas
CSV uses RFC 4180 quoting: commas, quotes, and newlines inside values are escaped automatically. So a value like "Hello, world" becomes "\"Hello, world\"" in the CSV — Sheets handles this correctly on import.
If you've ever had CSV imports break on data containing commas or newlines, this is why — older tools sometimes don't escape correctly. SwitchPDF's CSV export uses proper RFC 4180 quoting.
Date formatting
JSON dates come in different formats (ISO 8601, Unix timestamps, custom strings). The CSV preserves them as-is. After import in Sheets, you may need to:
- Select the date column
- Format → Number → Date
- Confirm Sheets parsed them correctly
For Unix timestamps, you need a formula: =A2/86400 + 25569 converts a seconds-since-epoch value to a Sheets date.
When CSV isn't the right format
- Heavily nested data (3+ levels of nesting) — the flattened column count gets unwieldy. Use the JSON Converter's Excel output instead.
- Very large datasets (100K+ rows) — Sheets struggles past a certain point. Consider BigQuery or a database instead.
- Data with mixed types per "row" — JSON allows arbitrary structures; CSV expects consistent columns.
Bottom line
JSON → CSV → Sheets is the cleanest path for API data. Flattening handles nested objects automatically. Quoting handles awkward characters. Import in Sheets takes 10 seconds.
Related articles
Markdown to Word: A Developer's Guide to Sharing Docs With Non-Developers
You write everything in Markdown. Your clients want Word docs. Here's how to bridge the gap cleanly with the right tools and a few formatting tricks.
Convert JSON to Excel: Three Approaches Compared
API response in JSON, stakeholder wants Excel. Three ways to do the conversion — quick online tool, command-line scripting, or building it yourself — with concrete trade-offs.
When You Actually Need to Convert PDF to PDF/A
PDF/A is required by courts and archives but unnecessary for most use cases. Here's how to tell which situation you're in.