Skip to main content

SQL Formatter

Everything is processed in your browser. Nothing is uploaded.

About this tool: SQL Formatter

Long SQL written on one line is hard to review. The formatter lays out keywords, joins, conditions and subqueries on separate lines with consistent indentation, and supports 20 dialects including PostgreSQL, MySQL, SQL Server, BigQuery and SQLite.

Common uses

  • Tidying a snippet before pasting it into a pull request or ticket
  • Shrinking CSS or JavaScript for a quick size check
  • Making a one-line SQL query from a log readable

Frequently asked questions

Does formatting change what the query does?
No. Only whitespace and keyword case change, never the meaning.
Why choose a dialect?
Each database has its own keywords and quoting rules. Picking the right one avoids mis-formatting vendor-specific syntax.