Format SQL queries with consistent line breaks and indentation for PostgreSQL, MySQL, SQL Server (T-SQL) or Oracle (PL/SQL). Keywords can be uppercased, lowercased or preserved.
The formatter only rewrites whitespace and, if requested, keyword case: literals, identifiers and comments are kept. The query is never executed or sent to a database.
How to use it
- Paste the SQL or open a .sql file.
- Choose the dialect and style.
- Press Run.
Example
select u.id, u.email, count(o.id) as orders from users u left join orders o on o.user_id = u.id where u.created_at >= '2025-01-01' and u.active = true group by u.id, u.email order by orders desc limit 10; SELECT
u.id,
u.email,
count(o.id) AS orders
FROM
users u
LEFT JOIN orders o ON o.user_id = u.id
WHERE
u.created_at >= '2025-01-01'
AND u.active = TRUE
GROUP BY
u.id,
u.email
ORDER BY
orders DESC
LIMIT
10;
Limitations
- It does not check the query against your schema.
- Highly vendor-specific syntax may not be recognized; try the closest dialect.
- 1 MiB limit (512 KiB on mobile).
FAQ
- Does it change what my query returns?
- It should not: only whitespace, line breaks and optionally keyword case change. Always review the result before using it in production.
- Does it connect to my database?
- No. There is no connection or execution: everything happens in your browser.