SQL Formatter

Pretty-print SQL queries: uppercase keywords, one clause per line, indented columns and conditions. This is a formatter, not a validator — it beautifies your SQL but does not check that it runs.

SQL input
Formatted SQL
Formatted SQL will appear here...

This formatter uses keyword-based pretty-printing: it uppercases SQL keywords, puts each major clause (SELECT, FROM, WHERE, JOIN, GROUP BY, ORDER BY...) on its own line, indents column lists and AND/OR conditions, and preserves strings, quoted identifiers, and comments untouched. It works with most dialects — PostgreSQL, MySQL, SQLite, SQL Server — because it never parses the grammar. That also means it is not a validator: syntactically broken SQL will be formatted without complaint. Your queries never leave your browser.

Privacy and cookie preferences

We use strictly necessary cookies to run the site. Analytics, marketing, and AI assistant telemetry are optional and disabled until you choose. You can update consent any time in Cookie Settings.

Some infrastructure cookies, such as load balancer routing cookies, are essential for service delivery. Details: Cookie Policy