SQL Formatter

Format SQL with keyword casing and clause indentation

How to use

Line-break and indent by major clauses such as SELECT / FROM / WHERE / JOIN / GROUP BY / ORDER BY, with string and comment contents preserved intact. When "Uppercase keywords" is on, all keywords are unified to uppercase.

FAQ

Will keywords inside strings be mishandled?

No. The tool first protects single-quoted strings and comments with placeholders, then restores them after formatting, so string and comment contents stay intact.

Which SQL dialects are supported?

Common SQL clauses are recognized; typical MySQL / PostgreSQL / SQLite syntax works. A few dialect-specific constructions may not wrap perfectly.

Does formatting change the query result?

No. It only adjusts whitespace and line breaks and does not alter any semantics.