SQL Formatter & Beautifier
Format, beautify and minify any SQL query in your browser — keyword case, indent size, no upload. Free and private.
Everything runs in your browser — your SQL never leaves your device.
1
About SQL Formatter & Beautifier
This SQL formatter and beautifier turns dense, single-line queries into readable, consistently indented SQL — and can minify formatted SQL back to one line for logs or embedding. Choose the keyword case (UPPERCASE, lowercase, or keep as written) and the indent style: two spaces, four spaces or tabs.
It handles the everyday dialect-agnostic constructs — SELECT lists, JOINs, WHERE clauses, subqueries, GROUP BY and ORDER BY — making review, debugging and code-review diffs far easier than reading machine-generated or ORM-emitted SQL in raw form.
The formatter runs entirely in your browser; your SQL never leaves your device, so queries containing table names, schema details or embedded values stay private. Paste a query or try the sample, then copy the result or download it as formatted.sql.
How to use SQL Formatter & Beautifier
- Paste or type your SQL into the input pane, or click Sample to try an example query.
- Choose Beautify to pretty-print or Minify to collapse to one line.
- Set the keyword case — UPPER, lower or Keep — and the indent (2 spaces, 4 spaces or tab).
- Review the formatted output and its line count.
- Copy the result or download it as formatted.sql.