How to format SQL
- Paste your query and choose your database dialect.
- Pick keyword case and indentation, then press Format (or Ctrl + Enter).
- Copy the result or download it as a .sql file.
Format or minify?
Formatted SQL puts each clause on its own line, so joins, filters and groupings are easy to review in a pull request. Minified SQL puts the whole query on one line and drops comments, which is handy for logs, config files and code strings.
A consistent style
- Upper-case keywords make the structure stand out from table and column names.
- One column per line makes changes show up clearly in a diff.
- Subqueries are indented, so you can see which filter belongs to which level.
Questions and answers
- Is my SQL sent anywhere?
- No. Formatting runs in your browser, so queries with table names, customer data or credentials never leave your device.
- Which databases are supported?
- Standard SQL, PostgreSQL, MySQL, MariaDB, SQLite, SQL Server (T-SQL), Oracle PL/SQL, BigQuery, Snowflake, Redshift, Spark SQL and DuckDB.
- Why does it show a parse error for a query that runs?
- Pick the matching dialect first: each database has its own syntax, such as square brackets in SQL Server or backticks in MySQL.
- Does formatting change what the query does?
- No. Only whitespace and, if you choose, the case of keywords change. String values are left exactly as they are.
Updated November 14, 2026