SQL Formatter
Paste messy SQL and get consistently formatted, readable output with proper indentation and uppercase keywords. Supports standard SQL plus MySQL, PostgreSQL, SQLite, SQL Server and BigQuery dialects. Your queries are formatted locally — nothing is sent to a server, so production SQL stays private.
Examples
select id,name from users where active=1 order by name
SELECT id, name FROM users WHERE active = 1 ORDER BY name
How it works
Formatting is done by the open-source sql-formatter library, loaded into your browser the first time you use the tool. Keywords are written in upper case, each clause starts on its own line and nested parts are indented by two spaces.
The dialect setting matters because each database has its own quoting and operators. Standard SQL, MySQL, PostgreSQL, SQLite, SQL Server and BigQuery are available; pick the one your query was written for so backticks, square brackets or dollar-quoted strings are read correctly.
Only whitespace and keyword case change. The formatter does not run or validate the query, so a statement with a wrong table name formats without complaint, and text it cannot split into tokens is reported as an error.
How to use SQL Formatter
Why use this tool
Frequently asked questions
Yes. Formatting happens entirely in your browser — your SQL is never transmitted or stored. Still, avoid sharing queries containing embedded credentials.
Standard SQL, MySQL, PostgreSQL, SQLite, SQL Server (T-SQL) and BigQuery. Dialect affects how identifiers, operators and dialect-specific keywords are parsed.
No. Formatting only changes whitespace and keyword casing — the query logic is untouched.
Found a bug or have an idea?
ToolOrbit is actively developed — feedback directly shapes what gets built next.
Send feedback