SQL Formatter

Format SQL queries for PostgreSQL, SQL Server, and generic SQL. Minify or beautify with copy and download.

Improve readability of SELECT, INSERT, and DDL statements. Choose a dialect closest to your engine; formatting runs client-side.

Queries are processed locally and are not logged.

Use cases

  • Share readable queries in documentation or pull requests.
  • Compare minified vs formatted SQL in migration scripts.
  • Teach SQL structure with consistent keyword casing.

Frequently asked questions

Which SQL dialects are supported?

Generic SQL, PostgreSQL, and Transact-SQL (SQL Server) modes are available via the sql-formatter library.

Is my database connection used?

No. This is a text formatter only; it does not connect to any database.

Can I minify SQL?

Yes. Minify collapses whitespace for compact logging or generated scripts.

Related tools

Analyze C# data access and code quality patterns in GitHub repos with CodeInspector.

All free developer tools