SQL Formatter
Format and beautify SQL queries. Indent, uppercase keywords, line break clauses. Free.
How to use the SQL Formatter
Why format SQL?
Readable SQL is reviewable SQL. The convention most teams follow: uppercase keywords (SELECT, FROM, WHERE), one major clause per line, columns and conditions indented. Long IN lists and complex JOINs become much easier to debug when formatted properly.
Common SQL keywords this handles
SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY, LIMIT, OFFSET, JOIN, LEFT JOIN, RIGHT JOIN, INNER JOIN, OUTER JOIN, ON, AND, OR, IN, NOT IN, BETWEEN, LIKE, IS NULL, IS NOT NULL, UNION, UNION ALL, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, TABLE and most others.
Frequently asked questions
What does an SQL formatter do?
It re-indents a query, places major clauses such as SELECT, FROM, WHERE and JOIN on their own lines and can uppercase keywords, so long queries are far easier to read and review.
Does formatting change what my query does?
No. Only whitespace and keyword case change, so the query returns the same results. Always test a formatted query before running it against production data.
Is my SQL sent to a server?
No. Formatting is done in your browser, so queries containing table or column names stay on your device.