SQL Formatter

Paste a messy SQL query and get it neatly formatted — keywords uppercased, clauses indented and easy to read. Everything runs in your browser — your query is never sent anywhere and nothing is stored.

How to use the SQL formatter

  1. Pick the dialect that matches your database (Standard SQL, MySQL, PostgreSQL or SQLite).
  2. Paste or type your query into the box.
  3. Click Format, then copy the beautified result.

The formatter uppercases keywords such as SELECT, FROM, WHERE and JOIN, puts each major clause on its own line and indents nested expressions. It only changes whitespace and casing, never the meaning of your query.

More PAYATE tools

Frequently asked questions

Why should I format SQL?

Formatting makes a query readable and reviewable: keywords are uppercased, clauses are put on their own lines and nested expressions are indented. Well-formatted SQL is easier to debug, to diff in version control and to share in a pull request or ticket.

Is my SQL uploaded anywhere?

No. Formatting runs entirely in your browser — your query is never uploaded to a server and nothing is stored. It is safe to use with queries that reference private table or column names.

Which SQL dialects are supported?

You can pick Standard SQL, MySQL, PostgreSQL or SQLite. The chosen dialect controls how identifiers, functions and dialect-specific syntax are recognised so the output matches the database you are targeting.

Does formatting change what my query does?

No. The formatter only changes whitespace and keyword casing — it does not rewrite logic, reorder clauses or alter values. The formatted query is functionally identical to the one you pasted in.