Input
Output

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.

Clause-aware layout

Breaks on SELECT, FROM, WHERE, JOINs, GROUP BY and more, indenting columns and conditions.

🔤
Keyword casing

Force keywords to UPPERCASE, lowercase, or leave them as written.

🧱
Beautify or minify

Pretty-print for review, or collapse to a compact single line.

🔒
Local & safe

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.