How to use the SQL Formatter
- Paste your SQL query.
- Choose the dialect and keyword case.
- Copy the formatted query.
What does this tool do?
Each clause (SELECT, FROM, JOIN, WHERE, GROUP BY…) starts on its own line, with columns and conditions indented underneath. Choosing the right dialect helps with database-specific syntax.
Why use it?
- Review queries in pull requests.
- Debug long generated queries.
- Consistent style across a team.
Example
select id,name from users where active=1 order by name becomes
SELECT
id,
name
FROM
users
WHERE
active = 1
ORDER BY
namePrivacy
Everything you type is processed in your browser. Nothing you enter is sent to our servers or stored by us. There's no account to create and nothing to install.
Last reviewed by the M2Toolkit team.