SQL Formatter

Turn one-line SQL blobs into readable queries. Clauses break onto their own lines, joins and conditions indent cleanly, and keywords follow your casing choice.

Input

Keyword case
Indentation
All processing is done locally in your browser. Your images never leave your device.

How to use

  1. 1

    Paste your SQL query.

  2. 2

    Choose keyword casing and indent size.

  3. 3

    Press Format (or Minify for one line).

  4. 4

    Copy the result or download it as .sql.

Supported formats

Accepts

Produces

FAQ

No. Formatting is a small local algorithm — your queries never leave the tab.

Yes. String literals and comments are tokenised first, so keywords inside them are never altered.

Standard SQL shared by Postgres, MySQL, SQLite and SQL Server. Dialect-specific procedural blocks format on a best-effort basis.

It strips comments and collapses whitespace to a single line for embedding or logging.

About this tool: SQL Formatter

Readable SQL, every dialect friendlier

The SQL Formatter rewrites dense queries into properly indented, keyword-aligned SQL: each clause on its own line, JOIN conditions indented, lists expanded one item per row. Paste a query from an ORM log or a colleague's message and read its logic in seconds.

Unformatted SQL hides its own logic — a four-line query with seven nested joins is genuinely difficult to review, and review is exactly where query bugs hide. Consistent formatting turns query review into a structured scan: FROM, JOIN, WHERE, GROUP BY, each visible and each checkable.

Formatting runs locally in your browser and handles common dialect syntax (MySQL, PostgreSQL, standard SQL) gracefully. Queries — which often embed table names and business logic your organisation considers sensitive — never leave your machine.

Like every Piclizer tool, this one runs entirely in your browser — your files stay on your device.

Related tools