SQL Formatter

Paste a query to turn it into clean, readable SQL. Pick your database dialect and how keywords should look.

Input
Formatted SQL

    
Ready

Questions

Is my query sent to a server?

No. Formatting runs in your browser, so table names and data in your queries stay on your device.

Why choose a dialect?

Databases differ in syntax. For example, PostgreSQL has :: casts, SQL Server uses [brackets] and MySQL uses backticks. Picking the right dialect makes sure these are understood.

Does formatting change what the query does?

No. Only whitespace and keyword case change. Strings, identifiers and comments are kept exactly as written.

Can I format several statements at once?

Yes. Separate them with semicolons and each statement is formatted on its own, with a blank line between them.