SQL Formatter

Format SQL queries with uppercase keywords, one clause per line and indented column lists.

Runs in your browser. Your input is processed on your device and is not uploaded to our server.

How to use the SQL Formatter

  1. Paste your code or open a file.
  2. Choose the indentation and click Format.
  3. Check the result and the size change, then copy or download it.

Works with common SQL dialects (MySQL, PostgreSQL, SQL Server, SQLite). Keywords are upper-cased, each clause starts on a new line, select lists are indented and conditions joined with AND or OR are placed on their own lines. Strings, quoted identifiers and comments are preserved. The formatter does not check that the query is valid or run it.

Frequently asked questions

Does it run my query?
No. It only changes layout. Nothing is sent to a database.