Free tool

SQL formatter, readable queries.

Paste a SQL query and it is indented and laid out as you type, with SELECT, FROM, JOIN and WHERE on their own lines and keywords in capitals, lower case or left as they are. Pick the dialect, from standard SQL to MySQL, PostgreSQL, SQL Server, SQLite, BigQuery and Snowflake, set the indent and how long a line may get, or squash it all onto one line. Your queries stay in your browser.

Formatted in your browser with sql-formatter (MIT). Your queries are never sent anywhere.

Readable SQL

One clause per line.

01 / Layout

Clauses on their own lines

SELECT lists, JOINs, WHERE conditions and GROUP BY each get their own line and indent.

02 / Dialects

Thirteen to pick from

Each knows its own keywords, quotes and functions, so formatting does not break the query.

03 / Private

Nothing leaves the page

Queries can hold table names and data; they are formatted in your browser.

Questions

Good to know.

How do I format a SQL query?

Paste it. It is formatted as you type; pick your dialect for the best result.

Will formatting change what my query does?

No. Only spaces, line breaks and keyword case change.

Which databases are supported?

Standard SQL, MySQL, MariaDB, PostgreSQL, SQL Server, SQLite, BigQuery, Snowflake, Redshift, Oracle PL/SQL, DuckDB, Spark and Trino.

Why did it fail?

Usually the dialect: some syntax only exists in one database. Pick the right one.

Is my SQL uploaded?

No.