Google BigQuery Standard SQL Formatter
Format Google Cloud BigQuery Standard SQL queries with UNNEST(), STRUCT, ARRAY_AGG, EXCEPT, and backtick table identifiers.
How do I use Google BigQuery Standard SQL Formatter?
Paste your Google Cloud BigQuery Standard SQL query into the left editor (or inspect the pre-loaded GA4 `UNNEST(event_params)` sample).
Verify that the SQL Dialect is pre-selected to 'Google BigQuery' with 2-space indentation.
Inspect the formatted output on the right with properly indented `UNNEST(...)`, `STRUCT(...)`, and backtick table references.
Click 'Copy' to paste the clean query back into the GCP BigQuery Console, Looker Studio, or your `dbt` model.
What features does Google BigQuery Standard SQL Formatter offer?
Pre-configured for Google Cloud BigQuery Standard SQL (`bigquery` dialect)
Preserves backtick-quoted multi-part identifiers (`` `analytics-prod-2026.ga4.events_*` ``)
Cleanly indents nested `UNNEST(event_params)` subqueries for GA4 and Firebase analytics
Supports BigQuery-specific `SELECT * EXCEPT(...) REPLACE(...)`, `SAFE_DIVIDE`, and `QUALIFY` window filtering
Pre-loaded with a real-world Google Analytics 4 (`ga4_obfuscated_sample`) `UNNEST` query
100% Client-Side execution: GCP project IDs and warehouse schemas never leave your browser
Google BigQuery Standard SQL Syntax & Nested Array Formatting
BigQuery stores repeated records as native `ARRAY<STRUCT<...>>` columns rather than normalized join tables, requiring specialized `UNNEST` and `STRUCT` formatting.
| BigQuery Construct | Syntax Pattern | Primary Analytics Use Case | Formatter Behavior |
|---|---|---|---|
| Backtick Table IDs | `project.dataset.events_*` | Wildcard date-sharded tables | Preserves hyphens & dots inside backticks |
| UNNEST() Flattening | (SELECT value.string_value FROM UNNEST(event_params)) | GA4 & Firebase event extraction | Indents correlated scalar subqueries |
| Column Projection | SELECT * EXCEPT(ssn, ip_address) | PII removal in analytical views | Keeps EXCEPT/REPLACE inline with SELECT |
| Window QUALIFY | QUALIFY ROW_NUMBER() OVER (...) = 1 | Deduplicating streaming inserts | Aligns QUALIFY as a top-level clause |
How is Google BigQuery Standard SQL Formatter used in real-world workflows?
Untangling Complex GA4 `event_params` & `user_properties` Queries
Google Analytics 4 exports deeply nested `UNNEST(event_params)` subqueries—format 200-line GA4 funnel queries into readable, indented blocks.
Formatting BigQuery `ARRAY_AGG` and `STRUCT` Models
Clean up nested `ARRAY_AGG(STRUCT(...))` warehouse transformations before committing `.sql` models to your dbt repository.
Auditing Queries to Prevent Full-Table Scan Cost Spikes
Format ad-hoc analyst queries to quickly verify that `_TABLE_SUFFIX` or partition filters are present and `SELECT *` is replaced with explicit columns.
Frequently Asked Questions about Google BigQuery Standard SQL Formatter
Why does BigQuery use backticks (`` ` ``) around table names?
Google Cloud Project IDs frequently contain hyphens (e.g., `my-company-prod.analytics.events`). Without backticks, standard SQL parsers interpret the hyphen as a minus subtraction operator. Our BigQuery formatter preserves backtick-quoted identifiers intact.
Does this formatter support BigQuery `QUALIFY` and `SELECT * EXCEPT()`?
Yes! The `bigquery` dialect engine recognizes Google Standard SQL extensions including `QUALIFY`, `EXCEPT()`, `REPLACE()`, `SAFE_CAST()`, and `STRUCT<...>()`.
How do I reduce BigQuery slot usage and query costs when writing SQL?
Never run `SELECT *` on a columnar warehouse like BigQuery (which bills by bytes scanned per column). Always project only required columns or use `SELECT * EXCEPT(heavy_payload)` and filter on partitioned date columns.
Are my GCP Project IDs or BigQuery datasets uploaded anywhere?
No. Everything runs 100% locally in your browser using client-side JavaScript.
Explore Related SQL Tools
Snowflake SQL Formatter
Format Snowflake Data Cloud SQL queries including LATERAL FLATTEN, VARIANT semi-structured paths (v:attr::string), and QUALIFY clauses.
PostgreSQL Query Formatter
Format and beautify PostgreSQL queries including WITH CTEs, JSONB operators (->>, @>), :: type casts, and window functions.
Oracle PL/SQL Formatter
Indent and beautify Oracle PL/SQL stored procedures, DECLARE...BEGIN...EXCEPTION...END blocks, packages, and %TYPE declarations.
SQL Formatter
Format and beautify SQL queries with support for multiple dialects including PostgreSQL, MySQL, SQLite, and more.
JSON Formatter
Format, validate, and minify JSON data instantly. Detect syntax errors with precise line and column information.
Mock Data Generator
Generate realistic fake data for testing: JSON, CSV, SQL, XML with 50+ field types — names, emails, UUIDs, dates, addresses. Runs 100% in your browser via Web Worker.