SQL formatter
Format your SQL queries: keywords and indentation.
- Instant
- Free
- Private (processed locally)
- No sign-up
A readable SQL query reviews in seconds
A query written on a single line quickly becomes unreadable. This formatter reorganises it clause by clause: each SELECT, FROM, WHERE on its line, columns aligned, AND/OR indented. The meaning stays the same, the reading becomes obvious.
-
Paste your query
On one line, badly indented, whatever.
-
Format
Keywords uppercased (optional) and clauses separated.
-
Copy
A clean version, ready for review or docs.
Before / after
| Step | Content |
|---|---|
| Input | select id, name from users where age > 18 order by name |
| SELECT | SELECT id, name |
| FROM / WHERE | FROM users WHERE age > 18 |
| ORDER BY | ORDER BY name |
A lightweight, readability-focused formatter, compatible with keywords common to PostgreSQL, MySQL, SQLite and SQL Server. It does not validate syntax: an exotic keyword is simply left as is.
Frequently asked questions
Why uppercase the keywords?
It is a widespread readability convention: SELECT, FROM, WHERE in uppercase stand out at a glance from lowercase table and column names. SQL is case-insensitive for keywords, so it is purely cosmetic but standard in teams.
Does formatting change the query result?
No: line breaks, indentation and keyword case have no effect on execution. The query returns exactly the same data, just easier to read.
Does this formatter handle every SQL dialect?
It is a lightweight, readability-focused formatter: it recognises common keywords (SELECT, JOIN, GROUP BY…) shared by PostgreSQL, MySQL, SQLite, SQL Server. Functions or syntax very specific to one engine may not be indented ideally.
Can I turn off the uppercasing?
Yes, a checkbox controls it. Uncheck it to only reorganise the layout (line breaks, indentation) while keeping the original case of your keywords.