PocketPlay
中文

SQL Formatter

Format and beautify SQL for MySQL, PostgreSQL, SQLite, T-SQL, BigQuery and more — or minify it back to one line.

🔒 Runs in your browser — files never leave your deviceFree · No sign-up
Dialect
Keyword case
Indent width
Indent style
Options
Drop a .sql file here
or click to choose — .sql .txt

SQL in

SQL out

How to format SQL

  1. Paste a query — or a whole .sql file — into the left pane, or drop the file onto the box above.
  2. Choose the dialect so that things like backticks, TOP, LIMIT and array syntax are parsed correctly, then set keyword case and indent width.
  3. Press Format and copy or download the result. Minify squeezes the statement back onto one line for a log or a config file.

FAQ

Does my query leave the browser?

No. Formatting runs entirely on this page, so production table names, sample values and credentials in a connection string never reach a server.

Why does the dialect matter?

Each dialect has its own keywords and quoting rules. MySQL uses `backticks`, T-SQL uses [brackets] and TOP n, PostgreSQL has :: casts and $$ bodies, BigQuery allows dotted project names and array literals. Picking the right one keeps those tokens intact instead of breaking them across lines.

Will formatting change what my query does?

No — only whitespace, line breaks and the case of keywords change. String literals, comments, identifiers and values are passed through untouched, so the statement you get back is equivalent to the one you pasted.