SQL Query Formatter & Prettifier

Format, indent, prettify, and minify SQL queries for MySQL, PostgreSQL, SQLite, T-SQL, Oracle, Snowflake, Redshift & BigQuery.

Dialect Presets:
Dialect:
Keywords:
Indent:
RAW UNFORMATTED SQL INPUT (MYSQL)
FORMATTED SQL OUTPUT

What is an SQL Query Formatter & Prettifier?

An SQL Query Formatter is a developer tool that standardizes, indents, and prettifies raw SQL code queries. It formats keywords into UPPERCASE or lowercase, aligns sub-clauses (`SELECT`, `FROM`, `WHERE`, `JOIN`), and cleans up database queries across 8 major database engines: MySQL, PostgreSQL, SQLite, T-SQL, Oracle, Snowflake, Redshift, and BigQuery.

How to Format & Minify SQL Code

  1. Paste Query or Upload File: Enter your unformatted SQL query into the left panel or click "Import .sql File".
  2. Select Database Engine & Options: Choose your database dialect (MySQL, Postgres, T-SQL, Oracle, Snowflake), keyword casing (UPPERCASE/lowercase), and indentation.
  3. Prettify & Export: Click "Prettify SQL" or "Minify SQL" to produce clean code, then copy or download the formatted `.sql` file.

Key Features & Capabilities

Frequently Asked Questions (FAQ)

Which SQL database engines are supported?

We support MySQL, MariaDB, PostgreSQL, SQLite, MS SQL Server (T-SQL), Oracle PL/SQL, Snowflake DB, Amazon Redshift, and Google BigQuery.

Will formatting alter my SQL query logic or string contents?

No! Our smart tokenizer preserves exact text inside single quotes, double quotes, backticks, brackets, and comments while only formatting SQL structure.