Tools
Support
WORKSPACE

SQL Formatter

Format, indent and minify SQL queries, with uppercase or lowercase keywords.

WELL / TOOLS

Free for everyone. Sustained by those who can contribute.

No ads and no limits. A voluntary contribution helps with hosting and new tools. Support is optional and unlocks no perks.

The SQL formatter makes long queries readable: each clause (SELECT, FROM, JOIN, WHERE, GROUP BY) starts on its own line, columns go one per line and subqueries are indented. It can also minify SQL into one line. Strings and comments are preserved and nothing is sent to a server.

How to use

  1. Paste your SQL query.
  2. Choose keyword case and indentation.
  3. Click Format SQL or Minify and copy the result.

Frequently asked questions

Which databases does it support?

The common SQL of MySQL, MariaDB, PostgreSQL, SQL Server, Oracle and SQLite, including brackets, backticks and double-quoted names.

Does it fix errors in the query?

No. It only rearranges the text. A syntax error stays an error.

Can I format several statements at once?

Yes. Separate them with semicolons; each one is formatted on its own.

Related tools