SQL Formatter

Turn long one-line queries into readable SQL: each clause on its own line, select lists and AND/OR conditions indented, sub-queries nested. Strings, quoted names and comments stay untouched.

Ln 1, Col 10 B

Want to keep your input for later? Sign in

How to use it

  1. Paste a query, open a .sql file or click Sample.
  2. Click Beautify; choose indentation and whether keywords should be UPPERCASE.
  3. Use Minify to put a query on one line for code or logs, and Validate to catch unclosed quotes and brackets.

Frequently asked questions

Which SQL dialects are supported?

The formatter works on the shared SQL syntax used by SQL Server (T-SQL), PostgreSQL, MySQL, SQLite and Oracle — SELECT, JOIN, CTEs, sub-queries, INSERT, UPDATE, DELETE and MERGE.

Can formatting change what my query does?

No. Only whitespace and keyword case change; string literals, quoted identifiers and comments are copied exactly. Minify removes comments.

Is it free, and is my data uploaded?

It's free with no sign-up, and it runs entirely in your browser — your input is never sent to our servers.