SQL Formatter

Make SELECT statements and scripts readable with dialect-aware layout. SQL is a format mode in the code tools — there is no separate SQL minifier.

SQL is a formatter mode. There is no SQL minifier.

Result

Paste code, then Format. Processing stays in your browser.

How to format SQL

  1. Paste a query or script.
  2. Pick the dialect that matches your database (ANSI, MySQL, PostgreSQL, SQLite, SQL Server, or MariaDB).
  3. Click Format.
  4. Copy the pretty-printed SQL. There is no SQL minifier on this site.

FAQ

ANSI, MySQL, PostgreSQL, SQLite, SQL Server (T-SQL), and MariaDB — the set sql-formatter supports for this MVP.
No. Demand is weak and minified SQL is rarely what you want in a browser tool. Use this formatter only.
The library often still prints a best-effort layout. If keywords look wrong, change dialect rather than forcing a minify step.
No. sql-formatter runs in your browser. Do not paste production credentials into any online tool; this one at least does not send them.
Pick the dialect closest to your database. JSON operators, T-SQL brackets, or MySQL backticks may layout better under PostgreSQL, SQL Server, or MySQL modes respectively.

Related tools