SQL Formatter
Format SQL queries with uppercase keywords and properly indented clauses.
How It Works
The SQL Formatter identifies SQL keywords such as SELECT, FROM, WHERE, JOIN, ORDER BY, GROUP BY, HAVING, LIMIT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, and more. It converts these keywords to uppercase for visual consistency following the widely-adopted SQL style convention.
Major clauses (FROM, WHERE, JOIN, ORDER BY, etc.) are placed on new lines with proper indentation, making complex queries much easier to read. Sub-clauses like AND and OR are indented one level deeper than their parent clause for clear logical grouping.
The formatter preserves string literals (single-quoted values) and handles parenthesized expressions. All processing happens entirely in your browser.