SQL Formatter & Beautifier
Turn messy, single-line SQL into clean, readable queries — clause-aware line breaks, consistent keyword casing and indentation. Beautify or minify; nothing is ever executed or uploaded.
About the SQL formatter
Bytewrench's SQL formatter takes messy, single-line or hand-written queries and lays them out cleanly — each clause on its own line, columns and conditions indented, and keywords cased consistently. It understands SELECT/FROM/WHERE, every JOIN variant, GROUP BY, ORDER BY, subqueries, CTEs and INSERT/UPDATE/DELETE statements.
Choose uppercase, lowercase or preserved keyword casing and your indent width, then beautify for readability or minify to a single line. It's a formatter, not a database client — nothing is executed and nothing leaves your browser.
Breaks on SELECT, FROM, WHERE, JOINs, GROUP BY and more, indenting columns and conditions.
Force keywords to UPPERCASE, lowercase, or leave them as written.
Pretty-print for review, or collapse to a compact single line.
Queries are formatted in your browser and never run or uploaded.
Frequently asked questions
Does it run or validate my SQL?
No. It only reformats the text. It doesn't connect to a database, execute queries, or check them against a schema, so it's safe to paste production SQL.
Which SQL dialects are supported?
It handles standard SQL keywords and common constructs shared across PostgreSQL, MySQL, SQL Server, SQLite and others. Highly vendor-specific syntax may format approximately.
Can I keep my keywords lowercase?
Yes. Pick the 'preserve' option to leave casing untouched, or choose lowercase to normalise everything.
Is my SQL uploaded anywhere?
No. All formatting happens locally in your browser.