Toolhaus

SQL Formatter

Format and beautify SQL queries for MySQL, PostgreSQL and more.

Paste a messy SQL statement and get clean, indented, readable SQL with keywords aligned. Choose your dialect (standard SQL, MySQL, PostgreSQL, SQLite, MariaDB, BigQuery or T-SQL) and optionally uppercase keywords. Everything runs in your browser — queries are never uploaded.

Formatted SQL
—

Formula & methodology

Parses the statement with a dialect-aware tokenizer and re-prints it with consistent indentation and line breaks around clauses.

Worked example

  • select id,name from users where age>18 → SELECT id, name FROM users WHERE age > 18

Frequently asked questions

Which SQL dialects are supported?

Standard SQL, MySQL, PostgreSQL, SQLite, MariaDB, BigQuery and Transact-SQL (SQL Server).

Is my query sent anywhere?

No. Formatting happens entirely in your browser and nothing is uploaded.

Privacy

All processing happens locally in your browser. Your data is never uploaded.

Read the practical guide for this category.

Related tools