SQL Formatter
Paste a squashed or hard-to-read SQL query and get it back neatly formatted with consistent indentation and line breaks. Choose your database dialect — MySQL, PostgreSQL, SQLite, SQL Server, Oracle, BigQuery and many more — and pick whether keywords are uppercased. Everything runs in your browser.
- Free
- No sign-up
- Runs in your browser
Your query is formatted locally in your browser and is never uploaded.
How to use SQL Formatter
- Paste your SQL query into the box.
- Choose your database dialect from the list.
- Optionally untick “Uppercase keywords” to keep your casing.
- Press “Format”, then copy or download the tidy query.
About this tool
SQL written in one long line is hard to read, review and debug. Proper indentation makes the structure of a query obvious at a glance.
This formatter understands real SQL grammar for each dialect, so it breaks lines in the right places — around SELECT, FROM, JOIN, WHERE and nested parentheses — rather than guessing.
Frequently asked questions
Which databases are supported?
Does formatting change what my query does?
Why pick a dialect?
Will it uppercase my keywords?
Is my query kept private?
Related tools
How to use Sql Formatter
Paste your code, data, or URL into the Sql Formatter input area. Select the appropriate mode or option, then process. The formatted or converted output appears clearly and can be copied or saved.
Practical benefits
- Complete tasks faster without installing additional software.
- Keep files private since processing happens in your browser.
- Produce consistent results that integrate into your workflow.