SQLFormatter
FormatterConvertPricingDocsGet Pro
Beautifier · Redshift

Beautify Redshift SQL online

Beautify minified, single-line Redshift 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 Redshift query into the editor.
2Press Format — or ⌘↵.
3Copy clean, highlighted SQL.
Open formatter
before
SELECT date_trunc('week',s.ts)wk,s.channel,count(distinct s.user_id)users,sum(s.value)rev FROM sessions s WHERE s.ts BETWEEN '2026-01-01' AND '2026-06-30' GROUP BY 1,2 HAVING sum(s.value)>0 ORDER BY wk,rev DESC;
Redshift
SELECT
  date_trunc('week', s.ts) wk,
  s.channel,
  count(DISTINCT s.user_id) users,
  sum(s.value) rev
FROM
  sessions s
WHERE
  s.ts BETWEEN '2026-01-01' AND '2026-06-30'
GROUP BY
  1,
  2
HAVING
  sum(s.value) > 0
ORDER BY
  wk,
  rev DESC;

Why beautify Redshift?

Redshift reporting queries — DATE_TRUNC buckets, COUNT(DISTINCT), positional GROUP BY — get long, and BI tools emit them minified. Beautifying spreads the grouping and aggregates across indented lines so the report's logic is readable.

Once the buckets and aggregates are laid out vertically it's far easier to spot an expensive COUNT(DISTINCT) or a scan that should be filtered earlier — the first move before checking the query plan.

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