About SQL Formatter

SQL Formatter tidies a SQL statement for reading: it upper-cases keywords and starts each major clause, JOIN, and AND or OR on a new line.

It works by tokenising, not full parsing, so it will not catch syntax errors. It runs in your browser.

How to use it

  1. Paste a SQL statement.
  2. Choose format or minify, and set the indent.
  3. Copy the result.

Common questions

Does it understand every dialect?

It knows a broad set of standard keywords. Dialect-specific syntax is passed through untouched, which is usually fine for formatting.

Will it fix my SQL?

No. It only changes whitespace and keyword case. A broken query stays broken.

Can it keep keywords lower-case?

Yes, there is an option to leave the case as you typed it.

Does anything leave my browser?

No. The tool runs entirely on this page.