SQL formatter

Pretty-print SQL: keyword case, one clause per line, simple indentation — or minify to a single line.

Cosmetic subset: keyword case, one clause per line, simple indentation. Comments and strings are preserved but the query is not re-parsed.

Everything runs in this browser.

How to use

  1. Paste SQL.
  2. Choose keyword case and indent width.
  3. Format or minify, then copy.

What it supports

A cosmetic subset: keyword case, clause-per-line for major clauses (SELECT/FROM/WHERE/GROUP/ORDER/JOIN/…), and consistent indent. Comments and string literals are preserved; the query is not re-validated or optimized. Input up to 512 KB.

Related tools

Related guides