How to use the SQL Formatter
- Paste your SQL query
- Choose the dialect and keyword case
- Copy the formatted SQL
Format SQL in any dialect
Paste a query and click โจ Format to get clean, indented SQL. Choose the dialect โ Standard SQL, MySQL, MariaDB, PostgreSQL, SQL Server (T-SQL), Oracle PL/SQL, SQLite or BigQuery โ the keyword case (UPPERCASE, lowercase or as typed) and 2- or 4-space indents. If the query uses another dialect's syntax, it switches automatically. Click Minify to squeeze it onto one line.
PostgreSQL and Snowflake
Choose PostgreSQL to keep :: casts and $1 parameters intact. For Snowflake, use Standard SQL, which is very close to its syntax.
In your editor
- SQL Server Management Studio has no built-in formatter; paste here, or use a paid add-in such as Redgate SQL Prompt.
- VS Code and Cursor โ install a SQL formatting extension, then press Shift + Alt + F.
- DBeaver โ Ctrl + Shift + F formats the current query.
- Notepad++ and Visual Studio โ use a plugin or extension, or paste here and copy the result back.
๐ Your query stays in your browser โ nothing you paste is uploaded, so it's safe for production SQL.