Tools App by

How to format SQL without changing the query

Format a SQL statement with the major clauses on their own lines and keywords in upper case, or minify it back to one line.

How it works

The formatter finds the major keywords and inserts line breaks before them, collapses runs of whitespace and normalises keyword case. It does not parse expressions, so unusual dialects or keywords inside string literals are left mostly untouched.

  • A readability formatter for common SELECT / INSERT / UPDATE / DELETE statements. It does not parse every dialect.

Why it matters

Reviewing a query is a reading task. When SELECT, FROM, WHERE, JOIN and ORDER BY sit on separate lines, a missing join condition or a filter applied after an aggregate becomes obvious — problems that stay hidden inside a single long line.

A worked example

select id, name from users where active = 1 order by name becomes four lines: SELECT on one, FROM users, WHERE active = 1, ORDER BY name — the same statement, just laid out for reading.

Common mistakes

  • Assuming formatting validates the query against a real schema.
  • Formatting a query with a dialect-specific syntax that changes meaning.
  • Losing comments or string literals during reformatting.

Practical tips

Format before code review, not after; reviewers read structure first. Run EXPLAIN on the formatted version to confirm the rewrite did not change the plan, especially around subqueries and OR conditions.

How to use it

  1. Open the tool. Everything runs in your browser tab.
  2. Paste or type your input, then choose the action you need.
  3. Check the result and copy it with one click.

Open the tool

Common questions

Which SQL dialects are supported?

It formats common SELECT, INSERT, UPDATE and DELETE statements and upper-cases the usual keywords. It is not a full parser for every dialect.

Will formatting change what the query does?

Only whitespace and keyword case change. Always re-run a formatted query against a test database first.

Does it validate SQL?

No. It is a readability formatter, not a linter or a validator.

Is this tool really free?

Yes. There is no account, no paywall and no usage limit. Tools App is funded by aumenso, the studio behind it.

Is anything I enter uploaded?

No. The tool runs in your browser tab; what you enter is never sent to us and never stored.

← All posts