๐Ÿ—ƒ๏ธ

SQL Formatter

Format and beautify SQL queries for MySQL, PostgreSQL, SQL Server and more, with keyword case options.

Built and maintained by Abdur Rehman ยท Free, no sign-up

Loading SQL Formatterโ€ฆ
๐Ÿ”’PrivateRuns in your browser โ€” nothing is uploaded.
โšกFastInstant results, no waiting in queues.
๐Ÿ’ธFreeNo sign-up, no watermark, no limits.
๐Ÿ“ฑAnywhereWorks on phone, tablet and desktop.

How to use the SQL Formatter

  1. Paste your SQL query
  2. Choose the dialect and keyword case
  3. 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.

๐Ÿ’ป Keep exploring Developer Tools

See all Developer Tools