Loading tool...
About This Tool
The SQL Formatter transforms messy, compressed, or hard-to-read SQL into clean, well-indented code. Keywords like SELECT, FROM, WHERE, JOIN, and GROUP BY are automatically uppercased and placed on new lines, while sub-expressions are indented to reflect their logical depth.
Supports common SQL dialects including MySQL, PostgreSQL, and standard ANSI SQL. Works with complex queries involving JOINs, subqueries, CTEs, window functions, and multi-level nesting. The formatter respects string literals and comments so they are never accidentally modified.
Paste your raw SQL, hit Format, and instantly get readable code you can share with your team or paste into documentation. All processing runs in the browser — no queries are sent to any server.