SQL Formatter

Beautify or minify SQL queries for easier reading. Free, no sign-up, your code stays on your device.

🔒 100% private — processing happens in your browser. Nothing is uploaded.

How to use the SQL formatter

  1. Paste a SQL query — from code, logs or a database tool.
  2. Click Format to put each clause on its own line with indented columns and sub-queries.
  3. Or click Minify to put it on one line; copy the result.

Readable SQL is easier to debug and review. The formatter understands strings, quoted identifiers, comments, joins, sub-queries and multiple statements, and works with MySQL, PostgreSQL, SQLite, SQL Server and Oracle syntax. It only changes whitespace and keyword case — never the meaning of your query.