SQL Formatter
Format and beautify SQL queries online.
Input
Output
How to Use
Paste your SQL query into the editor and choose your SQL dialect (Standard SQL, PostgreSQL, MySQL, etc.). The formatter will add proper indentation, capitalize keywords, and align clauses for readability. You can copy the formatted result with one click.
Common Use Cases
- Making complex JOIN queries readable before code review
- Standardizing SQL style across a team by reformatting queries consistently
- Cleaning up auto-generated SQL from ORM debug logs
- Preparing SQL snippets for documentation or blog posts
Frequently Asked Questions
Which SQL dialects are supported?
The formatter supports Standard SQL, PostgreSQL, MySQL, MariaDB, SQLite, BigQuery, and Transact-SQL (T-SQL). Select the appropriate dialect to get the best results.
Does formatting change the meaning of my query?
No. The formatter only changes whitespace, indentation, and keyword casing. The logical meaning and execution plan of your query remain identical.
Can I format stored procedures or DDL statements?
Yes. The tool handles CREATE TABLE, ALTER, INSERT, UPDATE, DELETE, and most DDL/DML statements in addition to SELECT queries.