01 / Layout
Clauses on their own lines
SELECT lists, JOINs, WHERE conditions and GROUP BY each get their own line and indent.
Free tool
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
01 / Layout
SELECT lists, JOINs, WHERE conditions and GROUP BY each get their own line and indent.
02 / Dialects
Each knows its own keywords, quotes and functions, so formatting does not break the query.
03 / Private
Queries can hold table names and data; they are formatted in your browser.
Questions
Paste it. It is formatted as you type; pick your dialect for the best result.
No. Only spaces, line breaks and keyword case change.
Standard SQL, MySQL, MariaDB, PostgreSQL, SQL Server, SQLite, BigQuery, Snowflake, Redshift, Oracle PL/SQL, DuckDB, Spark and Trino.
Usually the dialect: some syntax only exists in one database. Pick the right one.
No.