DEVELOPER TOOLS

SQL Formatter & Beautifier

Reformat common SQL statements in your browser. Choose the closest dialect and style options; your SQL stays on this device and is not sent to a server.

Up to 200,000 characters. Formatting runs locally in this browser.

Output is not executed or checked against a database.

Enter SQL, then choose Format SQL or Minify SQL.

About SQL formatting

Choose the dialect that most closely matches your query. The Standard SQL option covers a shared subset; it does not detect a dialect. This formatter also offers PostgreSQL, MySQL, MariaDB, SQLite, SQL Server Transact-SQL, Oracle PL/SQL, BigQuery, Snowflake, Redshift, DuckDB, ClickHouse, DB2, Hive, Spark SQL, Trino/Presto, TiDB, N1QL, and SingleStoreDB dialect modes.

Format SQL lays out clauses and nested expressions, applies the selected keyword case and indentation, and can add a blank line between separate statements. Minify SQL collapses formatting whitespace while preserving quoted text and comments; line breaks that end -- comments remain. Both actions retain statement semicolons. If the parser rejects a dialect feature, select a closer dialect or review the input and error message.

This tool formats whitespace; it is not a complete SQL validator, query executor, or database connection. Dialect features and templating syntax vary, and some constructs such as stored procedures or custom statement delimiters may not be supported. Review formatted SQL and test it in the intended database before use.