ToolBark
Developer

SQL Formatter

Instant SQL beautifier — clean indentation, uppercase keywords

14 lines310 charsKeywords uppercased
About

The SQL Formatter instantly cleans up messy or minified SQL queries by uppercasing all reserved keywords and placing each major clause — SELECT, FROM, WHERE, JOIN, GROUP BY, ORDER BY, and more — on its own line with consistent indentation. Paste any raw SQL and get readable, properly structured code in one click. Works fully in your browser with no data sent to any server.

FAQ
What SQL dialects does this formatter support?+

The formatter is dialect-agnostic and works with standard SQL as well as common extensions used in PostgreSQL, MySQL, SQLite, and SQL Server. It uppercases standard keywords and handles JOIN variants, CTEs (WITH), INSERT, UPDATE, DELETE, and DDL statements like CREATE TABLE.

Does the formatter change my query logic?+

No. The formatter only changes whitespace and keyword casing — it never modifies string literals, quoted identifiers, comments, or the structure of your query. Your SQL will execute identically before and after formatting.

Why are my column aliases or table names being uppercased?+

Only reserved SQL keywords are uppercased. Bare identifiers like column names and table aliases are left as-is. If an identifier happens to match a keyword exactly (e.g. a column named "order"), wrap it in double quotes or backticks to protect it from being treated as a keyword.

Can I format multiple SQL statements at once?+

Yes. Paste multiple semicolon-terminated statements and each one will be formatted with a blank line separating them, making it easy to review a whole migration script or batch of queries.

Related tools