Format or minify SQL in your browser: one clause per line, optional keyword casing and indent width, plus a check for unbalanced parentheses.
Minify collapses the query to one line and removes comments. Words that match a SQL keyword are re-cased; identifiers are left as they are. No query is ever executed.
This SQL formatter rewrites a cramped one-line query into a readable layout: SELECT, FROM, JOIN, WHERE, GROUP BY, ORDER BY, LIMIT and VALUES each start on their own line, commas in a column list break onto separate lines, AND and OR start a new line, and subqueries are indented inside their parentheses. Paste your statement, pick keyword case and indent width, and the formatted result appears in the second box; string literals, quoted identifiers and comments stay as written. Minify does the opposite and squeezes everything back onto one line. The panel below counts statements, keywords and lines and reports an unterminated string, an unterminated block comment or unbalanced parentheses instead of quietly producing broken SQL. It runs in your browser and never executes a query, so it cannot change your database — but it does not know your tables or dialect either.