SQL Formatter
Format and beautify SQL queries for MySQL, PostgreSQL, SQL Server, SQLite and more, with keyword case and indent options.
Tool
Was this tool useful?
About this tool
About SQL Formatter
Make long, one-line SQL queries readable. Choose your database dialect, indentation and whether keywords are UPPERCASE.
How it works
Powered by the open-source sql-formatter library, which understands each dialect’s keywords and syntax.
Example
select id,name from users where age>18 order by name → SELECT on its own line with each clause indented.
How to use this tool
- Paste your SQL.
- Choose the dialect, keyword case and indent size.
- Copy the formatted query.
Frequently asked questions
Is my code uploaded?
No. Everything runs in your browser, so your code and data stay on your device.
Does it check if my SQL is correct?
It formats the text but does not run it, so logic errors are not detected.
Does the SQL Formatter send my data to a server?
No. The SQL Formatter runs entirely in your browser using JavaScript, so tokens, code and data you paste stay on your device. You can even use it offline once the page has loaded.