SQL Formatter

SELECT, FROM, WHERE, JOIN, GROUP BY and ORDER BY each start a new line.

How SQL Formatter works

Re-indent SQL by putting each major clause on its own line. SELECT, FROM, WHERE, JOIN, GROUP BY and ORDER BY each start a new line. Everything happens inside this page: the tool reads your input, runs the calculation or conversion locally, and hands the result back to you. Nothing is transmitted, because there is no backend to transmit it to.

That design choice is deliberate. Most free tool sites upload your files to a server, process them there, and quietly keep a copy. Toolcin cannot do that — the site is a set of static files. If your connection dropped the moment the page finished loading, every tool would still work.

Clause per line

The formatter puts each major clause on its own line: SELECT, FROM, WHERE, GROUP BY, ORDER BY, HAVING, LIMIT, JOIN and ON. Long generated SQL becomes something a human can read in one pass.

Keywords are recognised case-insensitively, so select, Select and SELECT all trigger a break. The output preserves the case you typed rather than forcing upper case.

What it will not do

It does not parse SQL. A keyword inside a string literal may trigger a line break, and a subquery is indented only one level rather than nested. Function arguments and CASE expressions are left as written.

For a real formatter, use one that builds an AST — this is a readability aid for a pasted query, not a linter.

BeforeAfter
select a from t where b=1three lines
... join u on u.id=t.idJOIN and ON on their own lines
... group by a order by aGROUP BY then ORDER BY

Where formatting pays off

Reviewing a query someone else wrote, putting SQL into a ticket or a migration file, and spotting a missing WHERE clause — which is much easier when the clauses are on separate lines.

Good to know

  • Works offline once loaded, including on flights and in locked-down networks.
  • No file size limit beyond your device's own memory.
  • Free to use, with no account and no usage counter.
  • Results are produced locally, so they are not logged or shared with anyone.

Questions

Is anything uploaded when I use SQL Formatter?

No. The calculation runs in your browser with JavaScript, so the values you enter never leave your device.

What should I check before relying on the result?

SELECT, FROM, WHERE, JOIN, GROUP BY and ORDER BY each start a new line. Treat the output as an estimate and verify anything critical independently.

Does it validate the query?

No, it only lays it out.

Can it minify?

Not on this page; it only formats.

Keep going

More files tools