Format and beautify SQL queries online for MySQL, PostgreSQL, SQL Server, SQLite, Oracle and more. Choose keyword case and indent. Nothing is uploaded.
💡 Would you like a new tool or feature, or did something not work? Tell us at [email protected]
How to format SQL
Paste your query and choose your database.
Pick the keyword case and indent you like.
Click Format: each clause (SELECT, FROM, WHERE, JOIN…) gets its own line and columns go one per line.
Why format SQL?
A long query on one line is hard to review. Formatted, it's easy to see which columns are selected, how tables are joined and which filters apply, to spot mistakes, and to compare versions in code review.
Frequently asked questions
Which databases are supported?
Standard SQL plus the dialects of MySQL, MariaDB, PostgreSQL, SQL Server (T-SQL), SQLite, Oracle PL/SQL, BigQuery, Snowflake and Redshift. Picking your database makes sure its own keywords and syntax are recognized.
Does formatting change what my query does?
No. Only spacing, line breaks and (if you choose) the case of keywords change. Table names, column names, strings and values stay exactly as you wrote them.
Is my query sent to a server?
No. Formatting runs in your browser, so queries containing table names, customer data or credentials never leave your computer.