SQL Formatter and Minifier
Clean up, format, and minify SQL with dialect-aware parsing locally in your browser.
How to use SQL Formatter and Minifier
Best for
- Tidying a long SELECT query with JOIN, WHERE, GROUP BY, or ORDER BY clauses.
- Cleaning up PostgreSQL, MySQL, SQLite, BigQuery, Snowflake, or SQL Server syntax with an explicit dialect.
- Making a CTE, INSERT, UPDATE, or generated SQL statement easier to review.
- Changing SQL keyword case and indentation without uploading the query.
- Minifying simple SQL when compact text is more useful than readable layout.
Steps
- Paste a SQL query or load one of the browser-only examples.
- Select the closest SQL dialect, then choose keyword case and indentation.
- Format for readability or minify for compact output, then review the result before copying it.
Notes
- The formatter parses the selected dialect but does not execute the query or validate it against a database schema.
- Stored procedures, templating syntax, and vendor extensions outside the selected dialect may still need manual cleanup.
- Run important queries in the target database before relying on formatted output.
- Formatting runs locally in your browser; pasted queries are not sent to Tidy Utils.
FAQ
Does SQL Formatter validate SQL?
It parses the selected dialect to format the query and reports formatter errors, but it does not execute SQL or prove that tables, columns, functions, and permissions are valid in your database.
Is this a SQL beautifier?
Yes. Format mode turns compact SQL into a more readable layout and can normalize keyword case. Minify mode removes extra whitespace for a compact result.
Can I use it with MySQL, PostgreSQL, SQL Server, or SQLite?
Yes. Select PostgreSQL, MySQL, SQLite, BigQuery, Snowflake, SQL Server, or standard SQL before formatting. Unsupported extensions and stored procedures still need review in the target database.
Are SQL queries uploaded?
No. Formatting and minifying run locally in your browser. Review sensitive queries according to your own data-handling rules before pasting them into any browser tool.