SwitchPDF
All articles
Developer July 2, 2026 4 min read

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

  1. Get your JSON (API response, exported file, paste from anywhere)
  2. Open SwitchPDF JSON Converter
  3. Paste the JSON
  4. Click "CSV" as the export format
  5. Click Convert → download the CSV
  6. In Google Sheets: File → Import → Upload → drop the CSV in
  7. 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:

  1. Select the date column
  2. Format → Number → Date
  3. 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