Use this legacy SQL page to work with query text. It does not connect to a database, execute statements or verify a query’s result.
Runs locally in your browserThis page reformats a statement and applies four layout rules that you choose: the indentation unit, how many blank lines separate statements, where long lines break, and whether subquery brackets sit on their own line. Everything runs in the browser.
It is the layout-oriented sibling of the SQL formatter page: that one is a straight format-or-minify pass with copy and download buttons, while this one is for adjusting how the formatted text looks.
Indent unit sets the spaces used per level: a tab, or 2, 3, 4 or 8 spaces. Line-break width wraps lines that pass 40, 70, 80, 110, 120 or 160 characters, preferring to break near a comma and falling back to a space. Bracket placement decides whether subquery parentheses stay on the statement line or move to their own line, at the opening bracket or at the closing one.
The formatter removes every run of blank lines itself, so this control is applied afterwards, from the text you pasted: remove all joins the statements tightly, keep 1, 2, 5 or 10 re-inserts up to that many empty lines where your input had them, and the unlimited option keeps as many as you wrote. Input without blank lines stays tight under every setting.
Keywords such as SELECT, FROM, JOIN, LIMIT and GROUP BY are uppercased. Text inside 'single quotes', "double quotes" and `backticks`, along with -- and /* */ comments, is returned exactly as typed, so a literal that happens to contain the word UPDATE is not touched.
Line wrapping follows the same rule: a long string literal is never broken across two lines.
The formatted statement is rendered as text in the result panel, so copy it by selecting it. Pressing the format button with an empty box clears the panel rather than leaving the previous result in place.
The statement never leaves the browser: no request carries your SQL, and nothing is sent to a database. A 4.6 KB script formats in under half a second.