SQL Formatter
Format or minify SQL with dialect-aware pretty-printing.
How SQL Formatter works
This tool uses the sql-formatterlibrary — the category-standard engine behind VS Code SQL extensions and database IDEs — to parse and re-emit SQL with proper indentation, line breaks before each major clause, and consistent keyword casing. Choose from 9 dialects (Standard SQL, MySQL, PostgreSQL, T-SQL, SQLite, BigQuery, PL/SQL, MariaDB, Snowflake) for dialect-aware formatting. Keyword case options (UPPER, lower, preserve) let you match your team's style guide. Minify mode strips comments and collapses whitespace into a compact single-line query — useful for embedding in config files or query strings. Upload a .sql file or paste a query, then download the result. Everything runs locally in your browser — your queries never leave your device.
Frequently Asked Questions
Which SQL dialects does this formatter support?
Does formatting change my query's behavior?
Is my SQL safe to paste here?
Why are SQL keywords uppercased?
Can it format stored procedures and multi-statement SQL?
Private & free — this tool runs entirely in your browser.