SQL formatter
Paste a query, get it laid out one clause per line with keywords in capitals. Works for Oracle and standard SQL.
Why format SQL
Queries from ORMs, logs and monitoring tools are often one long line. Putting each clause on its own line, indenting subqueries and aligning AND/OR conditions makes a query reviewable: you can see the joins, the filters and the ordering at a glance, and spot a missing join condition before it becomes a cross join.
The layout used here: major clauses (SELECT, FROM, WHERE, GROUP BY, ORDER BY) start a new line, select-list columns get a line each, joins get their own line, and conditions are indented under the clause.
Frequently asked questions
Does it support Oracle syntax?
Yes for everyday Oracle SQL: CONNECT BY, START WITH, NVL, ROWNUM, FETCH FIRST, MERGE and (+) joins are laid out sensibly. It is a formatter, not a validator, so it will not tell you if the query is wrong.
Does it change my query?
No. It only changes whitespace and the case of keywords. String literals, quoted identifiers and comments are preserved exactly.
Is my SQL uploaded?
No. Formatting runs in your browser.
Why uppercase keywords?
It makes the structure stand out from table and column names. Most style guides recommend it for SQL.