Input SQL
Formatted SQL
About SQL Formatter
SQL Formatter makes database query strings readable. It highlights keywords, structures joins and CTEs, and supports major dialects such as PostgreSQL, MySQL, SQLite, and standard SQL. Perfect for database administrators and software developers.
How to Use SQL Formatter
- Paste your raw, unformatted SQL query into the editor.
- Select your SQL dialect (PostgreSQL, MySQL, SQLite, standard, etc.) and indent preferences.
- Click "Format" to restructure, capitalize keywords, and align the statements.
- Copy the formatted query for your codebase or database tool.
Frequently Asked Questions
Which SQL dialects are supported?
It supports PostgreSQL, MySQL, MariaDB, SQLite, Oracle, PL/SQL, SQL Server (TSQL), Redshift, and standard ANSI SQL.
Why should I format SQL queries?
Formatted SQL is much easier to review, debug, and optimize. It helps engineers quickly understand complex joins, subqueries, and execution logic during code reviews.
Is my SQL query secure on this site?
Yes, formatting is calculated locally. Your SQL queries and database schemas are never uploaded to any remote server.