Skip to main content
DevTools24

SQL Formatter

Format and beautify SQL queries for better readability. Supports multiple SQL dialects.

SQL Formatter - Technical Details

Well-formatted SQL is easier to read, debug, and maintain. This formatter supports Standard SQL, MySQL, PostgreSQL, SQLite, T-SQL (SQL Server), and PL/SQL (Oracle) with options for keyword case and indent style.

Command-line Alternative

# Format SQL using sql-formatter CLI\nnpx sql-formatter --language postgresql query.sql\n\n# Or with npx\necho 'SELECT * FROM users' | npx sql-formatter

Reference

View Official Specification