SQL Formatter and Beautifier
Format SQL queries with keyword casing, indentation and aligned clauses. Makes long joins and subqueries readable. Free online SQL beautifier.
Input
Result
The result appears here as you type.
What this tool is for
A query pulled from an application log is one long line with four joins in it. Formatting puts each clause on its own line and indents subqueries, which is usually enough to see the mistake without opening a database client.
How to use it
- Paste the SQL query.
- Choose keyword casing: uppercase keywords are the common convention.
- Copy the formatted query.
Frequently asked questions
Is my query sent anywhere?
No. Formatting is local, which matters because queries in logs often contain real values from production data.