Skip to content
Created by Iternal Technologies, the AI Strategy ExpertsBy Iternal (opens in a new tab)

Format & Minify

SQL Beautify

SQL

Paste a SQL statement. Clauses are split onto their own lines as you type.

Formatted SQL

About SQL Beautify

SQL Beautify is a clause formatter. It puts each major clause on its own line, indents AND, OR and JOIN by two spaces, and can write recognized keywords in uppercase. It is not a full SQL parser, and it does not check that the statement is valid.

Text inside single-quoted strings, double-quoted identifiers, backtick identifiers, bracketed identifiers and comments is copied unchanged. A doubled quote inside a string stays an escaped quote. Dollar-quoted strings and backslash escapes are not supported.

Formatting runs in your browser. The statement you paste is never uploaded. Swap sends the result to SQL Minify, which collapses the same statement back to one line.

Frequently asked questions

What does SQL beautify change?

It inserts a line break before each major clause, indents AND, OR and JOIN by two extra spaces, and, when Uppercase keywords is on, writes recognized keywords in uppercase. Spaces just inside parentheses are removed. Text inside strings, quoted identifiers and comments is not changed.

Which keywords are recognized?

SELECT, FROM, WHERE, AND, OR, JOIN, INNER, LEFT, RIGHT, FULL, CROSS, ON, GROUP BY, ORDER BY, LIMIT, OFFSET, INSERT, INTO, VALUES, UPDATE, SET, DELETE, HAVING, UNION, ALL, DISTINCT and AS. GROUP and ORDER count only when BY follows. A keyword inside a string or a comment is left as written.

Why did a word I meant as a name get its own line?

The formatter matches keywords as whole words, so an unquoted name such as a column called select is formatted like the clause. Quote the name with double quotes, backticks or brackets to keep it as an identifier.

Is the text I paste uploaded anywhere?

No. Formatting runs in your browser and the text you paste is never uploaded, logged or stored. Google Analytics records page views and feature use, never content.

Iternal · AI Blueprint Builder

Plan the AI initiative, not just the output

The AI Blueprint Builder scores each use case across value, feasibility, cost, governance, risk, adoption and readiness before you commit budget. Free to start, about 60 minutes.

Open the AI Blueprint Builder (opens in a new tab)