SQL Formatter

Paste a one-line query and get indented SQL back. It is meant for reading and editing statements, not for connecting to a database.

How to use it

  1. Paste a SQL statement.
  2. Run Format to indent clauses.
  3. Copy the formatted query into your editor.

Useful for

  • Read a minified query
  • Line up JOIN and WHERE clauses
  • Clean SQL before a code review

Related tools

Questions about SQL Formatter

Which SQL dialects work? +

The formatter is dialect-agnostic and works well with MySQL, PostgreSQL, SQLite, and most ANSI SQL.

Is my query sent anywhere? +

Never. Formatting happens locally in the browser.