Free tool. No sign-up.
SQL Formatter
Turn one-line SQL into readable queries: keywords uppercased, major clauses on their own lines, subqueries indented. Paste a messy query, get clean SQL.
What the tool does
Database tools and logs often hand you SQL as a single unreadable line. This formatter uppercases keywords (SELECT, FROM, WHERE...), puts major clauses on their own lines, indents subqueries and JOIN conditions, and breaks long column lists so you can actually read the logic.
Worked example
select id, name from users where active = 1 order by name; becomes:
SELECT id, name
FROM users
WHERE active = 1
ORDER BY name;
Dialects
Formatting is cosmetic and works for standard SQL across MySQL, PostgreSQL, SQLite, SQL Server and others. It does not validate your query: always test against your database.
Planning estimate only. Results use the list prices shown and may differ from your actual bill. Terms
Frequently asked questions
Which SQL dialects are supported?
The formatting rules are generic and work with standard SQL from MySQL, PostgreSQL, SQLite, SQL Server and Oracle. It formats text; it does not parse dialect-specific syntax.
Does formatting change my query?
No. It only changes whitespace and keyword case. The logic, table names and values are untouched.
Can it minify SQL too?
Not directly. The formatter is built for readability. To minify, you would collapse the formatted output back to one line, which most editors do with a join-lines command.
Is my SQL sent to a server?
No. Formatting happens locally in your browser, so queries with table names or business logic stay private.