SQL Formatter

Paste a query — it formats as you type. Puts clauses on their own line, numbers lines, adjusts indent, and can minify back to a single line. Tokenizer-based, no server round-trip.

Input

{{ num }}
Waiting for input… ✓ SQL ({{ dialect }})
Output
Keywords Indent
{{human(origSize)}}{{human(outSize)}} · {{deltaLabel}} · {{outLineCount}} lines
{{ num }}
About this tool

A tokenizer splits the query into keywords, identifiers, strings and punctuation, then a formatter reflows it — one clause per line, consistent indent — or collapses everything back to a single line for minify.

Dialect only affects keyword highlighting and vocabulary (e.g. ILIKE for PostgreSQL); it doesn't validate syntax or connect to a database.

Formatting runs entirely in your browser. Your query is never sent anywhere.