Format and beautify SQL queries for MySQL, PostgreSQL, ClickHouse & more
Paste your SQL query
Enter or paste the SQL you want to beautify — works with MySQL, PostgreSQL, SQL Server, SQLite, ClickHouse, and Oracle syntax.
View the beautified SQL
See your query instantly formatted with proper indentation, capitalized keywords (SELECT, FROM, WHERE), and aligned JOINs.
Copy the formatted SQL
Click Copy to use the beautified SQL in your database client, code editor, or documentation.
Paste your SQL into the input area and the formatter will beautify your SQL code instantly with proper indentation, keyword capitalization (SELECT, FROM, WHERE), and aligned JOINs. You can also choose between different formatting styles. It works with any SQL dialect including MySQL, PostgreSQL, SQL Server, and ClickHouse.
The SQL formatter supports all major dialects: MySQL, PostgreSQL, SQLite, SQL Server (T-SQL), Oracle, and ClickHouse. It handles dialect-specific syntax like PostgreSQL's ON CONFLICT, MySQL's AUTO_INCREMENT, and ClickHouse functions like toStartOfMonth and uniq(). Keywords are properly capitalized regardless of dialect.
Yes, all SQL formatting happens locally in your browser. Your queries never leave your device - no data is sent to any server. This makes it safe to format SQL containing sensitive table names, column names, credentials, and proprietary business logic.
Yes, you can paste multiple SQL statements separated by semicolons, and the formatter will process them all while maintaining the statement boundaries. This is useful for formatting migration scripts, stored procedures, or batch queries.
The SQL beautifier reformats your queries with proper indentation for subqueries and nested conditions, uppercased SQL keywords (SELECT, FROM, JOIN, WHERE), aligned column lists and JOIN clauses, and consistent spacing around operators. It makes complex queries readable without changing their meaning or execution.