Format & Convert

SQL Formatter

Format and minify SQL across common dialects.

Runs in your browser
Ready

About SQL Formatter

The SQL Formatter improves readability for queries across common SQL dialects and can minify statements for compact storage or generated code.

Common uses

  • Reformat a long query copied from logs.
  • Normalize spacing before reviewing a migration.
  • Switch dialect hints when working between PostgreSQL, MySQL, SQL Server, or SQLite examples.

Good to know

Formatting does not execute the query or verify table names. Always test SQL against the intended database before using it in production.

How to format safely

Use formatting for readability, review, and documentation. The tool does not connect to a database, so it cannot check table names, permissions, query plans, or whether a statement is safe to execute.

Working across dialects

Different SQL engines disagree about quoting, functions, limits, and date handling. Choose the closest dialect hint and still test the final query in PostgreSQL, MySQL, SQL Server, SQLite, or the actual engine you use.

Common mistakes

Do not treat a pretty query as an approved query. Formatting can make hidden cross joins, missing filters, or unsafe string interpolation easier to see, but it does not fix them automatically.

Before you rely on the output

  • Use representative samples and validate the result in the target parser or application before replacing production configuration or data files.
  • Privacy mode: inputs are processed locally in your browser and are not intentionally sent to an application server.

Related tools

JSON CSV Converter, JSON Formatter, JSON to TypeScript, XML Formatter

An unhandled error has occurred. Reload x