SQL formatter & beautifier

Turn a spaghetti query into a readable, indented statement with upcased keywords and clause-aware line breaks — or collapse it down to a compact one-liner.

How to SQL formatter & beautifier

  1. Step 1. Paste your SQL statement into the Input Buffer.
  2. Step 2. Click Format SQL for pretty output, or Minify SQL for a compact one-liner.
  3. Step 3. Copy the result from the Output Buffer.

Frequently asked questions

Does the formatter understand quoted strings?

Yes. Single-quoted strings, double-quoted identifiers, and backtick literals are tokenized and never modified — only keywords outside strings are upcased.

Which clauses trigger a new line?

SELECT, FROM, WHERE, JOIN, GROUP BY, HAVING, ORDER BY, LIMIT, VALUES, and similar top-level clauses each start on their own line, with TOP-level commas breaking selected columns onto separate lines.

Where does formatting run?

100% client-side — your SQL never leaves the browser.