SQL Formatter & Minifier
Format and beautify SQL queries, or minify them to one line — 100% in your browser.
About SQL Formatter & Minifier
Paste a SQL query and Beautify reformats it with consistent indentation, keyword casing and one clause per line so it's easy to read and review. Pick your dialect — Standard SQL, MySQL, PostgreSQL, MariaDB, SQLite, T-SQL, PL/SQL or BigQuery — so keywords and syntax are recognised correctly. Minify collapses a query to a single line, stripping comments and extra whitespace for embedding in code or logs.
The formatter understands string literals and quoted identifiers, so commas, semicolons and keywords inside quotes are never touched. Everything runs locally in your browser — your queries are never uploaded.
Beautify a query
select id,name from users where active=true order by name
SELECT id, name FROM users WHERE active = true ORDER BY name
Minify reverses this back to a compact single line.
Frequently asked questions
Which SQL dialects are supported?
Standard SQL, MySQL, PostgreSQL, MariaDB, SQLite, T-SQL (SQL Server), PL/SQL (Oracle) and BigQuery. Choosing the right dialect ensures keywords and operators format correctly.
Will formatting change what my query does?
No. Formatting only changes whitespace, indentation and keyword casing — the query logic is identical. String and quoted-identifier contents are preserved exactly.
What does minifying a query remove?
Comments (-- and /* */) and redundant whitespace, collapsing the statement onto one line. Strings and identifiers are left intact.
Are my queries uploaded anywhere?
No. All formatting happens locally in your browser; nothing is sent to a server.