SQL Formatter

Make long SQL queries readable, or minify them. Pick your database. More data tools

Format and beautify SQL queries

Choose the dialect (standard SQL, MySQL, MariaDB, PostgreSQL, SQLite, SQL Server, Oracle PL/SQL or BigQuery), the keyword case and the indent. Joins, sub-queries, CASE blocks and multiple statements get a clear layout.

Minify removes comments and extra spaces while leaving string literals untouched.

Features

  • Live: the result updates while you type.
  • Clear errors: the line, the reason and, where possible, a one-click fix.
  • Open and drop files, copy or download the result, and share your input as a link.
  • Send to another tool: pass the result straight to a related tool.
  • Private: Everything runs in your browser. Your data is not uploaded to any server.

Related data tools

Frequently asked questions

Does it change my query?

No. Only spacing, line breaks and keyword case change.

Which dialect should I choose?

The one that matches your database. Standard SQL works for most simple queries.

Is my data private?

Everything runs in your browser. Your data is not uploaded to any server. You can even use the tool offline once the page has loaded.