Beautify SQL queries across dialects — PostgreSQL, MySQL, SQLite, and more. 100% in-browser.
A free, in-browser SQL formatter that beautifies queries across all major dialects — PostgreSQL, MySQL, SQLite, T-SQL, BigQuery, Redshift, Snowflake, DB2, MariaDB, and standard SQL. Paste any query and get clean, consistent indentation with configurable keyword case, tab width, and spacing between statements. Everything runs locally in your browser — your queries never leave your device.
Paste your SQL
Drop a single statement or a whole script into the input area. Minified or messy queries work fine.
Pick a dialect and options
Choose the SQL dialect that matches your database, then tune keyword case, tab width, and blank lines between queries.
Format
Click Format to reflow the query. If the SQL is unparseable you'll see a clear error pointing at the issue.
Copy or download
Copy the cleaned-up SQL to your clipboard or download it as a .sql file.
No. All parsing and formatting happens locally in your browser using the sql-formatter library. Nothing is uploaded.
Standard SQL, PostgreSQL, MySQL, SQLite, T-SQL (MSSQL), BigQuery, Redshift, Snowflake, DB2, and MariaDB. Pick the one that matches your database for the most accurate formatting.
No. This tool only reformats whitespace, indentation, and keyword case. It doesn't execute the query or check it against a real database schema.
Yes. Paste multiple semicolon-separated statements and use the 'lines between queries' option to control how many blank lines appear between them.
The formatter expects valid SQL syntax for the chosen dialect. If a query uses vendor-specific syntax not supported by the selected dialect, switch to a closer dialect (for example, 'sql' for generic queries).