SQL Formatter

Uppercase SQL keywords and put each clause on its own line. Strings and comments stay as written.

Added 2026-10-24

What it does

SQL Formatter uppercases keywords and puts major clauses such as SELECT, FROM, WHERE, JOIN, and ORDER BY on their own lines. Characters inside quotes and comments stay as written, so the word select inside a string remains lowercase. Vendor-specific syntax is spaced and cased. It is not rewritten into another dialect, and it is not checked for validity. The page does not open a database connection, bind parameters, or run the statement. A word that looks like SQL inside a string is not a keyword. The SQL stays in this tab and is not uploaded. Use it to read a statement, not to prove the statement will execute.

How to use it

  1. Paste a statement. SELECT, FROM, WHERE, JOIN, and the other major clauses each start a line.
  2. Text inside quotes and comments is not changed, so a word like select inside a string stays lowercase.
  3. This lays out keywords. It does not connect to a database or check that the statement is valid.

Common mistakes

  • Strings are not keywords. Words inside quotes or comments keep their original case, even when they look like SQL.
  • Dialect details stay where they are. Vendor-specific syntax is spaced and cased. It is not rewritten into another dialect.

The SQL stays in this tab. It is not uploaded or executed.