SQL Formatter
Paste your SQL to format it with proper indentation and keyword alignment. Supports SELECT, INSERT, UPDATE, DELETE, CREATE TABLE, and more.
Indent
Formatted SQL will appear here...About SQL Formatting
SQL formatting improves readability by placing major clauses on their own lines and indenting subexpressions. Well-formatted SQL is easier to debug, review in pull requests, and maintain over time.
Readability
Consistent indentation and keyword alignment make complex queries easy to scan at a glance.
Debugging
When each clause is on its own line, it's simple to isolate and test individual parts of a query.
Code Reviews
Formatted SQL produces cleaner diffs, making pull request reviews faster and more effective.
Supported SQL Statements
| Statement | Keywords | Description |
|---|---|---|
| SELECT | FROM, WHERE, JOIN, ORDER BY, GROUP BY | Query data from one or more tables |
| INSERT | INSERT INTO, VALUES, RETURNING | Add new rows to a table |
| UPDATE | SET, WHERE, RETURNING | Modify existing rows in a table |
| DELETE | DELETE FROM, WHERE, RETURNING | Remove rows from a table |
| CREATE | CREATE TABLE, PRIMARY KEY, REFERENCES | Define new tables and schemas |
| ALTER | ALTER TABLE, ADD, DROP, MODIFY | Modify existing table structure |
Build with Stack0 APIs?
Email, CDN, screenshots, extraction, and more. Start with $5 in free credits.