SQL Formatter
Paste a minified or messy SQL query and get cleanly formatted output. Supports all major dialects — PostgreSQL, MySQL, SQLite, SQL Server, MariaDB, TransactSQL, and others. You can control keyword casing (upper/lower/preserve), indent style, and line break behavior.

What it does
- ▸Formats SQL across 12+ dialects including PostgreSQL, MySQL, SQLite, and T-SQL
- ▸Configurable keyword casing: uppercase, lowercase, or preserve original
- ▸Adjustable indent width (2, 4, or tab)
- ▸Handles complex queries with subqueries, CTEs, window functions, and JOINs
- ▸Minify mode strips all whitespace for compact storage
Use cases
- ▸Making a minified ORM-generated query readable for debugging
- ▸Standardizing SQL style across a team before code review
- ▸Formatting stored procedures or views pulled from a database
- ▸Cleaning up AI-generated SQL before running it
How it works
Paste your SQL query into the input pane
Select your database dialect from the dropdown
Choose formatting options (indent, keyword case, newlines)
The formatted SQL appears instantly in the output pane
Frequently asked questions
1Which SQL dialects are supported?
PostgreSQL, MySQL, MariaDB, SQLite, Amazon Redshift, Spark SQL, Snowflake, T-SQL (SQL Server), BigQuery, IBM DB2, and standard SQL. The formatter adjusts syntax handling based on the dialect you select.
2Does it validate the SQL?
It formats the syntax but doesn't validate against a specific database schema. The formatter is syntax-aware, so malformed SQL may produce unexpected formatting but won't crash.
3Can I minify SQL with this?
Yes. Toggle the minify option to strip all unnecessary whitespace, useful for embedding queries in application code or sending them over the wire compactly.
Related tools
Use SQL Formatter offline in Devinity
All 95 tools run locally on your Mac. No internet required, no data sent to servers.
Download Devinity →


