SQL Formatter

Format and beautify SQL queries with keyword capitalization and indentation

Processed locally in your browser
SQL Input
Formatted Output

Frequently Asked Questions

What does a SQL formatter do?
It restructures your SQL query with proper indentation, line breaks before major clauses, and uppercased keywords so the logic is easy to follow.
Does this SQL formatter support different SQL dialects?
Yes. The formatter handles standard SQL syntax used across MySQL, PostgreSQL, SQLite, SQL Server, and Oracle, including JOINs, subqueries, and CTEs.
Will formatting change my SQL query results?
No. Formatting only changes whitespace and keyword casing β€” the query logic and results remain identical.
Why should I capitalize SQL keywords?
Capitalizing keywords like SELECT, FROM, and WHERE is a widely adopted convention that visually separates SQL commands from table and column names, improving readability.