All tools

SQL formatter

Data

Pretty-print a SQL query for your dialect — PostgreSQL, MySQL, BigQuery, Snowflake, Redshift, Trino, SQLite, or standard SQL. All in your browser.

Dialect
Input
Formatted
SELECT
  u.id,
  u.name,
  count(o.id) AS orders
FROM
  users u
  LEFT JOIN orders o ON o.user_id = u.id
WHERE
  u.created_at > now () - interval 30 DAY
GROUP BY
  u.id,
  u.name
HAVING
  count(o.id) > 5
ORDER BY
  orders DESC
LIMIT
  10

Powered by the sql-formatter library with upper-cased keywords. ClickHouse and other ANSI-style dialects format well under Standard SQL. Runs entirely in your browser.