SQL Formatter
Format a messy SQL query into readable, indented lines.
About the SQL Formatter
Paste a long single-line query and get it back with each clause on its own line, joins separated out, conditions indented and keywords in the case you prefer. String literals and quoted identifiers are protected so their contents are never touched.
The minify button does the reverse, collapsing a formatted query back to one line for embedding in code.
Frequently asked questions
Which SQL dialects work?
The formatter is dialect-agnostic for standard clauses, so MySQL, PostgreSQL, SQL Server and SQLite queries all format correctly.
Related tools
All Developer โURL Encoder / Decoder
Percent-encode or decode URLs and query string components.
QR Code Generator
Create a downloadable QR code for a link, text, Wi-Fi, phone number or email.
CSS, JS & HTML Minifier
Strip comments and whitespace to make your code files smaller.
Text Diff Checker
Compare two texts and see exactly what was added, removed or kept.
Cron Expression Generator
Translate a cron schedule into plain English and see its next run times.
Base64 Encoder / Decoder
Encode text to Base64 or decode Base64 back to text, with full Unicode support.