SQL Formatter
Turn long one-line SQL into readable, indented queries with SELECT, FROM, WHERE and JOIN on their own lines. Supports MySQL, PostgreSQL, Oracle PL/SQL, SQL Server T-SQL, BigQuery and more.
Recent
Nothing yet. Things you use will show up here so you can reuse them in one click.
How to use it
Paste a query on the left and get the formatted version on the right instantly. Pick your database so dialect-specific syntax is handled correctly.
Minify does the opposite: it removes line breaks and comments so the query fits on one line, useful for logs or code strings.
Keyword case
Upper-case keywords like SELECT and FROM stand out from table and column names. You can also choose lower case or keep the original.
FAQ
Is my query sent anywhere?+
No. Formatting happens in your browser and the query is never executed, so it's safe for production SQL.
Why do I get a parse error?+
The selected dialect may not support some syntax. Switch to your database's dialect and check that quotes and brackets are balanced.