Yuzool

Dev Tools

SQL formatter

Paste a query to make it readable: each clause on its own line, joins and conditions indented, keywords in the case you choose. Pick your database for its own syntax.

Why format SQL

A query on one line is hard to review and harder to debug. Formatted, it shows at a glance which tables are joined on what, which conditions apply and how results are grouped. It also makes diffs of a query easy to read.

Dialects

Standard SQL, PostgreSQL, MySQL, MariaDB, SQLite, SQL Server (T-SQL), Oracle PL/SQL, BigQuery, Snowflake, Redshift, Spark, Db2 and Trino. The dialect matters for quoting (backticks, brackets) and keywords that only exist in one database.

How to use it

  1. Paste the SQL.
  2. Pick the dialect, keyword case and indent.
  3. Copy or download the formatted query.

Questions

Does it change what my query does?

No. Only spaces, line breaks and (if you choose) keyword case change.

Is my query sent anywhere?

No. The open-source sql-formatter library runs in your browser.

Related tools

Open all 35 Dev Tools. Everything runs in your browser; nothing you paste is uploaded.

Settings

History

Snippet