SQL Formatter
Paste a messy SQL query and get it cleanly indented and capitalised, with support for MySQL, PostgreSQL, SQLite, T-SQL and more. Everything runs in your browser, so your queries are never uploaded.
How to format SQL
- Choose the SQL dialect that matches your database.
- Paste your query into the input box.
- Copy the cleanly formatted SQL from the output box.
About formatting SQL
A SQL formatter re-indents a query and standardises keyword casing and line breaks so its structure — clauses, joins, sub-queries — is easy to scan. Consistent formatting makes long queries reviewable, reduces mistakes, and keeps diffs clean when queries live in version control.
Different databases extend SQL with their own keywords and syntax, so picking the right dialect produces the most accurate result. This formatter runs entirely in your browser, so even queries containing table names or business logic never leave your device.
Frequently asked questions
How do I format SQL?
Pick your dialect, paste the query, and the formatted version appears instantly with consistent indentation and keyword casing. Copy it with one click.
Which dialects are supported?
Standard SQL plus MySQL, PostgreSQL, MariaDB, SQLite, SQL Server (T-SQL), Oracle (PL/SQL) and BigQuery — choose the one that matches your database for the most accurate formatting.
Does it change what my query does?
No. Formatting only adjusts whitespace and casing for readability; the query itself is unchanged.
Is my SQL uploaded?
No. The query is formatted entirely in your browser; nothing is sent to a server.