Pasted SQL from logs, ORM debug output or someone else's code review is usually a single 800-character line that's impossible to read. This formatter splits the query along its major clause boundaries (FROM, WHERE, GROUP BY, ORDER BY, JOIN), uppercases the keywords, and indents subqueries and CTEs so the structure is visible at a glance.
It's a syntactic reformatter, not a semantic one — identifiers, string literals, and the order of clauses are never modified, so the formatted query is guaranteed to behave identically to the input. Comments (both -- and /* */ styles) are preserved in their original positions.
The formatter targets standard ANSI SQL, which covers the bulk of MySQL, PostgreSQL, SQL Server, Oracle and SQLite syntax. Vendor-specific extensions (PostgreSQL JSON operators, T-SQL TOP, Oracle CONNECT BY) are passed through but not specially indented.
No — only whitespace, line breaks and keyword case are changed. Identifiers, string literals, comments, and the order of clauses are left untouched, so the formatted query produces identical results when executed.
Both -- single-line and /* … */ block comments are preserved in their original positions. The formatter inserts line breaks around them when needed but never moves them across statement boundaries.
Line breaking is keyword-driven, not column-width-driven. Long expressions in a SELECT or WHERE clause stay on one line because breaking them safely requires a full SQL parser, which would be overkill for a formatter.
Explore the full suite of Developer / Data tools and 290+ other free utilities at Chunky Munster.