SQLFormatter
FormatterConvertPricingDocsGet Pro
Beautifier · BigQuery

Beautify BigQuery SQL online

Beautify minified, single-line BigQuery SQL into clean, readable, properly indented queries. Turn crushed output from logs, ORMs or dbt into something you can read, diff and review.

1Paste your BigQuery query into the editor.
2Press Format — or ⌘↵.
3Copy clean, highlighted SQL.
Open formatter
before
SELECT s.user_id,STRUCT(count(*)AS n,sum(s.value)AS total)AS agg FROM proj.analytics.sessions s WHERE DATE(s.ts)BETWEEN '2026-01-01' AND '2026-06-30' GROUP BY s.user_id HAVING sum(s.value)>0 ORDER BY agg.total DESC;
BigQuery
SELECT
  s.user_id,
  STRUCT(count(*) AS n, sum(s.value) AS total) AS agg
FROM
  proj.analytics.sessions s
WHERE
  DATE(s.ts) BETWEEN '2026-01-01' AND '2026-06-30'
GROUP BY
  s.user_id
HAVING
  sum(s.value) > 0
ORDER BY
  agg.total DESC;

Why beautify BigQuery?

BigQuery analytics queries get long — nested STRUCTs, ARRAY_AGG, window functions — and dbt or the console often emit them minified. Beautifying spreads the STRUCT fields and clauses across indented lines so the aggregation is legible.

For queries you'll commit into a dbt model, that clean layout matters twice over: it's what your team reviews in the diff and maintains later.

All SQL formatters & beautifiers

Format PostgreSQLBeautify PostgreSQL
Format MySQLBeautify MySQL
Format T-SQLBeautify T-SQL
Format SQLiteBeautify SQLite
Format BigQueryBeautify BigQuery
Format OracleBeautify Oracle
Format SnowflakeBeautify Snowflake
Format RedshiftBeautify Redshift