Too Much Tools logoToo Much Tools

SQL Formatter

Format and beautify SQL for many dialects, with keyword casing, all local.

Local, Runs entirely in your browser, your data never leaves your device.
Loading tool…

Turn a one-line query into readable SQL

A query copied from a log line, an ORM's debug output or a colleague's chat message usually arrives as one dense line with no indentation. This tool re-indents it, breaks clauses onto their own lines and applies consistent keyword casing for eight SQL dialects. Formatting runs locally in your browser, which matters when the query embeds real customer IDs, emails or other values you would rather not paste into a server.

How to use the SQL Formatter

  1. Paste the SQL into the left panel, or start from the loaded example query.
  2. Choose a dialect from the Dialect menu: Standard SQL, PostgreSQL, MySQL, MariaDB, SQLite, T-SQL or PL/SQL.
  3. Pick a keyword case: UPPERCASE, lowercase, or Preserve to leave your original casing untouched.
  4. Copy the formatted result from the right panel, or send it to another SQL tool.

Dialect matters because clause syntax differs: T-SQL uses TOP and square-bracketed identifiers, PL/SQL has its own block structure, and BigQuery's standard SQL differs from PostgreSQL in subtle ways, so picking the wrong one can misplace line breaks around dialect-specific syntax.

Frequently asked questions

Which SQL dialects does this formatter support?
Standard SQL, PostgreSQL, MySQL, MariaDB, SQLite, T-SQL (SQL Server) and PL/SQL (Oracle), plus BigQuery, each with its own keyword and clause handling from the sql-formatter library.
Does formatting change what the query does?
No, formatting only changes whitespace, line breaks and keyword casing. The clauses, identifiers and literal values in the query are left exactly as written.
Is my SQL sent to a server to be formatted?
No, the formatter runs in your browser, and for larger queries the work happens in a background worker so the page stays responsive without ever sending the SQL anywhere.
Can I choose lowercase keywords instead of uppercase?
Yes, the Keywords menu offers UPPERCASE, lowercase, or Preserve, which keeps SELECT, FROM and other keywords exactly as you typed them.