>_
SQL

SQL Formatter

Format and beautify SQL queries for MySQL, PostgreSQL, SQLite, SQL Server, BigQuery, Snowflake and more. Choose keyword case and indentation — locally in your browser.

Runs locally — your input never leaves this page.

Keywords

How to use

  1. Paste a SQL query — even a long one-liner copied from logs or an ORM.
  2. Pick your dialect so that dialect-specific syntax is understood.
  3. Choose keyword case (UPPER, lower or preserve) and indentation width. The output updates instantly.

FAQ

Does formatting change what my query does?

No. Only whitespace and, optionally, keyword case change. Identifiers, strings and comments are preserved.

Why does formatting fail on my query?

Usually the wrong dialect is selected (for example backtick identifiers need MySQL) or the query contains template placeholders. Try another dialect, or replace placeholders with literal values.

Report a bug or suggest a feature →