← All tools

SQL formatter

Format SQL for a selected dialect while keeping comments and placeholders.

Your input stays in this browser.

Your result

Choose the database dialect first

SQL dialects differ. Select the dialect that matches your query, then choose keyword case and indentation. Formatting rearranges whitespace; it does not run the query or connect to a database.

A worked example

select id,name from octopus_tools where active=true becomes a multiline query with SELECT, FROM and WHERE sections when uppercase keywords are selected.

Before you use the result

A neatly formatted query may still fail on your database. This is not a SQL validator or optimizer. Review vendor-specific syntax and placeholders before replacing the original.

Formatting rules and what is preserved