SQL Formatter
Reshape SQL for the selected database dialect, control comments and keyword case, or create compact reviewable output.
Indentation
Keyword Case
Comments
SQL Input
Formatted SQL
Format or minify SQL to view the result.
Your SQL is processed locally in your browser and is not uploaded.
How to use SQL Formatter
- 1
Choose Standard SQL, MySQL, PostgreSQL, SQL Server, SQLite or MariaDB.
- 2
Set indentation, keyword letter case and whether genuine SQL comments should be retained.
- 3
Paste a query, upload a local SQL or text file, or load the sample.
- 4
Click Format for readable layout or Minify for compact SQL.
- 5
Review the result, then copy it or download formatted.sql.
Frequently asked questions
About SQL Formatter
Readable SQL reveals joins, nested conditions, CTEs and CASE branches that are easy to miss in a dense query. The formatter applies rules for six named dialects and lets developers choose indentation, keyword case and comment treatment before producing output.
Minification is token-aware rather than a blind whitespace deletion, and comment handling respects quoted strings and identifiers. Even so, this remains a presentation utility: it neither connects to a schema nor executes statements. Source files and generated SQL stay within the browser.