SQL
SQL Formatter
Pretty-print and organize SQL queries for better readability — with support for several common dialects.
Input
1
Formatted output
This tool runs entirely in your browser. For the best result, pick the dialect that matches your database.
ABOUT
Format SQL queries with dialect support
Queries copied from an ORM or a log are usually one long line. This tool lays them out according to the dialect (MySQL, PostgreSQL, T-SQL and more), normalises keyword case and can collapse a query back to one line. Handy for code review and for documenting complex queries.
HOW TO
How to use it
- Paste the query.
- Pick your database dialect.
- Copy the formatted result, or minify it for embedding in code.
FAQ
Frequently asked questions
Does formatting change what the query does?
No — only whitespace, line breaks and keyword case change. Execution is identical.
Is my query stored on a server?
No, formatting happens in your browser.