SQL Formatter

About SQL Formatter

SQL Formatter is a free, browser-based tool that beautifies and standardizes SQL queries and compares two SQL statements side by side. It runs entirely in your browser, so your queries never leave your device.

It reformats raw or minified SQL into clean, indented code with uppercased keywords, and it is meant for developers, analysts, and anyone reviewing or sharing queries. You can choose 2-space, 4-space, or tab indentation and pick from nine dialects: Standard SQL, MySQL, PostgreSQL, SQLite, MariaDB, BigQuery, Redshift, Snowflake, and T-SQL.

Use the Formatter tab to tidy a single query, then copy the result with one click; pasting SQL into the editor formats it automatically. Switch to the Diff tab to put an original and a modified query in two panes and see the changed lines highlighted, which is handy when reviewing edits or comparing versions.

All formatting and diffing happen locally with an in-browser library, with no server upload and no account required. The formatter follows the chosen dialect's syntax rules, so picking the dialect that matches your database gives the most accurate output.

Frequently asked questions

Does my SQL get sent to a server?
No. Formatting and comparison run entirely in your browser using a local library, so your queries are never uploaded and no account is needed.
Which SQL dialects are supported?
Nine dialects: Standard SQL, MySQL, PostgreSQL, SQLite, MariaDB, BigQuery, Redshift, Snowflake, and T-SQL (SQL Server). Choose the one matching your database for the most accurate formatting.
How do I compare two queries?
Switch to the Diff tab, paste your original query in the left pane and the modified one in the right, and the changed lines are highlighted side by side.