SQL Formatter & Beautifier
Format, beautify, and analyze SQL queries with syntax highlighting
Formatting Options
▲
Preset
Compact
Standard
Expanded
Custom
SQL Dialect
Standard SQL
PostgreSQL
MySQL
MariaDB
SQL Server (T-SQL)
Oracle (PL/SQL)
SQLite
Keyword Case
UPPER
lower
Preserve
Indentation
2 Spaces
4 Spaces
Tabs
Comma Position
Comma-first
Comma-last
Tabular
Preserve Comments
Format SQL
Minify
Input SQL
Load Example
Upload .sql
Formatted Output
Copy
Download .sql
1
SQL Style Guide & Best Practices
Formatting Conventions
Use UPPERCASE for SQL keywords
Indent nested queries and clauses
One column per line in SELECT
Align JOIN conditions
Add comments for complex logic
Readability Tips
Use meaningful table aliases
Break long queries into CTEs
Add blank lines between sections
Avoid SELECT * in production
Comment non-obvious WHERE clauses
All SQL formatting is done client-side. Your queries never leave your browser.