BigQuery SQL Minifier

Free online BigQuery SQL minifier. Compress Google BigQuery SQL into a single line while preserving nested fields, UNNEST expressions, backtick identifiers, and BigQuery-specific syntax.

⌘↵ to minify
Input SQL
Minified SQL

What is Google BigQuery?

Google BigQuery is a fully managed, serverless cloud data warehouse designed for large-scale analytics. It processes petabytes of data using Google's distributed computing infrastructure, and you are charged per query based on bytes scanned rather than paying for always-on servers.

BigQuery uses a dialect of standard SQL (ANSI:2011) with extensions for nested and repeated fields, ARRAYs, STRUCTs, and built-in machine learning (BigQuery ML). It integrates natively with the Google Cloud ecosystem — including Looker, Dataflow, Pub/Sub, and Google Sheets.

When formatting BigQuery SQL, the BigQuery dialect correctly handles three-part table references (project.dataset.table), UNNEST() expressions, ARRAY_AGG, and BigQuery scripting statements — keeping complex analytical queries readable.

Frequently asked questions

Will BigQuery nested field paths be preserved after minification?

Yes. BigQuery nested field access (e.g. record.subfield) and backtick-quoted project.dataset.table identifiers are preserved exactly. Only surrounding whitespace is removed.

Does BigQuery SQL minification remove comments?

Yes. Both -- single-line comments and /* */ block comments are stripped. BigQuery's # comment syntax is also removed.

Why minify BigQuery SQL?

Minified BigQuery SQL is useful when embedding queries in Looker LookML, Terraform BigQuery job configs, Dataform SQLX files, or when passing queries as API parameters to the BigQuery REST or Jobs API.

Is minified BigQuery SQL still valid?

Yes. The BigQuery SQL parser is whitespace-agnostic. Minified SQL executes identically to the original and incurs the same BigQuery billing scan costs.

Try Sequel

Query your database in plain English.

Connect your database and get instant answers without writing SQL. Free for up to 3 seats — no credit card required.

Get started free