All toolsSQL Formatter & Minifier

Developer tool

SQL Formatter & Minifier

Format or minify SQL with dialect, keyword-case, and indentation controls.

Standard SQL
7 lines298 characters⌘/Ctrl + Enter to format
Formatted output
0 lines0 characters
Choose Format SQL or use ⌘/Ctrl + Enter.

About this tool

Make SQL easier to read and review

Consistent indentation and keyword casing make joins, conditions, subqueries, and grouping easier to scan. Dialect selection helps the formatter recognize database-specific syntax.

Minification removes comments and unnecessary whitespace while preserving quoted strings and identifiers. Formatting checks syntax structure but does not connect to a database or execute the query.

How it works

Format SQL in three steps

  1. 1Paste a query

    Enter SQL in the left editor or load the realistic sample.

  2. 2Choose formatting

    Select a dialect, keyword case, indentation, and format or minify.

  3. 3Copy the output

    Review the transformed query and copy it for your editor or database client.

Common questions

SQL Formatter FAQ

Which SQL dialects are supported?

Standard SQL, PostgreSQL, MySQL, SQLite, SQL Server, Oracle PL/SQL, BigQuery, and Snowflake are available.

Does formatting execute my query?

No. It only transforms the text and never connects to a database.

Does the minifier preserve quoted text?

Yes. Whitespace and comments are removed only outside quoted strings and identifiers.