SQL Formatter
Format SQL queries
This free online sql formatter runs in your browser and is part of our Developer Tools collection.
SQL Formatter
Format and beautify SQL queries for better readability.
Supported SQL Keywords:
SELECT, FROM, WHERE, JOIN, INNER, LEFT, RIGHT, OUTER, ON, GROUP BY, ORDER BY, HAVING, LIMIT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, TABLE, INDEX, and more...
How to Use the Online SQL Formatter
Enter messy, unformatted, or single-line SQL queries into the editor.
Select Standard SQL, MySQL, PostgreSQL, Oracle, SQLite, or Microsoft T-SQL, and select 2 or 4 space indentation.
Choose whether SQL keywords (SELECT, FROM, WHERE, JOIN, GROUP BY, ORDER BY) should be UPPERCASE or lowercase.
Click "Format SQL" to reformat clauses onto dedicated indented lines for easy readability and code reviews.
Frequently Asked Questions
Common questions about using this free online sql formatter.
Why is uppercase keyword formatting standard in SQL? ▾
Does this formatter handle complex nested subqueries and CTEs? ▾
Does formatting change the execution plan of my query? ▾
Is my database query sent to a server? ▾
More Developer Tools
Explore related tools in the same category to solve adjacent tasks faster.