Format, beautify, and minify SQL queries. Supports 10+ database dialects including MySQL, PostgreSQL, Oracle, and SQL Server.
Try it Free →MySQL, PostgreSQL, SQLite, Oracle, SQL Server, MariaDB, TransactSQL, Apache Hive, Presto, DB2, and more.
Proper indentation for SELECT, FROM, WHERE, JOIN clauses. Keywords capitalized consistently.
Compress SQL to a single line by removing all whitespace.
All formatting uses sql-formatter library locally. Your queries never leave your browser.
Copy the formatted or minified SQL to your clipboard.
Choose uppercase, lowercase, or preserve the original keyword casing.
Paste or type your SQL query into the input panel.
Select your database dialect from the dropdown: MySQL, PostgreSQL, Oracle, etc.
Choose indentation size, keyword case, and newline behavior.
Click Format to beautify or Minify to compress your SQL.