SQL Formatter & Beautifier
Paste your SQL query to format and beautify it with proper indentation. Everything happens in your browser — your data stays private.
Formatted SQL will appear here...
About SQL Formatting
SQL formatting makes complex queries readable and maintainable. Properly formatted SQL helps teams collaborate, debug issues faster, and understand query logic at a glance.
This tool supports all major SQL dialects including MySQL, PostgreSQL, SQL Server, and Oracle. It handles SELECT, INSERT, UPDATE, DELETE, CREATE TABLE, ALTER TABLE, JOIN operations, subqueries, CASE statements, UNION, window functions, and CTEs.
Features
- Intelligent indentation for nested subqueries and CASE statements
- Customizable indentation (2 spaces, 4 spaces, or tabs)
- Uppercase or preserve keyword casing
- Minify queries to reduce size for production use
- Query type detection (SELECT, INSERT, UPDATE, DELETE, DDL)
- 100% client-side — your queries never leave your browser