Pretty-print · highlight · minify

🗄️ SQL Formatter

Paste messy SQL and get it pretty-printed, with clauses on their own lines and subqueries indented. AND/OR alignment and syntax highlighting come along, or minify it back to one line.


    

Works with MySQL, PostgreSQL and SQL Server flavors. Strings, quoted identifiers and comments (-- and /* */) are preserved untouched. Keyword casing only affects keywords, never your identifiers.