SQL Formatter
Beautify and minify SQL queries instantly — uppercase keywords, indent clauses, and format subqueries.
Frequently Asked Questions
What SQL dialects does this formatter support?
The formatter handles standard SQL syntax shared across MySQL, PostgreSQL, SQLite, SQL Server, and Oracle. It uppercases common keywords and structures clauses with proper indentation regardless of dialect.
Does formatting change the meaning of my query?
No. The formatter only changes whitespace, letter casing of keywords, and line breaks. It never modifies table names, column names, string literals, or query logic.
Is my SQL sent to a server?
No. All formatting happens locally in your browser using JavaScript. Your queries never leave your machine, so it is safe to format queries containing sensitive table or column names.
What does the Minify button do?
Minify collapses your SQL into a single line with minimal whitespace. This is useful when embedding SQL in code strings, logs, or URL parameters where line breaks are unwanted.
Can it handle subqueries?
Yes. The formatter detects parenthesised subqueries and adds an extra level of indentation for readability. Nested subqueries receive progressively deeper indentation.