Tools SQL Formatter

SQL Formatter & Minifier

Beautify messy SQL with clean indentation and consistent keyword casing, or minify it to a single line. Understands SELECT, INSERT, UPDATE, DELETE, JOINs, subqueries and CTEs. Strings and comments are preserved. Everything runs locally in your browser — nothing is uploaded.

Input SQL 0 bytes
Output
0 bytes

About this SQL formatter

Beautify

Breaks queries onto readable lines — clauses, JOINs and conditions each get their own line and indent.

Minify

Collapses whitespace and drops line comments to flatten a query onto a single compact line.

Keyword casing

Normalise SQL keywords to UPPERCASE or lowercase, or leave them exactly as you wrote them.

Subqueries & CTEs

Nested SELECTs and parentheses are indented; function calls like COUNT(*) stay inline.

Safe by design

Quoted strings, identifiers and /* … */ comments are protected and never altered.

Private

Your SQL is processed in the browser — it's never uploaded anywhere.

📬 Weekly Newsletter

Stay ahead of the curve

Get the best programming tutorials, data analytics tips, and tool reviews delivered to your inbox every week.

No spam. Unsubscribe anytime.