SQL Formatter
Format and beautify SQL queries for multiple dialects, free in your browser. No sign-up — your code never leaves your device.
Beautify Messy SQL Queries
SQL Formatter re-indents and capitalizes keywords in a cramped or auto-generated SQL query, supporting multiple dialects including PostgreSQL, MySQL, and MariaDB, making complex queries far easier to read and review.
How to use
- Paste your SQL query into the editor.
- Select the SQL dialect that matches your database.
- Copy the formatted, readable query.
Common use cases
- Cleaning up a long query generated by an ORM before reviewing it.
- Formatting SQL for a code review or documentation.
- Making a nested subquery easier to read and debug.
More Formatting & Conversion
- XML Formatter — Format, beautify, and minify XML.
- Web Code Beautifier — Instantly format HTML, CSS, and JS.
- CSV to JSON — Convert CSV datasets into JSON arrays.
- XML ⇌ JSON — Convert structures between XML and JSON.
- URL Parser — Extract domains and query params from URLs.