Toolkit Hub

SQL Formatter

Pretty-print SQL queries with consistent keyword casing.

Paste SQL on the left, then Format or Minify

What is the SQL Formatter?

A SQL formatter re-indents a query so its clauses, joins and nested subqueries line up visually, and normalises keyword casing. It makes a one-line query pulled from a log or an ORM readable enough to review, without changing what the query does.

Frequently asked questions

Does formatting change the results of my query?

No. Only whitespace and keyword casing change. SQL ignores both, so the formatted query is semantically identical to the one you pasted and returns exactly the same rows.

Is it safe to paste a query containing table or column names from my database?

Yes. The query is formatted locally in your browser and never transmitted, so schema details and any literal values embedded in the SQL stay on your machine.

Related Text & Code

SQL Formatter is one of 10 tools in Text & Code on Toolkit Hub, a free collection of browser-based utilities. It requires no account and no installation. Browse all tools.