● runs entirely in your browser

SQL Formatter & Beautifier

Paste a SQL query to reformat it β€” keywords uppercased, major clauses each on their own line. A regex-based reformat, not a full SQL parser, so very unusual syntax may not break perfectly. Nothing is ever uploaded.

How it works

Formatting is done with regular expressions, not a real SQL parser: string literals are temporarily swapped out for placeholders so keywords inside quoted text aren't touched, remaining keywords are uppercased longest-first (so β€˜LEFT JOIN’ matches before the bare β€˜JOIN’ inside it), clause keywords get their own line, and AND/OR conditions are broken onto indented lines before the original strings are restored.

FAQ

Will it mess up a string that happens to contain a keyword, like 'SELECT ALL'?
No β€” string literals are protected before any keyword matching happens and only restored at the very end, so text inside quotes always comes back exactly as you typed it.
Can it handle deeply nested subqueries correctly?
It will still uppercase and break up the keywords inside a nested query, but since it isn't a real SQL parser, complex nesting can sometimes produce clause breaks that don't perfectly reflect the query's actual structure.

Free, unlimited, no account. If this saved you a paid tool, a small thanks is appreciated.

Say thanks β€” $3