SQL Formatter & Beautifier
What this tool does
Paste raw or minified SQL and the formatter rewrites it with consistent indentation, keyword uppercasing, and one clause per line. SELECT columns indent under the SELECT keyword, JOIN conditions appear on their own line, and AND/OR conditions indent one level. The result is readable and copy-paste ready.
How to use
- Paste your SQL into the left panel. Formatting runs automatically.
- Choose a dialect (Standard, MySQL, PostgreSQL) and indent size (2, 4, or Tab).
- Toggle Uppercase keywords to control keyword casing.
- Click Copy to copy the formatted result.
Frequently Asked Questions
What SQL dialects does this formatter support?
The formatter handles standard SQL, MySQL, and PostgreSQL. The dialect selector adjusts future keyword rules; the core indentation logic works across all three.
Does this tool format stored procedures?
Basic stored procedures format correctly. Complex PL/pgSQL or T-SQL blocks with DECLARE/BEGIN/END may not indent perfectly β the formatter is keyword-driven, not a full parser.
Can I format multiple SQL statements at once?
Yes. Separate statements with semicolons and paste them all at once. Each statement formats independently.
Why are my keywords not uppercased?
Click the Uppercase keywords toggle in the toolbar to turn uppercasing on or off. It is on by default.
Is the SQL sent to a server?
No. Formatting runs entirely in your browser with JavaScript. Your SQL never leaves your device.