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.
About this SQL formatter
Breaks queries onto readable lines — clauses, JOINs and conditions each get their own line and indent.
Collapses whitespace and drops line comments to flatten a query onto a single compact line.
Normalise SQL keywords to UPPERCASE or lowercase, or leave them exactly as you wrote them.
Nested SELECTs and parentheses are indented; function calls like COUNT(*) stay inline.
Quoted strings, identifiers and /* … */ comments are protected and never altered.
Your SQL is processed in the browser — it's never uploaded anywhere.