← Back to Tools

SQL Formatter

Format and beautify SQL queries for better readability

Formatting Options

SQL Input

Formatted Output

Features

  • Multiple dialects: Support for MySQL, PostgreSQL, SQLite, MariaDB
  • Keyword casing: Choose between UPPERCASE or lowercase
  • Smart indentation: Properly indents nested queries and clauses
  • Comment preservation: Maintains SQL comments in output
  • Minification: Remove unnecessary whitespace and comments
  • Real-time formatting: Updates as you type

Supported SQL Statements

  • DML: SELECT, INSERT, UPDATE, DELETE, MERGE
  • DDL: CREATE, ALTER, DROP, TRUNCATE
  • DCL: GRANT, REVOKE
  • TCL: COMMIT, ROLLBACK, SAVEPOINT
  • CTEs: WITH clauses and recursive queries
  • Joins: INNER, LEFT, RIGHT, FULL, CROSS