Frequently Asked Questions

Everything you need to know about the SQL Formatter.

What does this SQL formatter do?

Paste any SQL query and it reformats the query into clean, indented SQL — one clause per line, aligned conditions, and consistently cased keywords — so it's easier to read and review.

Which SQL dialects are supported?

The formatter handles standard ANSI SQL syntax used by MySQL, PostgreSQL, SQLite, SQL Server, and similar databases — SELECT, INSERT, UPDATE, DELETE, CREATE TABLE, joins, subqueries, and common clauses. It formats based on general SQL structure rather than validating dialect-specific syntax.

Can I choose uppercase or lowercase keywords?

Yes. Use the Keywords toggle to format SQL keywords like SELECT, FROM, and WHERE in UPPERCASE or lowercase, while leaving your table and column names untouched.

Can I change the indent size?

Yes. Pick 2 spaces, 4 spaces, or a tab character from the Indent dropdown, and the formatted output updates instantly.

Does it handle subqueries and joins?

Yes. Subqueries in parentheses are indented one level deeper than their parent query, and JOIN ... ON clauses are placed on their own lines so the join condition is easy to spot.

What does the Minify button do?

It collapses the formatted SQL into a single compact line with minimal whitespace — useful when you need to paste a query into a config file, environment variable, or anywhere line breaks aren't convenient. Click it again to switch back to Format mode.

Will it validate or fix syntax errors in my SQL?

No. This is a formatter, not a validator — it reformats whitespace and casing based on SQL structure but does not check whether the query is syntactically correct or would execute successfully against a database.

Does it support comments?

Yes. Both single-line comments (-- comment) and block comments (/* comment */) are preserved in the formatted output.

Is my SQL sent to a server?

No. All formatting happens entirely in your browser using JavaScript. Your queries, schema, and any data inside them are never uploaded or stored anywhere.

Is the SQL formatter free to use?

Completely free, with no sign-up, no downloads, and no limits on how much SQL you can format.

Ready to use it?

Free, no sign-up required.

Open the SQL Formatter