The quick answer

Paste GoogleSQL into the left box and the formatted statement appears on the right as you type: clause keywords such as SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY, LIMIT and the JOINs go UPPER CASE and each starts its own line, AND/OR conditions are upper-cased in place, and backticked project.dataset.table identifiers pass through untouched. The formatter runs entirely in your browser, and nothing uploads.

What the formatter changes

A console one-liner, unfolded

Input

select t.user_id, count(*) as sessions from `project.dataset.events` t where t.event_date > '2026-10-01' and t.platform = 'web' group by t.user_id, t.platform having count(*) > 5 order by sessions desc limit 25;

Output

SELECT t.user_id, count(*) AS sessions
FROM `project.dataset.events` t
WHERE t.event_date > '2026-10-01' AND t.platform = 'web'
GROUP BY t.user_id, t.platform
HAVING count(*) > 5
ORDER BY sessions desc
LIMIT 25;

That input is 211 characters of one-liner, and the output above is the engine's actual answer to it. The transformation is text reflow, not parsing: whitespace runs collapse to single spaces, a newline lands before each major clause, and a 45-entry keyword dictionary gets upper-cased. Identifiers, function names and literals keep their spelling because none of them is in the dictionary, which is why count(*) and date_sub stay lowercase while GROUP BY does not.

Long SELECT lists, split

Input

select a, b, c, d from t where x = 1 and y = 2;

Output

SELECT a,
  b,
  c,
  d
FROM t
WHERE x = 1 AND y = 2;

A SELECT line carrying more than three comma-separated top-level expressions splits onto its own lines, indented two spaces. Four columns is the trigger; three stay inline, and commas inside parentheses never split anything.

How to use the formatter

  1. Paste over the sample

    The input box opens preloaded with a sample aggregate query so the layout is visible immediately; paste your one-liner from a console history, a scheduled-query definition or a dbt model over it.

  2. Watch the right pane re-render

    The Formatted SQL pane recomputes on every keystroke. There is no run button, nothing waits for a submit, and a typo is visible the moment it appears.

  3. Check the backticked paths

    Paths like `project.dataset.events` survive character-for-character, since the transformation touches keywords and whitespace only. QUALIFY stays exactly as typed, and WINDOW is upper-cased but stays on its current line.

  4. Copy the result

    One Copy button under the output pane puts the formatted statement on your clipboard. There is no download step and no account.

Honest limits, listed

The formatter reflows raw text, and a text reflower has edges a parser would not. These are the ones worth knowing before you paste something load-bearing:

  • Function names stay lowercase: DATE_SUB, STRUCT and GENERATE_UUID are not in the keyword dictionary, so they keep the casing you typed.
  • DESC and ASC stay as typed, which is why ORDER BY sessions desc looks half-finished. Neither word is in the dictionary either; fix the casing yourself if your style guide demands it.
  • Keywords inside strings and comments get re-cased with everything else, and a literal containing the word select can even pick up a line break, because the formatter never parses the SQL it reflows.
  • Whitespace collapses everywhere, including inside string literals: an aligned column layout inside a literal loses its spacing. Keep the original alongside anything you re-embed.
  • GoogleSQL-only clauses do not get their own line: the break list covers SELECT, FROM, WHERE, GROUP BY, ORDER BY, HAVING, LIMIT, the JOINs, VALUES, SET and UNION, so insert manual breaks around QUALIFY where you want them.

Who pastes GoogleSQL into a formatter

Data analysts: the 200-line console query that worked gets pasted into a dashboard definition or a Looker ticket, and readability collapses. One pass restores clause-per-line SQL that reviewers and future-you can parse.

Analytics engineers: dbt model files and scheduled-query definitions accumulate edits from four people and zero formatting conventions. Normalising to upper-case keywords and one clause per line before committing makes the diff about the logic, not the whitespace.

Privacy: your query is a map of your warehouse

A BigQuery query names your projects, your datasets and your table layouts, and it can carry cost-sensitive filtering logic. The formatter runs entirely locally, so the statement you paste never becomes a network request, no server-side log can record it, and closing the tab ends it.

BigQuery SQL Formatter vs the alternatives

AlternativeWhere it winsWhere this tool wins
BigQuery console editorFormats inside Google Cloud Console, with your project connected and results one click awayWorks on any pasted statement from a ticket or a scheduled-query definition, with no console access and no project selected
sqlformat.org and codebeautify suitesInstant multi-dialect formatting on well-known pagesKeeps warehouse-mapping queries, project.dataset.table paths included, client-side instead of pasting them into a third-party page
dbt and SQLFluff in CIRepository-wide style with enforcement and version controlOne query, one paste, no toolchain to configure, when a statement needs readability now

Console integration and repository-wide enforcement are real advantages, and the table keeps them. A formatter page that pretends to be everything is a page you cannot plan around.

Frequently asked questions

Can I use the BigQuery SQL Formatter offline?

Largely, yes. Everything the formatter computes happens in the tab, so a cached copy of the page keeps full functionality without a connection, and nothing here needs fresh external data.

Why is the output still valid GoogleSQL?

Because the transformation only moves whitespace and re-cases keywords, the two things BigQuery's parser ignores. Clause boundaries land before SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY, LIMIT and the JOINs, so the statement's meaning carries over untouched.

Is the BigQuery SQL Formatter free to use?

Yes: no account, no email gate, no usage cap. The whole computation is local JavaScript, which is exactly why it can stay free, since there is no per-use backend to charge for.

What SQL dialects does the formatter support?

This page carries the BigQuery label: the formatter's clause list and 45-entry keyword dictionary cover the statement skeleton GoogleSQL hangs its decorations on, including backtick-quoted project.dataset.table paths. The same in-browser formatter family covers generic SQL, MySQL, PostgreSQL and Snowflake on their own pages, with identical clause-break, casing and indentation behaviour.

Does the formatter rename my tables or columns?

No. The transformation touches keywords and whitespace only; table paths like `project.dataset.events`, column names and aliases pass through character-for-character. BigQuery treats unquoted identifiers as case-insensitive, so upper-cased keywords never change what a statement means.

Will formatting change how my query runs?

No. Line breaks, indentation and keyword casing carry no meaning to BigQuery's parser, so the formatted statement executes exactly as the original. The one real change is whitespace: runs of spaces collapse to one, including inside string literals, and keywords inside literals or comments can get re-cased, so re-check anything you embed in another string.

Sources and further reading

Sources and further reading

We cite primary sources (standards bodies, government agencies, official documentation) wherever they exist so you can verify every number on this page yourself.