Best Free SQL Formatter
Beautify SQL in your browser - keyword casing, clause line-breaks and indentation, with nothing uploaded.
How it works
- Paste your SQL. Drop a SELECT, INSERT, UPDATE or DELETE statement into the box.
- Format. Hit Format to uppercase keywords, break the clauses onto new lines and indent.
- Copy the result. Copy the tidy query. Everything runs in your browser - nothing is uploaded.
About this tool
Turn a one-line SQL query into something you can actually read. Paste a statement and the formatter capitalises the keywords, puts each major clause - SELECT, FROM, WHERE, the JOINs, GROUP BY, ORDER BY, AND/OR and more - on its own line, and indents the contents of parentheses. String literals, quoted identifiers and comments are left untouched. Advanced options let you switch keywords to lowercase and pick a 2-space, 4-space or tab indent. It runs entirely in your browser.
What people use it for
- Make a one-line query readable for a code review
- Standardise keyword casing across a team SQL
- Tidy a query before pasting it into a ticket or doc
- Untangle a long WHERE / JOIN chain to debug it