Format messy SQL into readable, indented queries for MySQL, PostgreSQL, SQL Server, Oracle, SQLite, BigQuery and more, or minify it. Free, never uploaded.
Runs in your browser. Your files are never uploaded. How it works
The query is formatted in your browser and never sent to a server, so it is safe for queries with table names or data from work.
The SQL formatter turns a query copied from a log, an ORM or a one-line string into readable SQL: one clause per line, columns and conditions indented, joins lined up and keywords in one case. It supports standard SQL, MySQL, MariaDB, PostgreSQL, SQLite, SQL Server, Oracle PL/SQL, BigQuery, Snowflake, Redshift, Spark, Trino and DB2.
A 340-character query on one line became 22 readable lines in PostgreSQL mode.
Minify does the opposite: one line without comments, for pasting into code or a config file.
Frequently asked questions
Does formatting change what the query does?
No. Only spaces, line breaks and keyword case change. Names, strings and comments stay exactly as they were.
Why choose a dialect?
Each database has its own keywords and quoting, such as backticks in MySQL, square brackets in SQL Server or :: casts in PostgreSQL. Choosing the right one avoids errors and formats those parts correctly.
Can I put the commas at the start of the line?
Yes. Choose Commas: At line start. Some teams prefer it because a column can be commented out without touching the line above.
Is my SQL sent anywhere?
No. Formatting runs in your browser, so table names, customer data in WHERE clauses and internal schema stay on your computer.