Developer utility
Standalone tool pageSQL Formatter & Beautifier Online
Instantly beautify or minify your SQL queries. Supports PostgreSQL, MySQL, SQLite, and standard SQL formatting locally in your browser.
How It Works
Enter your values into SQL Formatter, let the browser process the data, and review the result instantly.
Example
Example: use SQL Formatter to test a scenario before making a decision.
When to use this tool
- Reviewing long, complex queries exported from a database log.
- Preparing SQL code to be shared in pull requests or documentation.
- Minifying SQL queries before embedding them in application code.
How to use
- Paste your raw SQL query into the left input box.
- Select your database dialect (e.g., PostgreSQL or MySQL).
- Click "Format SQL" to beautify the code with proper indentation.
- Alternatively, click "Minify SQL" to compress the query into a single line.
Frequently Asked Questions
What is a SQL Formatter?
A SQL formatter takes messy, unindented, or minified SQL queries and automatically applies standard spacing, indentation, and capitalization rules to make them human-readable.
Which SQL dialects are supported?
This tool supports Standard SQL, PostgreSQL, MySQL, MariaDB, SQLite, and Transact-SQL (T-SQL).
Does this tool send my database queries to a server?
No. The formatting engine runs entirely in your local browser. Your SQL queries are never transmitted to our servers.