SQL Formatter

Pretty-print messy SQL into clean, readable queries. Choose your dialect and indentation — everything runs on your device.

🔒 100% private — nothing is uploaded

How it works

The formatter re-indents your query, aligns clauses and normalises spacing so long, hand-written SQL becomes easy to scan — without changing what it does.

1

Paste your query

Drop in one statement or a whole script. Comments and string literals are left exactly as written.

2

Pick a dialect

From PostgreSQL and MySQL to BigQuery, T-SQL and Snowflake — the right dialect gives the tidiest result.

3

Copy or download

Grab the clean output with one click, or save it straight to a .sql file.

🔒

Private by design. Formatting happens right here in your browser — your queries are never sent to a server, so we never see them.

Frequently Asked Questions

Does formatting change what my query does?
No. It only re-indents and tidies the spacing so the query is easier to read — the statement itself, your comments and any string values are left exactly as written.
Which SQL dialects are supported?
You can pick from Standard SQL, PostgreSQL, MySQL, MariaDB, SQLite, BigQuery, SQL Server (T-SQL), Oracle, DB2, Redshift, Snowflake, Spark, Hive, Trino/Presto and more. Choosing the right dialect gives the tidiest result.
Can I control the indentation and keyword case?
Yes. Choose 2, 4 or 8 spaces or tabs for indentation, and keep keywords as-is, force them to UPPERCASE, or make them lowercase.
Can I format a whole script at once?
Yes — paste a single statement or a whole script of several statements and they'll all be formatted together. You can then copy the result or download it as a .sql file.
Why did my query fail to format?
The formatter needs the SQL to be parseable for the chosen dialect. If it can't read it, check the query is valid or try switching to the dialect that matches your database.
Is my SQL uploaded to a server?
No. Formatting happens entirely in your browser — your queries are never sent anywhere, so we never see them.