SQL formatter
Paste a query to get clean, consistently indented SQL that’s easy to read, review and share.
Sealed on this device
Runs in your browser. Nothing is uploaded.
Sealed
Formatted SQL
Your formatted SQL will appear here as you type.
This SQL couldn’t be formatted
How it works
-
Paste your query
Paste one query or a whole script, or open a .sql file. Several statements separated by semicolons are fine.
-
Pick your dialect and style
Choose your database so its specific syntax is understood, then set keyword case, indentation and layout.
-
Copy the clean SQL
The formatted query updates as you type. Copy it or download it as a .sql file.
Frequently asked questions
Are my queries sent to a server?
No. Formatting runs in your browser, so table names, customer data in literals and internal schemas never leave your device.
Why does the dialect matter?
Each database has its own keywords, quoting rules and operators: backticks in MySQL, square brackets in SQL Server, :: casts in PostgreSQL. Picking the right dialect lets the formatter recognise them instead of reporting an error.
Does formatting change what my query does?
No. Only whitespace, line breaks and, if you choose, the case of keywords change. Table names, column names, strings and comments are kept exactly as written.
Does it check that my SQL is correct?
It reads the structure of the query, so unclosed quotes and parentheses are reported with their line and column. It doesn’t connect to a database, so it can’t tell whether a table or column exists.
What is the aligned columns layout?
It lines up the keywords in a fixed-width column on the left, with the rest of each clause aligned next to them. Some teams find long SELECT lists easier to scan that way.