SQL Formatter

Format messy SQL queries with clean indentation and uppercase keywords for MySQL, PostgreSQL, SQL Server and more. Free online tool.

Formatted SQL

How to use SQL Formatter

  1. Paste a query.
  2. Choose keyword case and indentation.
  3. Copy the formatted SQL — or switch to One line for embedding in code.

Privacy

Runs entirely in your browser. Nothing you enter or open here is uploaded.

Questions

Which databases?

MySQL, PostgreSQL, SQLite, SQL Server and standard SQL. Only whitespace and keyword case change, never the query's meaning.

Related tools