Queries you can read at a glance
Paste a query from an ORM log, a BI tool or a teammate's message and the formatter puts each clause — SELECT, FROM, JOIN, WHERE, GROUP BY — on its own line, indents column lists, joins and subqueries, and lines up conditions so the logic is easy to follow.
Choose your dialect (standard SQL, MySQL, MariaDB, PostgreSQL, SQLite, SQL Server T-SQL, Oracle PL/SQL, BigQuery, Snowflake or Redshift) so vendor-specific syntax is recognized, and set keywords to UPPERCASE, lowercase or leave them as written.
How to format a SQL query
- 1
Paste the SQL
One query or a whole script.
- 2
Pick the dialect
Match the database you use.
- 3
Choose keyword case and indent
UPPERCASE keywords are the most common style.
- 4
Copy the result
Or download a .sql file.
Key features
10 SQL dialects
From MySQL and Postgres to BigQuery and Snowflake.
Keyword casing
Upper, lower or preserve.
Handles complex queries
CTEs, window functions, CASE and nested subqueries.
Stays private
Queries never leave your browser.
Common uses
- Debugging ORM output: Make generated SQL readable to spot slow joins.
- Code reviews: Consistent formatting makes query changes obvious.
- Documentation: Paste clean queries into wikis and tickets.
Tips and good to know
- Formatting doesn't change what a query does, so it's safe to run the formatted version.
- Formatting JSON returned by a query? Use the JSON Formatter.
