About SQL Formatter
A query built up through several edits, or copied out of a slow-query log, is usually one dense wall of text. Formatting adds the line breaks and indentation that make a join, a subquery or a CASE expression visible at a glance, which is most of what makes a long query reviewable at all.
SQL is not one language. Standard SQL covers the common core, but MySQL, PostgreSQL, SQL Server's T-SQL, Oracle's PL/SQL and the analytical dialects like BigQuery and Snowflake each add syntax the others reject — backtick-quoted identifiers, a QUALIFY clause, T-SQL's square-bracket identifiers. A formatter that only understood standard SQL would either choke on those or format them wrong, so the dialect is a real setting here, not decoration.
Keyword case is a separate, purely stylistic choice — some teams write SELECT in caps to distinguish keywords from identifiers at a glance, others prefer lowercase throughout for consistency with everything else in the codebase. Either is applied uniformly across the whole query.
How to format SQL
Paste your query
One statement, or a whole script — each is formatted separately.
Choose a dialect
Match the database the query actually runs against.
Set keyword case and indent
Uppercase, lowercase or as typed; two spaces, four spaces or a tab.
Copy or download
Take the result to your clipboard or save it as a .sql file.