How to format SQL
- Paste your query, or open a .sql file.
- Choose your database dialect, keyword style, and indent.
- Copy the formatted SQL or download it.
Questions
Are my queries sent anywhere?
No. Formatting runs in your browser, so table names, data, and business logic in your SQL stay private.
Does formatting change what the query does?
No. Only spaces, line breaks, and keyword capitals change. The query runs exactly the same.
Why choose a dialect?
Databases differ in syntax, such as quoting, special operators, and keywords. Picking yours avoids mistakes with things like PostgreSQL casts (::), MySQL backticks, or T-SQL brackets.
Can it format several queries at once?
Yes. Queries separated by semicolons are each formatted, with a blank line between them.
Credits
Built on sql-formatter (MIT). OneTooling is not affiliated with that project.