Queries copied from logs, ORMs or old scripts often arrive on one long line. This tool lays them out so you can read them: one clause per line, nested queries indented, long lists split up. It can also do the reverse and squeeze a query onto as few lines as possible.
Pick the dialect that matches your database, then choose the indentation, whether keywords are upper case, lower case or left alone, whether commas go at the end or the start of each line, and how many blank lines separate queries. If the query cannot be read, you see the line and column where it stopped. Everything runs in your browser.
Paste your query into the Input box, pick the dialect that matches your database and the result appears in the Output box as you type. Choose the indentation, keyword case and comma position, then copy it or download it as a .sql file.
Standard SQL, MySQL, PostgreSQL, SQLite, SQL Server (T-SQL) and BigQuery. The dialect decides which keywords, quote styles and comment styles are understood, so pick the one your query was written for.
It removes comments and extra whitespace so the query sits on as few lines as possible. Text inside strings and quoted names is left exactly as written.
No. Only whitespace, line breaks and the case of keywords change. Table names, column names, strings and values are not touched, and comments are kept when you format.
The formatter reads your query with the rules of one dialect. If it uses syntax from a different database, choose that dialect. The error shows the line and column where reading stopped, and the Go to error button jumps to it.
No. Formatting runs in your browser and your queries never leave your device.