๐Ÿ—ƒ๏ธ

SQL Formatter / Beautifier

Paste any SQL query and get it beautifully formatted โ€” proper indentation, uppercase keywords, aligned columns. Browser-only.

Input SQL
Formatted SQL
Advertisement
How to use
  1. Paste your raw or minified SQL query into the input pane on the left.
  2. Pick keyword case, indent size, and whether to indent subqueries.
  3. Click Format SQL and copy the result, or use Minify to collapse the query to one line.
FAQ

The formatter targets ANSI-SQL plus common extensions used by MySQL, PostgreSQL, SQLite, SQL Server, and Snowflake โ€” SELECT/INSERT/UPDATE/DELETE, CTEs, window functions, JOINs, and subqueries. Vendor-specific syntax (procedural blocks, hints) is passed through untouched.

No. The formatter runs entirely in your browser. Queries โ€” including any literal data โ€” never leave your machine.

Line breaks are inserted before major keywords (SELECT, FROM, WHERE, JOIN, GROUP BY, ORDER BY, etc.) and before AND/OR. Short clauses or expressions inside parentheses stay on a single line for readability.