SQL Formatter reformats a SQL statement so it is readable: keywords are uppercased and the main clauses, such as SELECT, FROM, WHERE, JOIN, GROUP BY and ORDER BY, are placed on their own lines with consistent indentation.
It is a rule-based formatter that runs in your browser. It does not connect to a database or validate the query, and it handles common SELECT, INSERT, UPDATE and DELETE statements best. Very dialect-specific syntax may need manual adjustment afterwards.
Advertisement
How to use SQL Formatter
1
Paste the query
Minified or messy SQL is fine.
2
Format
Generate the reformatted version.
3
Copy
Paste it back into your editor.
Use Cases
- Making a query from an ORM log readable
- Tidying SQL before a code review
- Preparing a query for documentation
Frequently Asked Questions
No. It only changes layout and keyword case.
Standard clauses common to MySQL, PostgreSQL, SQL Server and SQLite.
No. Whitespace and case do not change how a query runs.
Yes, SQL Formatter is 100% free with no usage limits, no watermarks, and no hidden charges. The platform is supported by non-intrusive advertising so all tools stay free for everyone.
Yes. SQL Formatter runs entirely in your browser using client-side JavaScript. Your files and data never leave your device and are never transmitted to our servers.