SQL Formatter
Formatted SQL
How to Use
- Paste or type your SQL query in the input area.
- The formatted output updates in real time.
- Choose keyword casing: UPPER, lower, or preserve original case.
- Adjust indentation (2 or 4 spaces).
- Copy the formatted SQL with the copy button.
SQL Formatting
SQL formatting adds consistent indentation and line breaks to make queries readable. Major clauses (SELECT, FROM, WHERE, JOIN, etc.) start on new lines, and comma-separated items are aligned. This makes complex queries much easier to understand, debug, and review.
Supported Statements
- SELECT queries with JOINs, subqueries, GROUP BY, ORDER BY, HAVING, LIMIT
- INSERT INTO ... VALUES
- UPDATE ... SET ... WHERE
- DELETE FROM ... WHERE
- CREATE TABLE, ALTER TABLE, DROP TABLE
- Comments (-- single line)
Privacy
All formatting happens in your browser. No data is sent to any server.