SQL Formatter
Paste any SQL query and get it back clean and readable: each major clause on its own line, consistent keyword case and indentation. String literals and comments are preserved exactly. Runs fully in your browser — your queries never leave this page.
0 characters
How to use
- Paste your SQL query into the input box (or press Load Sample to try it).
- Choose keyword case, indent size and the clause-per-line option.
- Press Format SQL to see the beautified query.
- Use Copy to copy it, or Download .sql to save it as a file.
Good to know
- SELECT, FROM, WHERE, GROUP BY, ORDER BY, HAVING, LIMIT and JOINs each start on their own line.
- Nested parentheses increase indentation, so subqueries stay visually clear.
- Quoted strings and comments are protected and restored byte-for-byte.
- The tool works for SELECT, INSERT, UPDATE and DELETE statements.