Skip to content
DDevToolery

SQL Formatter

Reindent SQL with dialect-aware keyword handling.

Loading tool…

About this tool

Reformats a query into a consistent, readable shape: clauses on their own lines, predictable indentation, and keyword casing of your choice. The statement is parsed to do this, and never executed — there is no database behind this page and no connection to make one.

Limitations

  • Formatting only. No query is ever executed and DevToolery has no database connection.
  • Vendor-specific syntax may format imperfectly if it falls outside the selected dialect.

Questions

It cannot parse my query.
Try a different dialect. Vendor-specific syntax — T-SQL's square brackets, Postgres's dollar-quoted blocks, BigQuery's array literals — will confuse the generic parser.
Does it optimise the query?
No. Formatting changes whitespace and casing only. The statement that goes in is semantically identical to the one that comes out.
Is it safe to paste a production query?
The text is parsed in your browser and never transmitted. It is still worth removing any literal values that happen to be personal data before pasting anything anywhere.

Privacy

This page does its work in your browser. What you paste is processed by JavaScript running on your own device and is never sent to a DevToolery server — there is no server that could receive it. The page itself is a static file delivered by a CDN. See exactly what is stored.