# SQL Formatter

Canonical: https://herebetools.com/sql-format

Format and beautify SQL queries

Paste a SQL query to format it with consistent indentation, keyword casing, and logical line breaks. Handles SELECT, INSERT, UPDATE, DELETE, CREATE TABLE, and complex queries with subqueries, JOINs, and WHERE clauses. Useful for making auto-generated ORM queries readable, preparing SQL for documentation, reviewing query plans, and cleaning up minified SQL from logs.

## Questions and answers

### Which SQL dialects are supported?

The formatter handles standard SQL and common syntax from MySQL, PostgreSQL, and SQL Server.

### Can I minify SQL to reduce file size?

Yes, minify mode removes unnecessary whitespace to compress SQL for embedding in code or configuration files.

## Related tools

- [JSON Formatter](https://herebetools.com/json-formatter): Format, validate, minify and sort JSON with tree view
- [XML Formatter](https://herebetools.com/xml-format): Format and validate XML, test XPath expressions
- [HTML Formatter](https://herebetools.com/html-format): Format and minify HTML, JS, and CSS

Tool processing runs in your browser.

[Privacy policy](https://herebetools.com/privacy-policy) · [About](https://herebetools.com/facts) · [Topics](https://herebetools.com/topics)
