Skip to content

← All tools

SQL Formatter

Turn a wall-of-text query into readable SQL: clause-aware line breaks and indentation, optional keyword uppercasing and one-column-per-line, plus a minify mode. Pure text manipulation in your browser — your SQL is never uploaded or executed.

New to this? Read the SQL Formatter guide →

Mode

What the formatter does

It re-indents your query along its clause structure: major clauses (SELECT, FROM, WHERE, GROUP BY…) start new lines, JOIN … ON pairs get their own lines, AND/OR conditions indent under their clause, and subqueries indent with their parentheses. Keyword uppercasing and one-column-per-line are toggles, so the output matches your team's style. Strings and comments are never touched.

Honest limits

This is a whitespace formatter, not a SQL parser: it does not validate your query, and unusual dialect syntax may come out plainer than a dialect-aware tool would manage — but it will never reorder tokens or alter strings, so the query's meaning cannot change. Nothing you paste is uploaded or executed; formatting is pure text manipulation in your browser, which is exactly what you want when the query contains production table names. The guide covers the style decisions themselves.

Frequently asked questions

Does the formatter change what my query does?

No. It only moves whitespace and (optionally) uppercases keywords — tokens are never reordered and string literals are never touched, so the query’s meaning cannot change. It is a formatter, not a rewriter.

Which SQL dialects does it support?

The formatting rules are dialect-neutral and work on standard SQL from Postgres, MySQL, SQLite, SQL Server and BigQuery. Unusual dialect-specific syntax is passed through untouched rather than misformatted — it just may not get special line-break treatment.

Is my SQL uploaded or executed anywhere?

Neither. Formatting is pure text manipulation running locally in your browser — which matters when the query is full of production table names. Nothing is sent to a server and nothing is executed.

What does minify mode do?

It collapses the query to a single line (optionally stripping comments) for embedding in JSON payloads, config values or log lines. SQL ignores whitespace outside strings, so the meaning is unchanged.

Related tools