ARZENTIQ
DEVELOPER & DATA

SQL Formatter & Minifier

Format SQL with one clause per line, indented bodies, AND/OR on their own lines and nested subqueries — keyword case and comma style as you like — or minify it.

Readable, consistently laid-out SQL (or a one-line minified version) with strings, identifiers and comments left exactly as typed and a note of anything the formatter could not balance.

Example: A one-line SELECT with a LEFT JOIN, three WHERE conditions including an IN (subquery), GROUP BY, HAVING, ORDER BY and LIMIT comes back as 28 lines with the subquery nested inside its parentheses.

v0.1.0 · last reviewed 19 September 2026
Loading the workspace…
BUILT TO BE UNDERSTOOD

Rules,
not a parser.

How the text is tokenised, the layout rules applied to it, and what is deliberately left alone.

Tokens

The SQL is split into strings (single-, double-, back-quoted and [bracketed], with doubled or escaped quotes), comments (-- and /* */), numbers, words and punctuation. Strings, quoted identifiers and comments are never touched — a keyword inside a string stays as it is — and a word is treated as a keyword only if it is on the formatter's list (ISO core SQL plus common extensions such as LIMIT and RETURNING). Keywords are upper- or lowercased or kept as typed.

Layout

Each clause keyword — SELECT, FROM, every JOIN form, WHERE, GROUP BY, HAVING, ORDER BY, LIMIT/OFFSET, UNION, INSERT INTO, VALUES, UPDATE, SET, DELETE FROM, RETURNING, WITH — starts a line, and what follows it is indented one level. AND and OR begin new lines inside a clause. A top-level comma ends the line (trailing) or begins the next (leading); commas inside ordinary parentheses — column lists, VALUES tuples, function arguments — stay inline. A parenthesis followed by SELECT or WITH opens a subquery, whose clauses are indented a level deeper and whose closing parenthesis returns to the outer level. A parenthesis written directly after an identifier is a function call and stays attached. A semicolon ends a statement and adds a blank line.

What it does not do

It does not parse or validate: dialect-specific syntax, CASE expressions, window functions and CTE bodies are laid out by the same token rules, which is usually right and occasionally plain. Unbalanced parentheses are reported rather than repaired. Minify removes comments and collapses whitespace outside strings. Nothing leaves the browser; the same four anonymous usage counts as the rest of the site apply.

SOURCES

  • Token-based layout rules stated on the page (clause keywords, AND/OR, commas, subquery parentheses); dialect-neutral, no parsing. Keyword list: ISO/IEC 9075 core SQL plus common extensions

Last reviewed 19 September 2026. How results are checked: How we verify.