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

  1. 1Use the live tool above — it runs entirely in your browser and never uploads your data.
  2. 2Paste the sample from the worked example, or use your own input.
  3. 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

Open the full SQL Formatter tool →