Keywords
Indent
Runs entirely in your browser, nothing is uploaded.
How it works
SQL Formatter: Clause-Aware Indenting and Keyword Case
Paste a messy query for clause-aware indentation and consistent keyword casing. Strings and comments are copied through untouched, or minify to one line.
What this does
- Clause-aware layout, SELECT, FROM, JOIN, WHERE and GROUP BY each open a new line
- Sub-queries and CREATE TABLE column lists indent by nesting depth
- CASE, WHEN, ELSE and END line up together, and BETWEEN … AND is never broken across lines
- Keyword casing and indent width are both switchable: upper, lower or preserve, over two spaces, four spaces or a tab
- Postgres dollar-quoting, MySQL backticks, T-SQL [brackets] and :named binds all survive as opaque atoms
- Minify collapses each statement onto one line and reports the bytes saved
FAQ
Keep going