Format SQL queries with dialect-aware beautification, custom indent, keyword casing, syntax highlighting, and one-click download — all private in your browser.
Also searched as: sql formatter · sql beautifier online · format sql query · sql pretty print · mysql formatter online
Indent
Keyword case
Step-by-step guide to get the most from this tool
Drop a minified or messy query into the input panel.
Select the SQL dialect that matches your database.
Adjust indent, keyword case, semicolons, and line breaks.
Copy formatted SQL or download as a .sql file.
What makes this tool stand out
MySQL, PostgreSQL, SQLite, BigQuery, Spark, T-SQL.
Keywords, functions, strings, numbers, comments.
2 spaces, 4 spaces, or tabs.
UPPERCASE, lowercase, or preserve.
Save formatted SQL as a file.
Client-side only — no server.
More free utilities you might find useful
Quick answers to common questions
Standard SQL, MySQL, PostgreSQL, SQLite, BigQuery, Spark SQL, and Transact-SQL. Pick the dialect that matches your database for best formatting results.
The formatter parses SQL to apply layout rules. Severely invalid syntax may show a format error, but passing formatting does not guarantee the query will run on your database.
Choose UPPERCASE, lowercase, or preserve to control how reserved words like SELECT and WHERE appear in the formatted output.
When enabled, boolean operators start on a new line before the condition, which is a common readability style for complex WHERE clauses.
No. Formatting runs entirely in your browser using the sql-formatter library with no network requests.
Your data is processed entirely in your browser. Nothing is sent to any server.