99+ Free Tools
← Back ✕ Close

SQL Formatter

Paste messy SQL and get clean, readable, indented code with keywords in upper case.

Rows of database server racks in a data center
Clauses start on their own lines; subqueries are indented.

SQL

Formatted SQL

Paste SQL to format it.

How this tool works

Method. Keywords are upper-cased, each clause starts on its own line, AND and OR are indented, and subqueries are indented inside their parentheses. Text inside quotes is never changed.

Privacy. Everything happens in your browser. Nothing is uploaded or shared; the recent-formatting record stays on this device only.

Limits. SQL up to 200 KB; longer input is trimmed with a warning. Unbalanced parentheses are flagged.