Format and beautify SQL queries with 17+ dialect support. Free, private, runs in your browser.
100% private — your files never leave your browser. All processing happens locally on your device.
SQL formatting (also called SQL beautification) transforms messy, unindented SQL queries into clean, consistently styled code with proper indentation, keyword capitalization, and line breaks. Well-formatted SQL is dramatically easier to read, debug, and review — especially for complex queries with multiple JOINs, subqueries, CTEs, and window functions. Formatting doesn't change query logic; it only restructures whitespace and capitalization.
Unformatted SQL is a leading cause of bugs and misunderstandings in database work. A single long line containing a complex query is nearly impossible to review for correctness. Formatted SQL reveals the query's structure: which tables are joined, what conditions are applied, how results are grouped and ordered. Code reviews, pair programming, documentation, and debugging all benefit enormously from consistently formatted SQL.
The tool uses the sql-formatter library, which supports 17+ SQL dialects including PostgreSQL, MySQL, MariaDB, SQL Server (T-SQL), Oracle PL/SQL, BigQuery, Snowflake, SQLite, Redshift, Spark SQL, and DuckDB. You can control keyword case (UPPER, lower, preserve), indentation (2 or 4 spaces), and comma placement. A Minify mode is also available to compress SQL for storage or transmission.
Yes. Your SQL queries are formatted entirely in your browser. No data is sent to any server. This is critical for production queries that may reference sensitive table names, column names, or WHERE clause values.
PostgreSQL, MySQL, MariaDB, SQL Server (T-SQL), Oracle PL/SQL, BigQuery, Snowflake, SQLite, Redshift, Spark SQL, DuckDB, and more — 17+ dialects total.
Yes. Toggle to Minify mode to compress your SQL into a compact single-line format, removing unnecessary whitespace and newlines.
No. The formatter only changes whitespace and capitalization. Your SQL logic, table names, and values remain exactly the same.
Yes. All formatting happens in your browser. Your SQL queries are never sent to any server.