← All Tools

SQL Formatter🔒 100% local

Beautify SQL queries. Privacy-first, no server uploads, no tracking.

Related Tools

Border Radius PreviewBox Shadow GeneratorCode Heatmap

Splits a SQL statement at its clause keywords so SELECT, FROM, WHERE and the rest each begin on a new line, and pushes AND/OR conditions in a WHERE or HAVING block onto indented lines of their own. The statement is flattened to one line first and then re-broken. Nothing leaves the page, which matters when the query carries real table or column names.

How to use it

  1. Paste the statement into the box, or leave the SELECT * FROM users WHERE id=1; example in place.
  2. Press Process; the re-broken statement appears in the Output panel underneath.
  3. Read the line breaks: one clause per line, with AND/OR conditions indented four spaces under WHERE or HAVING.
  4. Press Copy Output to take the result, or Clear to empty both boxes.

Worked example

SELECT * FROM users WHERE id=1;becomesSELECT * FROM users WHERE id=1;

The statement is flattened before formatting, so any original indentation and line breaks are gone.

SELECT id,name FROM users WHERE a=1 AND b=2becomesSELECT id,name FROM users WHERE a=1 AND b=2

The WHERE line keeps the first condition on the WHERE line and indents each following AND or OR by four spaces; the first condition keeps a trailing space.

When to use it

What it does not do