BigQuery SQL Formatter
Format Google BigQuery SQL with backtick project.dataset.table names. Choose the BigQuery dialect and beautify analytics queries online.
Part of the free SQL Formatter. Runs in your browser — nothing is uploaded.
BigQuery SQL Formatter
BigQuery queries reference tables as `project.dataset.table` in backticks and are often long analytics reports. Choose the BigQuery dialect so those identifiers are kept whole while the rest of the query is laid out cleanly.
Worked example: Backtick-quoted table path in BigQuery
Input
select user_id, count(*) as sessions, max(event_timestamp) as last_seen from `my-project.analytics.events` where event_date >= '2026-01-01' group by user_id order by sessions desc limit 100;
Formatted BigQuery SQL
SELECT user_id, count(*) AS sessions, max(event_timestamp) AS last_seen FROM `my-project.analytics.events` WHERE event_date >= '2026-01-01' GROUP BY user_id ORDER BY sessions DESC LIMIT 100;
Practical tip
Filter on the partition column, such as event_date, in your WHERE clause. It cuts bytes scanned and therefore query cost.
How to use this SQL Formatter
- 1Use the live tool above — it runs entirely in your browser and never uploads your data.
- 2Paste the sample from the worked example, or use your own input.
- 3Copy the result, then adapt the same steps in your editor, script, or pipeline.
BigQuery SQL Formatter FAQs
Does it keep project.dataset.table paths intact?
Yes. With the BigQuery dialect selected, backtick-quoted paths stay on one piece and are not split.
Does it support standard SQL and legacy SQL?
It targets GoogleSQL (standard SQL), which is what BigQuery uses by default today.
More SQL Formatter pages
- Format SQL Query OnlineFormat SQL queries online with uppercase keywords and clean indentation. Paste a one-line query and get readable SQL instantly. Free and private.
- PostgreSQL Formatter OnlineFormat PostgreSQL queries with dialect support for JSONB operators, casts and Postgres functions. Paste SQL, choose PostgreSQL and beautify.
- MySQL Query FormatterFormat MySQL queries online with backtick identifiers and MySQL functions handled correctly. Paste your query, pick MySQL and beautify it.
- SQL Server (T-SQL) FormatterFormat T-SQL for Microsoft SQL Server. Handles TOP, schema-qualified names and bracket identifiers. Paste your query and beautify it online.
- Beautify SQL JOIN QueriesFormat multi-table SQL JOIN queries so every join and ON condition sits on its own line. Paste your query and read the relationships clearly.
- Format Long SQL SELECT StatementsFormat SELECT statements with dozens of columns. Each column lands on its own line so wide queries are easy to read, edit and review.
- Snowflake SQL FormatterFormat Snowflake SQL with database.schema.table names and Snowflake functions. Pick the Snowflake dialect and beautify queries online.
- Format SQL INSERT StatementsFormat multi-row INSERT INTO statements so each VALUES tuple sits on its own line. Easier to review seed data and migrations.
- SQL CTE FormatterFormat SQL queries that use WITH common table expressions. Each CTE is indented clearly so multi-step queries are easy to follow. Free and private.